diff --git a/.gitignore b/.gitignore index 92f7fde..9f1681c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ composer.phar # php-cs-fixer cache .php_cs.cache +.php-cs-fixer.cache # PHPUnit cache .phpunit.result.cache diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c176cdc..7ea4f74 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,5 +1,5 @@ .gitignore -.php_cs +.php-cs-fixer.dist.php .travis.yml README.md composer.json @@ -46,6 +46,7 @@ docs/Api/SMSApi.md docs/Api/ServicesApi.md docs/Api/SettingsApi.md docs/Api/ShopifyTerminalApi.md +docs/Api/SmsSubscriberApi.md docs/Api/StaticVoucherCampaignGroupsApi.md docs/Api/StaticVoucherCampaignsApi.md docs/Api/StaticVouchersApi.md @@ -64,13 +65,6 @@ docs/Model/AdvertisementCreditScan.md docs/Model/Amenity.md docs/Model/Announcement.md docs/Model/ApplicableTerminals.md -docs/Model/ApplicableTerminalsAnyOf.md -docs/Model/ApplicableTerminalsAnyOf1.md -docs/Model/ApplicableTerminalsAnyOf2.md -docs/Model/ApplicableTerminalsAnyOf3.md -docs/Model/ApplicableTerminalsAnyOf4.md -docs/Model/ApplicableTerminalsAnyOf5.md -docs/Model/ApplicableTerminalsAnyOf6.md docs/Model/AuthError.md docs/Model/AvailablePhoneNumbersRequest.md docs/Model/BrowserDetails.md @@ -80,6 +74,7 @@ docs/Model/BusinessRegionsOfOperation.md docs/Model/BusinessRegistrationIdentifier.md docs/Model/BusinessStockExchanges.md docs/Model/BusinessType.md +docs/Model/ClaimTicketRequest.md docs/Model/ClickFunnelAmount.md docs/Model/ClickFunnelContact.md docs/Model/ClickFunnelContactProfile.md @@ -88,6 +83,8 @@ docs/Model/ClickFunnelOriginalAmount.md docs/Model/ClickFunnelProduct.md docs/Model/ClickFunnelPurchase.md docs/Model/ClickFunnelRegistration.md +docs/Model/CountClaimedComps200Response.md +docs/Model/CreateFile200Response.md docs/Model/CreateStaticVoucherCampaign.md docs/Model/CreateStaticVoucherCampaignWithVoucherWithCSV.md docs/Model/DashboardWidget.md @@ -96,48 +93,54 @@ docs/Model/Document.md docs/Model/DuplicateRowFound.md docs/Model/DynamicVoucher.md docs/Model/DynamicVoucherBroadcast.md +docs/Model/DynamicVoucherBroadcastListType.md +docs/Model/DynamicVoucherTemporalDecreaseFrequencyType.md docs/Model/EmailSubscriber.md docs/Model/Employee.md docs/Model/EmployeeAPIKey.md docs/Model/EmployeeActivityLog.md docs/Model/EmployeeAlert.md +docs/Model/EmployeeScheduleStartDay.md +docs/Model/EmployeeScheduleStartHour.md +docs/Model/EmployeeScheduleStartMeridiem.md +docs/Model/EmployeeScheduleStartMinute.md docs/Model/EntityTooLarge.md docs/Model/ExportDataFile.md docs/Model/FalsumError.md docs/Model/FalsumField.md docs/Model/Feature.md +docs/Model/FetchAllCountries200ResponseInner.md +docs/Model/FetchAllLedgerTransactions200Response.md +docs/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner.md +docs/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType.md +docs/Model/FetchCustomerTicketsWithTokenRequest.md +docs/Model/FetchDomainsByIndustry200Response.md +docs/Model/FetchImportedListRecipientsByPage200Response.md +docs/Model/FetchInboundSMSByPage200Response.md +docs/Model/FetchIndustry200Response.md +docs/Model/FetchMembersCount200Response.md +docs/Model/FetchOptInListSubscribersByPage200Response.md +docs/Model/FetchOutboundSMSByPage200Response.md +docs/Model/FetchPerformanceTicketsPage200Response.md +docs/Model/FetchStaticVouchersPage200Response.md docs/Model/ForbiddenRequest.md docs/Model/ForeignKeyDoesNotExist.md docs/Model/Gaming.md docs/Model/HelpDeskRequest.md docs/Model/ImageGrid.md +docs/Model/ImportTicketsRequest.md docs/Model/ImportedList.md docs/Model/ImportedListRecipient.md docs/Model/InboundSMS.md -docs/Model/InlineObject.md -docs/Model/InlineObject1.md -docs/Model/InlineObject2.md -docs/Model/InlineObject3.md -docs/Model/InlineObject4.md -docs/Model/InlineObject5.md -docs/Model/InlineResponse200.md -docs/Model/InlineResponse2001.md -docs/Model/InlineResponse20010.md -docs/Model/InlineResponse20011.md -docs/Model/InlineResponse20012.md -docs/Model/InlineResponse2002.md -docs/Model/InlineResponse2003.md -docs/Model/InlineResponse2004.md -docs/Model/InlineResponse2005.md -docs/Model/InlineResponse2006.md -docs/Model/InlineResponse2007.md -docs/Model/InlineResponse2008.md -docs/Model/InlineResponse2009.md docs/Model/InternalServerError.md docs/Model/JobPosition.md docs/Model/LedgerEntry.md +docs/Model/LedgerEntryParentObjectID.md +docs/Model/LedgerEntryTransactionType.md docs/Model/LinkBook.md docs/Model/LinkBookSection.md +docs/Model/LoginStatus200Response.md +docs/Model/LoginStatus200ResponseAnyOf.md docs/Model/Lounge.md docs/Model/MSAnalyticsMemberCountPartitionedByDate.md docs/Model/MSAnalyticsMemberPointsRedeemedPartitionedByDate.md @@ -148,6 +151,7 @@ docs/Model/MSMemberHistory.md docs/Model/MSMemberHistoryPagination.md docs/Model/MSMemberRedemption.md docs/Model/MSMemberRedemptionPagination.md +docs/Model/MSMemberRedemptionTransactionType.md docs/Model/MSMembershipTierHistory.md docs/Model/MSMembershipTierHistoryPagination.md docs/Model/MSMembershipTierRedemption.md @@ -159,25 +163,15 @@ docs/Model/MSMerchantCreditRedemptionPagination.md docs/Model/MediaFile.md docs/Model/Member.md docs/Model/MemberSearch.md +docs/Model/MemberSearchSearchKey.md +docs/Model/MemberSearchSortKey.md docs/Model/Merchant.md docs/Model/MerchantCreditSearch.md docs/Model/MerchantNotInitialized.md docs/Model/MerchantURL.md docs/Model/Message.md docs/Model/MessageDirection.md -docs/Model/MessageDirectionAnyOf.md -docs/Model/MessageDirectionAnyOf1.md -docs/Model/MessageDirectionAnyOf2.md -docs/Model/MessageDirectionAnyOf3.md docs/Model/MessageStatus.md -docs/Model/MessageStatusAnyOf.md -docs/Model/MessageStatusAnyOf1.md -docs/Model/MessageStatusAnyOf2.md -docs/Model/MessageStatusAnyOf3.md -docs/Model/MessageStatusAnyOf4.md -docs/Model/MessageStatusAnyOf5.md -docs/Model/MessageStatusAnyOf6.md -docs/Model/MessageStatusAnyOf7.md docs/Model/ModuleError.md docs/Model/NewsArticle.md docs/Model/OptInList.md @@ -188,6 +182,7 @@ docs/Model/PaginatedWTMembers.md docs/Model/PaginatedWTMerchantCredits.md docs/Model/PaginationRequestWithIDAndWithoutSortOptions.md docs/Model/PaginationRequestWithSortOptions.md +docs/Model/PaginationRequestWithSortOptionsSortOrder.md docs/Model/PaymentDesign.md docs/Model/Performance.md docs/Model/PhoneNumber.md @@ -207,24 +202,34 @@ docs/Model/PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsI docs/Model/PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId.md docs/Model/PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs.md docs/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount.md +docs/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID.md docs/Model/PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId.md docs/Model/PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId.md docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.md +docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID.md +docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus.md docs/Model/PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID.md docs/Model/PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.md docs/Model/PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.md docs/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.md +docs/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md docs/Model/PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType.md docs/Model/PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID.md docs/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.md +docs/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.md docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.md +docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md +docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.md docs/Model/PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId.md docs/Model/PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.md -docs/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber.md +docs/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday.md docs/Model/PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.md docs/Model/PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID.md docs/Model/PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId.md docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.md +docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.md +docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.md +docs/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId.md docs/Model/PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.md docs/Model/PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID.md docs/Model/Plan.md @@ -244,31 +249,27 @@ docs/Model/RoomRate.md docs/Model/SSImportedListRecipientCreateParams.md docs/Model/SSOptInSource.md docs/Model/SSOutboundStatuses.md -docs/Model/SSOutboundStatusesAnyOf.md -docs/Model/SSOutboundStatusesAnyOf1.md -docs/Model/SSOutboundStatusesAnyOf2.md -docs/Model/SSOutboundStatusesAnyOf3.md -docs/Model/SSOutboundStatusesAnyOf4.md -docs/Model/SSOutboundStatusesAnyOf5.md +docs/Model/SaveMerchantCreditPaymentDesignRequest.md +docs/Model/SaveTicketSettingsRequest.md +docs/Model/SaveTicketSettingsRequestPaymentDesignID.md docs/Model/Service.md docs/Model/SimpleSMSBroadcast.md +docs/Model/SmsSubscriber.md docs/Model/StaticVoucher.md docs/Model/StaticVoucherCampaign.md docs/Model/StaticVoucherCampaignBroadcast.md docs/Model/StaticVoucherCampaignGroup.md docs/Model/StaticVoucherCampaignUpdate.md docs/Model/Status.md -docs/Model/StatusAnyOf.md -docs/Model/StatusAnyOf1.md -docs/Model/StatusAnyOf2.md -docs/Model/StatusAnyOf3.md docs/Model/SubscriptionFeature.md docs/Model/SubscriptionPlan.md docs/Model/SubscriptionProduct.md docs/Model/Tcpa.md docs/Model/Ticket.md docs/Model/TrustBundleStatuses.md +docs/Model/UpdateEmailNotificationPreferenceRequest.md docs/Model/UpdateStaticVoucherCampaignWithVoucher.md +docs/Model/UpdateStaticVoucherCampaignWithVoucherVoucherID.md docs/Model/VSCampaignGeneratedMessage.md docs/Model/VSCampaignGeneratedMessagePagination.md docs/Model/VSDynamicVoucherStatus.md @@ -300,7 +301,9 @@ docs/Model/WTDiningUpdateParams.md docs/Model/WTDynamicVoucher.md docs/Model/WTDynamicVoucherCreateParams.md docs/Model/WTDynamicVoucherRedemption.md +docs/Model/WTDynamicVoucherRedemptionTransactionType.md docs/Model/WTDynamicVoucherSummary.md +docs/Model/WTDynamicVoucherSummaryStatus.md docs/Model/WTDynamicVoucherUpdateParams.md docs/Model/WTEmailSubscriberCreateParams.md docs/Model/WTEmailSubscriberCreateParamsWalletUI.md @@ -316,10 +319,13 @@ docs/Model/WTEmployeeCreateStaticVoucherCampaignGroup.md docs/Model/WTEmployeeFileCreate.md docs/Model/WTEmployeeImportRecords.md docs/Model/WTEmployeeNotification.md +docs/Model/WTEmployeeNotificationType.md docs/Model/WTEmployeePeerRoles.md docs/Model/WTEmployeeS3FilePresign.md +docs/Model/WTEmployeeS3FilePresignContext.md docs/Model/WTEmployeeScheduleSMSCampaignBroadcast.md docs/Model/WTEmployeeScheduleSimpleSMS.md +docs/Model/WTEmployeeScheduleSimpleSMSListType.md docs/Model/WTEmployeeScheduleSimpleSMSToRecipient.md docs/Model/WTEmployeeSendHelpDeskResponse.md docs/Model/WTEmployeeUpdate.md @@ -331,12 +337,14 @@ docs/Model/WTImageGridCreateParams.md docs/Model/WTImageGridUpdateParams.md docs/Model/WTImportedList.md docs/Model/WTImportedListRecipientFromMembershipTierImport.md +docs/Model/WTImportedListRecipientFromMembershipTierImportTierID.md docs/Model/WTInfoGenesisLookupRequestErrors.md docs/Model/WTInfoGenesisRecordFilterParameters.md docs/Model/WTInfoGenesisRoutingIDs.md docs/Model/WTInfoGenesisUniquePostingIDs.md docs/Model/WTLinkBook.md docs/Model/WTLinkBookCreateParams.md +docs/Model/WTLinkBookLinkBookSectionID.md docs/Model/WTLinkBookSectionCreateParams.md docs/Model/WTLinkBookSectionUpdateParams.md docs/Model/WTLinkBookUpdateParams.md @@ -347,6 +355,7 @@ docs/Model/WTMember.md docs/Model/WTMemberCreationParams.md docs/Model/WTMembershipTier.md docs/Model/WTMembershipTierCreationParams.md +docs/Model/WTMembershipTierId.md docs/Model/WTMembershipTierUpdateParams.md docs/Model/WTMembershipTierWithMemberCount.md docs/Model/WTMerchantCredit.md @@ -387,6 +396,9 @@ docs/Model/WTSMSUpdatePhoneNumberConfig.md docs/Model/WTServiceCreateParams.md docs/Model/WTServiceUpdateParams.md docs/Model/WTSettingsSetPassword.md +docs/Model/WTSmsSubscriberCreateParams.md +docs/Model/WTSmsSubscriberCreateParamsWalletUI.md +docs/Model/WTSmsSubscriberUpdateParams.md docs/Model/WTStaticVoucher.md docs/Model/WTStaticVoucherCampaign.md docs/Model/WTStaticVoucherCampaignPreviewMessages.md @@ -396,6 +408,8 @@ docs/Model/WTStaticVoucherUpdateParams.md docs/Model/WTSystemApprovePhoneNumber.md docs/Model/WTSystemRoleCreate.md docs/Model/WTTCPAOpt.md +docs/Model/WTTCPAOptListID.md +docs/Model/WTTCPAOptSourceID.md docs/Model/WTTicket.md docs/Model/WTTicketCreateParams.md docs/Model/WTTicketUpdateParams.md @@ -411,7 +425,9 @@ docs/Model/WTWalletObjectPrefixCounts.md docs/Model/WTWalletPageView.md docs/Model/WTWalletPageViewCount.md docs/Model/WTWalletPageViewGeoPoint.md +docs/Model/WTWalletPageViewId.md docs/Model/WalletConfiguration.md +docs/Model/WalletConfigurationSmsOptInSourceID.md docs/Model/WalletPageView.md docs/Model/Webpage.md git_push.sh @@ -458,6 +474,7 @@ lib/Api/SMSApi.php lib/Api/ServicesApi.php lib/Api/SettingsApi.php lib/Api/ShopifyTerminalApi.php +lib/Api/SmsSubscriberApi.php lib/Api/StaticVoucherCampaignGroupsApi.php lib/Api/StaticVoucherCampaignsApi.php lib/Api/StaticVouchersApi.php @@ -479,13 +496,6 @@ lib/Model/AdvertisementCreditScan.php lib/Model/Amenity.php lib/Model/Announcement.php lib/Model/ApplicableTerminals.php -lib/Model/ApplicableTerminalsAnyOf.php -lib/Model/ApplicableTerminalsAnyOf1.php -lib/Model/ApplicableTerminalsAnyOf2.php -lib/Model/ApplicableTerminalsAnyOf3.php -lib/Model/ApplicableTerminalsAnyOf4.php -lib/Model/ApplicableTerminalsAnyOf5.php -lib/Model/ApplicableTerminalsAnyOf6.php lib/Model/AuthError.php lib/Model/AvailablePhoneNumbersRequest.php lib/Model/BrowserDetails.php @@ -495,6 +505,7 @@ lib/Model/BusinessRegionsOfOperation.php lib/Model/BusinessRegistrationIdentifier.php lib/Model/BusinessStockExchanges.php lib/Model/BusinessType.php +lib/Model/ClaimTicketRequest.php lib/Model/ClickFunnelAmount.php lib/Model/ClickFunnelContact.php lib/Model/ClickFunnelContactProfile.php @@ -503,6 +514,8 @@ lib/Model/ClickFunnelOriginalAmount.php lib/Model/ClickFunnelProduct.php lib/Model/ClickFunnelPurchase.php lib/Model/ClickFunnelRegistration.php +lib/Model/CountClaimedComps200Response.php +lib/Model/CreateFile200Response.php lib/Model/CreateStaticVoucherCampaign.php lib/Model/CreateStaticVoucherCampaignWithVoucherWithCSV.php lib/Model/DashboardWidget.php @@ -511,48 +524,54 @@ lib/Model/Document.php lib/Model/DuplicateRowFound.php lib/Model/DynamicVoucher.php lib/Model/DynamicVoucherBroadcast.php +lib/Model/DynamicVoucherBroadcastListType.php +lib/Model/DynamicVoucherTemporalDecreaseFrequencyType.php lib/Model/EmailSubscriber.php lib/Model/Employee.php lib/Model/EmployeeAPIKey.php lib/Model/EmployeeActivityLog.php lib/Model/EmployeeAlert.php +lib/Model/EmployeeScheduleStartDay.php +lib/Model/EmployeeScheduleStartHour.php +lib/Model/EmployeeScheduleStartMeridiem.php +lib/Model/EmployeeScheduleStartMinute.php lib/Model/EntityTooLarge.php lib/Model/ExportDataFile.php lib/Model/FalsumError.php lib/Model/FalsumField.php lib/Model/Feature.php +lib/Model/FetchAllCountries200ResponseInner.php +lib/Model/FetchAllLedgerTransactions200Response.php +lib/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner.php +lib/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType.php +lib/Model/FetchCustomerTicketsWithTokenRequest.php +lib/Model/FetchDomainsByIndustry200Response.php +lib/Model/FetchImportedListRecipientsByPage200Response.php +lib/Model/FetchInboundSMSByPage200Response.php +lib/Model/FetchIndustry200Response.php +lib/Model/FetchMembersCount200Response.php +lib/Model/FetchOptInListSubscribersByPage200Response.php +lib/Model/FetchOutboundSMSByPage200Response.php +lib/Model/FetchPerformanceTicketsPage200Response.php +lib/Model/FetchStaticVouchersPage200Response.php lib/Model/ForbiddenRequest.php lib/Model/ForeignKeyDoesNotExist.php lib/Model/Gaming.php lib/Model/HelpDeskRequest.php lib/Model/ImageGrid.php +lib/Model/ImportTicketsRequest.php lib/Model/ImportedList.php lib/Model/ImportedListRecipient.php lib/Model/InboundSMS.php -lib/Model/InlineObject.php -lib/Model/InlineObject1.php -lib/Model/InlineObject2.php -lib/Model/InlineObject3.php -lib/Model/InlineObject4.php -lib/Model/InlineObject5.php -lib/Model/InlineResponse200.php -lib/Model/InlineResponse2001.php -lib/Model/InlineResponse20010.php -lib/Model/InlineResponse20011.php -lib/Model/InlineResponse20012.php -lib/Model/InlineResponse2002.php -lib/Model/InlineResponse2003.php -lib/Model/InlineResponse2004.php -lib/Model/InlineResponse2005.php -lib/Model/InlineResponse2006.php -lib/Model/InlineResponse2007.php -lib/Model/InlineResponse2008.php -lib/Model/InlineResponse2009.php lib/Model/InternalServerError.php lib/Model/JobPosition.php lib/Model/LedgerEntry.php +lib/Model/LedgerEntryParentObjectID.php +lib/Model/LedgerEntryTransactionType.php lib/Model/LinkBook.php lib/Model/LinkBookSection.php +lib/Model/LoginStatus200Response.php +lib/Model/LoginStatus200ResponseAnyOf.php lib/Model/Lounge.php lib/Model/MSAnalyticsMemberCountPartitionedByDate.php lib/Model/MSAnalyticsMemberPointsRedeemedPartitionedByDate.php @@ -563,6 +582,7 @@ lib/Model/MSMemberHistory.php lib/Model/MSMemberHistoryPagination.php lib/Model/MSMemberRedemption.php lib/Model/MSMemberRedemptionPagination.php +lib/Model/MSMemberRedemptionTransactionType.php lib/Model/MSMembershipTierHistory.php lib/Model/MSMembershipTierHistoryPagination.php lib/Model/MSMembershipTierRedemption.php @@ -574,25 +594,15 @@ lib/Model/MSMerchantCreditRedemptionPagination.php lib/Model/MediaFile.php lib/Model/Member.php lib/Model/MemberSearch.php +lib/Model/MemberSearchSearchKey.php +lib/Model/MemberSearchSortKey.php lib/Model/Merchant.php lib/Model/MerchantCreditSearch.php lib/Model/MerchantNotInitialized.php lib/Model/MerchantURL.php lib/Model/Message.php lib/Model/MessageDirection.php -lib/Model/MessageDirectionAnyOf.php -lib/Model/MessageDirectionAnyOf1.php -lib/Model/MessageDirectionAnyOf2.php -lib/Model/MessageDirectionAnyOf3.php lib/Model/MessageStatus.php -lib/Model/MessageStatusAnyOf.php -lib/Model/MessageStatusAnyOf1.php -lib/Model/MessageStatusAnyOf2.php -lib/Model/MessageStatusAnyOf3.php -lib/Model/MessageStatusAnyOf4.php -lib/Model/MessageStatusAnyOf5.php -lib/Model/MessageStatusAnyOf6.php -lib/Model/MessageStatusAnyOf7.php lib/Model/ModelInterface.php lib/Model/ModuleError.php lib/Model/NewsArticle.php @@ -604,6 +614,7 @@ lib/Model/PaginatedWTMembers.php lib/Model/PaginatedWTMerchantCredits.php lib/Model/PaginationRequestWithIDAndWithoutSortOptions.php lib/Model/PaginationRequestWithSortOptions.php +lib/Model/PaginationRequestWithSortOptionsSortOrder.php lib/Model/PaymentDesign.php lib/Model/Performance.php lib/Model/PhoneNumber.php @@ -623,24 +634,34 @@ lib/Model/PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId lib/Model/PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId.php lib/Model/PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs.php lib/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount.php +lib/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID.php lib/Model/PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId.php lib/Model/PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId.php lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.php +lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID.php +lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus.php lib/Model/PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID.php lib/Model/PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.php lib/Model/PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.php lib/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.php +lib/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.php lib/Model/PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType.php lib/Model/PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID.php lib/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.php +lib/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.php lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.php +lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.php +lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.php lib/Model/PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId.php lib/Model/PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.php -lib/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber.php +lib/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday.php lib/Model/PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.php lib/Model/PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID.php lib/Model/PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId.php lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.php +lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.php +lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.php +lib/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId.php lib/Model/PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.php lib/Model/PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID.php lib/Model/Plan.php @@ -660,31 +681,27 @@ lib/Model/RoomRate.php lib/Model/SSImportedListRecipientCreateParams.php lib/Model/SSOptInSource.php lib/Model/SSOutboundStatuses.php -lib/Model/SSOutboundStatusesAnyOf.php -lib/Model/SSOutboundStatusesAnyOf1.php -lib/Model/SSOutboundStatusesAnyOf2.php -lib/Model/SSOutboundStatusesAnyOf3.php -lib/Model/SSOutboundStatusesAnyOf4.php -lib/Model/SSOutboundStatusesAnyOf5.php +lib/Model/SaveMerchantCreditPaymentDesignRequest.php +lib/Model/SaveTicketSettingsRequest.php +lib/Model/SaveTicketSettingsRequestPaymentDesignID.php lib/Model/Service.php lib/Model/SimpleSMSBroadcast.php +lib/Model/SmsSubscriber.php lib/Model/StaticVoucher.php lib/Model/StaticVoucherCampaign.php lib/Model/StaticVoucherCampaignBroadcast.php lib/Model/StaticVoucherCampaignGroup.php lib/Model/StaticVoucherCampaignUpdate.php lib/Model/Status.php -lib/Model/StatusAnyOf.php -lib/Model/StatusAnyOf1.php -lib/Model/StatusAnyOf2.php -lib/Model/StatusAnyOf3.php lib/Model/SubscriptionFeature.php lib/Model/SubscriptionPlan.php lib/Model/SubscriptionProduct.php lib/Model/Tcpa.php lib/Model/Ticket.php lib/Model/TrustBundleStatuses.php +lib/Model/UpdateEmailNotificationPreferenceRequest.php lib/Model/UpdateStaticVoucherCampaignWithVoucher.php +lib/Model/UpdateStaticVoucherCampaignWithVoucherVoucherID.php lib/Model/VSCampaignGeneratedMessage.php lib/Model/VSCampaignGeneratedMessagePagination.php lib/Model/VSDynamicVoucherStatus.php @@ -716,7 +733,9 @@ lib/Model/WTDiningUpdateParams.php lib/Model/WTDynamicVoucher.php lib/Model/WTDynamicVoucherCreateParams.php lib/Model/WTDynamicVoucherRedemption.php +lib/Model/WTDynamicVoucherRedemptionTransactionType.php lib/Model/WTDynamicVoucherSummary.php +lib/Model/WTDynamicVoucherSummaryStatus.php lib/Model/WTDynamicVoucherUpdateParams.php lib/Model/WTEmailSubscriberCreateParams.php lib/Model/WTEmailSubscriberCreateParamsWalletUI.php @@ -732,10 +751,13 @@ lib/Model/WTEmployeeCreateStaticVoucherCampaignGroup.php lib/Model/WTEmployeeFileCreate.php lib/Model/WTEmployeeImportRecords.php lib/Model/WTEmployeeNotification.php +lib/Model/WTEmployeeNotificationType.php lib/Model/WTEmployeePeerRoles.php lib/Model/WTEmployeeS3FilePresign.php +lib/Model/WTEmployeeS3FilePresignContext.php lib/Model/WTEmployeeScheduleSMSCampaignBroadcast.php lib/Model/WTEmployeeScheduleSimpleSMS.php +lib/Model/WTEmployeeScheduleSimpleSMSListType.php lib/Model/WTEmployeeScheduleSimpleSMSToRecipient.php lib/Model/WTEmployeeSendHelpDeskResponse.php lib/Model/WTEmployeeUpdate.php @@ -747,12 +769,14 @@ lib/Model/WTImageGridCreateParams.php lib/Model/WTImageGridUpdateParams.php lib/Model/WTImportedList.php lib/Model/WTImportedListRecipientFromMembershipTierImport.php +lib/Model/WTImportedListRecipientFromMembershipTierImportTierID.php lib/Model/WTInfoGenesisLookupRequestErrors.php lib/Model/WTInfoGenesisRecordFilterParameters.php lib/Model/WTInfoGenesisRoutingIDs.php lib/Model/WTInfoGenesisUniquePostingIDs.php lib/Model/WTLinkBook.php lib/Model/WTLinkBookCreateParams.php +lib/Model/WTLinkBookLinkBookSectionID.php lib/Model/WTLinkBookSectionCreateParams.php lib/Model/WTLinkBookSectionUpdateParams.php lib/Model/WTLinkBookUpdateParams.php @@ -763,6 +787,7 @@ lib/Model/WTMember.php lib/Model/WTMemberCreationParams.php lib/Model/WTMembershipTier.php lib/Model/WTMembershipTierCreationParams.php +lib/Model/WTMembershipTierId.php lib/Model/WTMembershipTierUpdateParams.php lib/Model/WTMembershipTierWithMemberCount.php lib/Model/WTMerchantCredit.php @@ -803,6 +828,9 @@ lib/Model/WTSMSUpdatePhoneNumberConfig.php lib/Model/WTServiceCreateParams.php lib/Model/WTServiceUpdateParams.php lib/Model/WTSettingsSetPassword.php +lib/Model/WTSmsSubscriberCreateParams.php +lib/Model/WTSmsSubscriberCreateParamsWalletUI.php +lib/Model/WTSmsSubscriberUpdateParams.php lib/Model/WTStaticVoucher.php lib/Model/WTStaticVoucherCampaign.php lib/Model/WTStaticVoucherCampaignPreviewMessages.php @@ -812,6 +840,8 @@ lib/Model/WTStaticVoucherUpdateParams.php lib/Model/WTSystemApprovePhoneNumber.php lib/Model/WTSystemRoleCreate.php lib/Model/WTTCPAOpt.php +lib/Model/WTTCPAOptListID.php +lib/Model/WTTCPAOptSourceID.php lib/Model/WTTicket.php lib/Model/WTTicketCreateParams.php lib/Model/WTTicketUpdateParams.php @@ -827,8 +857,75 @@ lib/Model/WTWalletObjectPrefixCounts.php lib/Model/WTWalletPageView.php lib/Model/WTWalletPageViewCount.php lib/Model/WTWalletPageViewGeoPoint.php +lib/Model/WTWalletPageViewId.php lib/Model/WalletConfiguration.php +lib/Model/WalletConfigurationSmsOptInSourceID.php lib/Model/WalletPageView.php lib/Model/Webpage.php lib/ObjectSerializer.php phpunit.xml.dist +test/Api/SmsSubscriberApiTest.php +test/Model/ClaimTicketRequestTest.php +test/Model/CountClaimedComps200ResponseTest.php +test/Model/CreateFile200ResponseTest.php +test/Model/DynamicVoucherBroadcastListTypeTest.php +test/Model/DynamicVoucherTemporalDecreaseFrequencyTypeTest.php +test/Model/EmployeeScheduleStartDayTest.php +test/Model/EmployeeScheduleStartHourTest.php +test/Model/EmployeeScheduleStartMeridiemTest.php +test/Model/EmployeeScheduleStartMinuteTest.php +test/Model/FetchAllCountries200ResponseInnerTest.php +test/Model/FetchAllLedgerTransactions200ResponseTest.php +test/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerTest.php +test/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueTypeTest.php +test/Model/FetchCustomerTicketsWithTokenRequestTest.php +test/Model/FetchDomainsByIndustry200ResponseTest.php +test/Model/FetchImportedListRecipientsByPage200ResponseTest.php +test/Model/FetchInboundSMSByPage200ResponseTest.php +test/Model/FetchIndustry200ResponseTest.php +test/Model/FetchMembersCount200ResponseTest.php +test/Model/FetchOptInListSubscribersByPage200ResponseTest.php +test/Model/FetchOutboundSMSByPage200ResponseTest.php +test/Model/FetchPerformanceTicketsPage200ResponseTest.php +test/Model/FetchStaticVouchersPage200ResponseTest.php +test/Model/ImportTicketsRequestTest.php +test/Model/LedgerEntryParentObjectIDTest.php +test/Model/LedgerEntryTransactionTypeTest.php +test/Model/LoginStatus200ResponseAnyOfTest.php +test/Model/LoginStatus200ResponseTest.php +test/Model/MSMemberRedemptionTransactionTypeTest.php +test/Model/MemberSearchSearchKeyTest.php +test/Model/MemberSearchSortKeyTest.php +test/Model/PaginationRequestWithSortOptionsSortOrderTest.php +test/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceIDTest.php +test/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastIDTest.php +test/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatusTest.php +test/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueTypeTest.php +test/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleTypeTest.php +test/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterIDTest.php +test/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionTypeTest.php +test/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthdayTest.php +test/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatusTest.php +test/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefixTest.php +test/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsIdTest.php +test/Model/SaveMerchantCreditPaymentDesignRequestTest.php +test/Model/SaveTicketSettingsRequestPaymentDesignIDTest.php +test/Model/SaveTicketSettingsRequestTest.php +test/Model/SmsSubscriberTest.php +test/Model/UpdateEmailNotificationPreferenceRequestTest.php +test/Model/UpdateStaticVoucherCampaignWithVoucherVoucherIDTest.php +test/Model/WTDynamicVoucherRedemptionTransactionTypeTest.php +test/Model/WTDynamicVoucherSummaryStatusTest.php +test/Model/WTEmployeeNotificationTypeTest.php +test/Model/WTEmployeeS3FilePresignContextTest.php +test/Model/WTEmployeeScheduleSimpleSMSListTypeTest.php +test/Model/WTImportedListRecipientFromMembershipTierImportTierIDTest.php +test/Model/WTLinkBookLinkBookSectionIDTest.php +test/Model/WTMembershipTierIdTest.php +test/Model/WTSmsSubscriberCreateParamsTest.php +test/Model/WTSmsSubscriberCreateParamsWalletUITest.php +test/Model/WTSmsSubscriberUpdateParamsTest.php +test/Model/WTTCPAOptListIDTest.php +test/Model/WTTCPAOptSourceIDTest.php +test/Model/WTWalletPageViewIdTest.php +test/Model/WalletConfigurationSmsOptInSourceIDTest.php diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 1e20ec3..8b23b8d 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -5.4.0 \ No newline at end of file +7.3.0 \ No newline at end of file diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..af9cf39 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,29 @@ +in(__DIR__) + ->exclude('vendor') + ->exclude('test') + ->exclude('tests') +; + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@PSR12' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + 'no_leading_import_slash' => false, + ]) + ->setFinder($finder) +; diff --git a/.travis.yml b/.travis.yml index 714772e..667b815 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: php # https://docs.travis-ci.com/user/reference/bionic/#php-support dist: bionic php: - - 7.3 - 7.4 before_install: "composer install" script: "vendor/bin/phpunit" diff --git a/README.md b/README.md index eaf7639..860be50 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ API ### Requirements -PHP 7.3 and later. -Should also work with PHP 8.0 but has not been tested. +PHP 7.4 and later. +Should also work with PHP 8.0. ### Composer @@ -358,8 +358,9 @@ Class | Method | HTTP request | Description *InteractionsApi* | [**fetchWalletPaymentObjectsWithToken**](docs/Api/InteractionsApi.md#fetchwalletpaymentobjectswithtoken) | **POST** /wallet/paymentObject/token | Fetch payment objects with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. *InteractionsApi* | [**findByVanityHandle**](docs/Api/InteractionsApi.md#findbyvanityhandle) | **GET** /wallet/vanityHandle/{handle} | Fetch vanity handle *InteractionsApi* | [**identifyItem**](docs/Api/InteractionsApi.md#identifyitem) | **GET** /wallet/item/identify/{itemID} | Identify item -*InteractionsApi* | [**requestMerchantURLRedirect**](docs/Api/InteractionsApi.md#requestmerchanturlredirect) | **POST** /wallet/merchantURL/{itemID} | Identify item +*InteractionsApi* | [**requestMerchantURLRedirect**](docs/Api/InteractionsApi.md#requestmerchanturlredirect) | **POST** /wallet/merchantURL/{itemID} | Request Merchant URL *InteractionsApi* | [**subscribeEmail**](docs/Api/InteractionsApi.md#subscribeemail) | **POST** /wallet/subscribeEmail | Create email subscriber +*InteractionsApi* | [**subscribeSms**](docs/Api/InteractionsApi.md#subscribesms) | **POST** /wallet/subscribeSms | Create sms subscriber *LoginAndLogoutApi* | [**login**](docs/Api/LoginAndLogoutApi.md#login) | **POST** /authentication/login | Login *LoginAndLogoutApi* | [**loginStatus**](docs/Api/LoginAndLogoutApi.md#loginstatus) | **GET** /authentication/status/{token} | Retrieve status of session token *LoginAndLogoutApi* | [**logout**](docs/Api/LoginAndLogoutApi.md#logout) | **DELETE** /authentication/logout | Logout @@ -527,6 +528,11 @@ Class | Method | HTTP request | Description *ShopifyTerminalApi* | [**fetchWalletItemFromShopifyTerminal**](docs/Api/ShopifyTerminalApi.md#fetchwalletitemfromshopifyterminal) | **GET** /v2/pos/shopify/item/{itemID} | Fetch item *ShopifyTerminalApi* | [**redeemWalletItemFromShopifyTerminal**](docs/Api/ShopifyTerminalApi.md#redeemwalletitemfromshopifyterminal) | **POST** /v2/pos/shopify/item/redeem/{itemID} | Redeem item *ShopifyTerminalApi* | [**refundWalletItemFromShopifyTerminal**](docs/Api/ShopifyTerminalApi.md#refundwalletitemfromshopifyterminal) | **POST** /v2/pos/shopify/item/refund/{ledgerEntryID} | Refund transaction +*SmsSubscriberApi* | [**archiveSmsSubscriber**](docs/Api/SmsSubscriberApi.md#archivesmssubscriber) | **DELETE** /v2/SmsSubscriber/{id} | Archive email subscriber +*SmsSubscriberApi* | [**createSmsSubscriber**](docs/Api/SmsSubscriberApi.md#createsmssubscriber) | **POST** /v2/SmsSubscriber | Create email subscriber +*SmsSubscriberApi* | [**fetchAllSmsSubscribers**](docs/Api/SmsSubscriberApi.md#fetchallsmssubscribers) | **GET** /v2/SmsSubscriber/all | Fetch all email subscribers +*SmsSubscriberApi* | [**restoreSmsSubscriber**](docs/Api/SmsSubscriberApi.md#restoresmssubscriber) | **PATCH** /v2/SmsSubscriber/{id} | Restore email subscriber +*SmsSubscriberApi* | [**updateSmsSubscriber**](docs/Api/SmsSubscriberApi.md#updatesmssubscriber) | **PUT** /v2/SmsSubscriber/{id} | Update email subscriber *StaticVoucherCampaignGroupsApi* | [**fetchStaticVoucherCampaignGroups**](docs/Api/StaticVoucherCampaignGroupsApi.md#fetchstaticvouchercampaigngroups) | **GET** /v2/payment/staticVoucherCampaignGroups/campaigns/{campaignsGroupID} | Fetch all campaigns *StaticVoucherCampaignsApi* | [**archiveStaticVoucherCampaign**](docs/Api/StaticVoucherCampaignsApi.md#archivestaticvouchercampaign) | **DELETE** /v2/payment/staticVoucherCampaign/{campaignID} | Archive static voucher campaign *StaticVoucherCampaignsApi* | [**countVouchersLoaded**](docs/Api/StaticVoucherCampaignsApi.md#countvouchersloaded) | **GET** /v2/payment/staticVoucherCampaign/count/vouchers/loaded/{campaignID} | Count loaded vouchers @@ -600,13 +606,6 @@ Class | Method | HTTP request | Description - [Amenity](docs/Model/Amenity.md) - [Announcement](docs/Model/Announcement.md) - [ApplicableTerminals](docs/Model/ApplicableTerminals.md) -- [ApplicableTerminalsAnyOf](docs/Model/ApplicableTerminalsAnyOf.md) -- [ApplicableTerminalsAnyOf1](docs/Model/ApplicableTerminalsAnyOf1.md) -- [ApplicableTerminalsAnyOf2](docs/Model/ApplicableTerminalsAnyOf2.md) -- [ApplicableTerminalsAnyOf3](docs/Model/ApplicableTerminalsAnyOf3.md) -- [ApplicableTerminalsAnyOf4](docs/Model/ApplicableTerminalsAnyOf4.md) -- [ApplicableTerminalsAnyOf5](docs/Model/ApplicableTerminalsAnyOf5.md) -- [ApplicableTerminalsAnyOf6](docs/Model/ApplicableTerminalsAnyOf6.md) - [AuthError](docs/Model/AuthError.md) - [AvailablePhoneNumbersRequest](docs/Model/AvailablePhoneNumbersRequest.md) - [BrowserDetails](docs/Model/BrowserDetails.md) @@ -616,6 +615,7 @@ Class | Method | HTTP request | Description - [BusinessRegistrationIdentifier](docs/Model/BusinessRegistrationIdentifier.md) - [BusinessStockExchanges](docs/Model/BusinessStockExchanges.md) - [BusinessType](docs/Model/BusinessType.md) +- [ClaimTicketRequest](docs/Model/ClaimTicketRequest.md) - [ClickFunnelAmount](docs/Model/ClickFunnelAmount.md) - [ClickFunnelContact](docs/Model/ClickFunnelContact.md) - [ClickFunnelContactProfile](docs/Model/ClickFunnelContactProfile.md) @@ -624,6 +624,8 @@ Class | Method | HTTP request | Description - [ClickFunnelProduct](docs/Model/ClickFunnelProduct.md) - [ClickFunnelPurchase](docs/Model/ClickFunnelPurchase.md) - [ClickFunnelRegistration](docs/Model/ClickFunnelRegistration.md) +- [CountClaimedComps200Response](docs/Model/CountClaimedComps200Response.md) +- [CreateFile200Response](docs/Model/CreateFile200Response.md) - [CreateStaticVoucherCampaign](docs/Model/CreateStaticVoucherCampaign.md) - [CreateStaticVoucherCampaignWithVoucherWithCSV](docs/Model/CreateStaticVoucherCampaignWithVoucherWithCSV.md) - [DashboardWidget](docs/Model/DashboardWidget.md) @@ -632,48 +634,54 @@ Class | Method | HTTP request | Description - [DuplicateRowFound](docs/Model/DuplicateRowFound.md) - [DynamicVoucher](docs/Model/DynamicVoucher.md) - [DynamicVoucherBroadcast](docs/Model/DynamicVoucherBroadcast.md) +- [DynamicVoucherBroadcastListType](docs/Model/DynamicVoucherBroadcastListType.md) +- [DynamicVoucherTemporalDecreaseFrequencyType](docs/Model/DynamicVoucherTemporalDecreaseFrequencyType.md) - [EmailSubscriber](docs/Model/EmailSubscriber.md) - [Employee](docs/Model/Employee.md) - [EmployeeAPIKey](docs/Model/EmployeeAPIKey.md) - [EmployeeActivityLog](docs/Model/EmployeeActivityLog.md) - [EmployeeAlert](docs/Model/EmployeeAlert.md) +- [EmployeeScheduleStartDay](docs/Model/EmployeeScheduleStartDay.md) +- [EmployeeScheduleStartHour](docs/Model/EmployeeScheduleStartHour.md) +- [EmployeeScheduleStartMeridiem](docs/Model/EmployeeScheduleStartMeridiem.md) +- [EmployeeScheduleStartMinute](docs/Model/EmployeeScheduleStartMinute.md) - [EntityTooLarge](docs/Model/EntityTooLarge.md) - [ExportDataFile](docs/Model/ExportDataFile.md) - [FalsumError](docs/Model/FalsumError.md) - [FalsumField](docs/Model/FalsumField.md) - [Feature](docs/Model/Feature.md) +- [FetchAllCountries200ResponseInner](docs/Model/FetchAllCountries200ResponseInner.md) +- [FetchAllLedgerTransactions200Response](docs/Model/FetchAllLedgerTransactions200Response.md) +- [FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner](docs/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner.md) +- [FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType](docs/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType.md) +- [FetchCustomerTicketsWithTokenRequest](docs/Model/FetchCustomerTicketsWithTokenRequest.md) +- [FetchDomainsByIndustry200Response](docs/Model/FetchDomainsByIndustry200Response.md) +- [FetchImportedListRecipientsByPage200Response](docs/Model/FetchImportedListRecipientsByPage200Response.md) +- [FetchInboundSMSByPage200Response](docs/Model/FetchInboundSMSByPage200Response.md) +- [FetchIndustry200Response](docs/Model/FetchIndustry200Response.md) +- [FetchMembersCount200Response](docs/Model/FetchMembersCount200Response.md) +- [FetchOptInListSubscribersByPage200Response](docs/Model/FetchOptInListSubscribersByPage200Response.md) +- [FetchOutboundSMSByPage200Response](docs/Model/FetchOutboundSMSByPage200Response.md) +- [FetchPerformanceTicketsPage200Response](docs/Model/FetchPerformanceTicketsPage200Response.md) +- [FetchStaticVouchersPage200Response](docs/Model/FetchStaticVouchersPage200Response.md) - [ForbiddenRequest](docs/Model/ForbiddenRequest.md) - [ForeignKeyDoesNotExist](docs/Model/ForeignKeyDoesNotExist.md) - [Gaming](docs/Model/Gaming.md) - [HelpDeskRequest](docs/Model/HelpDeskRequest.md) - [ImageGrid](docs/Model/ImageGrid.md) +- [ImportTicketsRequest](docs/Model/ImportTicketsRequest.md) - [ImportedList](docs/Model/ImportedList.md) - [ImportedListRecipient](docs/Model/ImportedListRecipient.md) - [InboundSMS](docs/Model/InboundSMS.md) -- [InlineObject](docs/Model/InlineObject.md) -- [InlineObject1](docs/Model/InlineObject1.md) -- [InlineObject2](docs/Model/InlineObject2.md) -- [InlineObject3](docs/Model/InlineObject3.md) -- [InlineObject4](docs/Model/InlineObject4.md) -- [InlineObject5](docs/Model/InlineObject5.md) -- [InlineResponse200](docs/Model/InlineResponse200.md) -- [InlineResponse2001](docs/Model/InlineResponse2001.md) -- [InlineResponse20010](docs/Model/InlineResponse20010.md) -- [InlineResponse20011](docs/Model/InlineResponse20011.md) -- [InlineResponse20012](docs/Model/InlineResponse20012.md) -- [InlineResponse2002](docs/Model/InlineResponse2002.md) -- [InlineResponse2003](docs/Model/InlineResponse2003.md) -- [InlineResponse2004](docs/Model/InlineResponse2004.md) -- [InlineResponse2005](docs/Model/InlineResponse2005.md) -- [InlineResponse2006](docs/Model/InlineResponse2006.md) -- [InlineResponse2007](docs/Model/InlineResponse2007.md) -- [InlineResponse2008](docs/Model/InlineResponse2008.md) -- [InlineResponse2009](docs/Model/InlineResponse2009.md) - [InternalServerError](docs/Model/InternalServerError.md) - [JobPosition](docs/Model/JobPosition.md) - [LedgerEntry](docs/Model/LedgerEntry.md) +- [LedgerEntryParentObjectID](docs/Model/LedgerEntryParentObjectID.md) +- [LedgerEntryTransactionType](docs/Model/LedgerEntryTransactionType.md) - [LinkBook](docs/Model/LinkBook.md) - [LinkBookSection](docs/Model/LinkBookSection.md) +- [LoginStatus200Response](docs/Model/LoginStatus200Response.md) +- [LoginStatus200ResponseAnyOf](docs/Model/LoginStatus200ResponseAnyOf.md) - [Lounge](docs/Model/Lounge.md) - [MSAnalyticsMemberCountPartitionedByDate](docs/Model/MSAnalyticsMemberCountPartitionedByDate.md) - [MSAnalyticsMemberPointsRedeemedPartitionedByDate](docs/Model/MSAnalyticsMemberPointsRedeemedPartitionedByDate.md) @@ -684,6 +692,7 @@ Class | Method | HTTP request | Description - [MSMemberHistoryPagination](docs/Model/MSMemberHistoryPagination.md) - [MSMemberRedemption](docs/Model/MSMemberRedemption.md) - [MSMemberRedemptionPagination](docs/Model/MSMemberRedemptionPagination.md) +- [MSMemberRedemptionTransactionType](docs/Model/MSMemberRedemptionTransactionType.md) - [MSMembershipTierHistory](docs/Model/MSMembershipTierHistory.md) - [MSMembershipTierHistoryPagination](docs/Model/MSMembershipTierHistoryPagination.md) - [MSMembershipTierRedemption](docs/Model/MSMembershipTierRedemption.md) @@ -695,25 +704,15 @@ Class | Method | HTTP request | Description - [MediaFile](docs/Model/MediaFile.md) - [Member](docs/Model/Member.md) - [MemberSearch](docs/Model/MemberSearch.md) +- [MemberSearchSearchKey](docs/Model/MemberSearchSearchKey.md) +- [MemberSearchSortKey](docs/Model/MemberSearchSortKey.md) - [Merchant](docs/Model/Merchant.md) - [MerchantCreditSearch](docs/Model/MerchantCreditSearch.md) - [MerchantNotInitialized](docs/Model/MerchantNotInitialized.md) - [MerchantURL](docs/Model/MerchantURL.md) - [Message](docs/Model/Message.md) - [MessageDirection](docs/Model/MessageDirection.md) -- [MessageDirectionAnyOf](docs/Model/MessageDirectionAnyOf.md) -- [MessageDirectionAnyOf1](docs/Model/MessageDirectionAnyOf1.md) -- [MessageDirectionAnyOf2](docs/Model/MessageDirectionAnyOf2.md) -- [MessageDirectionAnyOf3](docs/Model/MessageDirectionAnyOf3.md) - [MessageStatus](docs/Model/MessageStatus.md) -- [MessageStatusAnyOf](docs/Model/MessageStatusAnyOf.md) -- [MessageStatusAnyOf1](docs/Model/MessageStatusAnyOf1.md) -- [MessageStatusAnyOf2](docs/Model/MessageStatusAnyOf2.md) -- [MessageStatusAnyOf3](docs/Model/MessageStatusAnyOf3.md) -- [MessageStatusAnyOf4](docs/Model/MessageStatusAnyOf4.md) -- [MessageStatusAnyOf5](docs/Model/MessageStatusAnyOf5.md) -- [MessageStatusAnyOf6](docs/Model/MessageStatusAnyOf6.md) -- [MessageStatusAnyOf7](docs/Model/MessageStatusAnyOf7.md) - [ModuleError](docs/Model/ModuleError.md) - [NewsArticle](docs/Model/NewsArticle.md) - [OptInList](docs/Model/OptInList.md) @@ -724,6 +723,7 @@ Class | Method | HTTP request | Description - [PaginatedWTMerchantCredits](docs/Model/PaginatedWTMerchantCredits.md) - [PaginationRequestWithIDAndWithoutSortOptions](docs/Model/PaginationRequestWithIDAndWithoutSortOptions.md) - [PaginationRequestWithSortOptions](docs/Model/PaginationRequestWithSortOptions.md) +- [PaginationRequestWithSortOptionsSortOrder](docs/Model/PaginationRequestWithSortOptionsSortOrder.md) - [PaymentDesign](docs/Model/PaymentDesign.md) - [Performance](docs/Model/Performance.md) - [PhoneNumber](docs/Model/PhoneNumber.md) @@ -743,24 +743,34 @@ Class | Method | HTTP request | Description - [PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId](docs/Model/PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId.md) - [PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs](docs/Model/PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs.md) - [PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount](docs/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount.md) +- [PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID](docs/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID.md) - [PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId](docs/Model/PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId.md) - [PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId](docs/Model/PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId.md) - [PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone](docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.md) +- [PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID](docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID.md) +- [PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus](docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus.md) - [PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID](docs/Model/PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID.md) - [PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt](docs/Model/PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.md) - [PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId](docs/Model/PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.md) - [PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate](docs/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.md) +- [PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType](docs/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) - [PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType](docs/Model/PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType.md) - [PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID](docs/Model/PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID.md) - [PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId](docs/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.md) +- [PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType](docs/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.md) - [PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt](docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.md) +- [PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID](docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md) +- [PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType](docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.md) - [PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId](docs/Model/PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId.md) - [PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail](docs/Model/PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.md) -- [PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber](docs/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber.md) +- [PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday](docs/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday.md) - [PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber](docs/Model/PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.md) - [PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID](docs/Model/PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID.md) - [PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId](docs/Model/PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId.md) - [PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID](docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.md) +- [PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus](docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.md) +- [PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix](docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.md) +- [PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId](docs/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId.md) - [PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime](docs/Model/PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.md) - [PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID](docs/Model/PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID.md) - [Plan](docs/Model/Plan.md) @@ -780,31 +790,27 @@ Class | Method | HTTP request | Description - [SSImportedListRecipientCreateParams](docs/Model/SSImportedListRecipientCreateParams.md) - [SSOptInSource](docs/Model/SSOptInSource.md) - [SSOutboundStatuses](docs/Model/SSOutboundStatuses.md) -- [SSOutboundStatusesAnyOf](docs/Model/SSOutboundStatusesAnyOf.md) -- [SSOutboundStatusesAnyOf1](docs/Model/SSOutboundStatusesAnyOf1.md) -- [SSOutboundStatusesAnyOf2](docs/Model/SSOutboundStatusesAnyOf2.md) -- [SSOutboundStatusesAnyOf3](docs/Model/SSOutboundStatusesAnyOf3.md) -- [SSOutboundStatusesAnyOf4](docs/Model/SSOutboundStatusesAnyOf4.md) -- [SSOutboundStatusesAnyOf5](docs/Model/SSOutboundStatusesAnyOf5.md) +- [SaveMerchantCreditPaymentDesignRequest](docs/Model/SaveMerchantCreditPaymentDesignRequest.md) +- [SaveTicketSettingsRequest](docs/Model/SaveTicketSettingsRequest.md) +- [SaveTicketSettingsRequestPaymentDesignID](docs/Model/SaveTicketSettingsRequestPaymentDesignID.md) - [Service](docs/Model/Service.md) - [SimpleSMSBroadcast](docs/Model/SimpleSMSBroadcast.md) +- [SmsSubscriber](docs/Model/SmsSubscriber.md) - [StaticVoucher](docs/Model/StaticVoucher.md) - [StaticVoucherCampaign](docs/Model/StaticVoucherCampaign.md) - [StaticVoucherCampaignBroadcast](docs/Model/StaticVoucherCampaignBroadcast.md) - [StaticVoucherCampaignGroup](docs/Model/StaticVoucherCampaignGroup.md) - [StaticVoucherCampaignUpdate](docs/Model/StaticVoucherCampaignUpdate.md) - [Status](docs/Model/Status.md) -- [StatusAnyOf](docs/Model/StatusAnyOf.md) -- [StatusAnyOf1](docs/Model/StatusAnyOf1.md) -- [StatusAnyOf2](docs/Model/StatusAnyOf2.md) -- [StatusAnyOf3](docs/Model/StatusAnyOf3.md) - [SubscriptionFeature](docs/Model/SubscriptionFeature.md) - [SubscriptionPlan](docs/Model/SubscriptionPlan.md) - [SubscriptionProduct](docs/Model/SubscriptionProduct.md) - [Tcpa](docs/Model/Tcpa.md) - [Ticket](docs/Model/Ticket.md) - [TrustBundleStatuses](docs/Model/TrustBundleStatuses.md) +- [UpdateEmailNotificationPreferenceRequest](docs/Model/UpdateEmailNotificationPreferenceRequest.md) - [UpdateStaticVoucherCampaignWithVoucher](docs/Model/UpdateStaticVoucherCampaignWithVoucher.md) +- [UpdateStaticVoucherCampaignWithVoucherVoucherID](docs/Model/UpdateStaticVoucherCampaignWithVoucherVoucherID.md) - [VSCampaignGeneratedMessage](docs/Model/VSCampaignGeneratedMessage.md) - [VSCampaignGeneratedMessagePagination](docs/Model/VSCampaignGeneratedMessagePagination.md) - [VSDynamicVoucherStatus](docs/Model/VSDynamicVoucherStatus.md) @@ -836,7 +842,9 @@ Class | Method | HTTP request | Description - [WTDynamicVoucher](docs/Model/WTDynamicVoucher.md) - [WTDynamicVoucherCreateParams](docs/Model/WTDynamicVoucherCreateParams.md) - [WTDynamicVoucherRedemption](docs/Model/WTDynamicVoucherRedemption.md) +- [WTDynamicVoucherRedemptionTransactionType](docs/Model/WTDynamicVoucherRedemptionTransactionType.md) - [WTDynamicVoucherSummary](docs/Model/WTDynamicVoucherSummary.md) +- [WTDynamicVoucherSummaryStatus](docs/Model/WTDynamicVoucherSummaryStatus.md) - [WTDynamicVoucherUpdateParams](docs/Model/WTDynamicVoucherUpdateParams.md) - [WTEmailSubscriberCreateParams](docs/Model/WTEmailSubscriberCreateParams.md) - [WTEmailSubscriberCreateParamsWalletUI](docs/Model/WTEmailSubscriberCreateParamsWalletUI.md) @@ -852,10 +860,13 @@ Class | Method | HTTP request | Description - [WTEmployeeFileCreate](docs/Model/WTEmployeeFileCreate.md) - [WTEmployeeImportRecords](docs/Model/WTEmployeeImportRecords.md) - [WTEmployeeNotification](docs/Model/WTEmployeeNotification.md) +- [WTEmployeeNotificationType](docs/Model/WTEmployeeNotificationType.md) - [WTEmployeePeerRoles](docs/Model/WTEmployeePeerRoles.md) - [WTEmployeeS3FilePresign](docs/Model/WTEmployeeS3FilePresign.md) +- [WTEmployeeS3FilePresignContext](docs/Model/WTEmployeeS3FilePresignContext.md) - [WTEmployeeScheduleSMSCampaignBroadcast](docs/Model/WTEmployeeScheduleSMSCampaignBroadcast.md) - [WTEmployeeScheduleSimpleSMS](docs/Model/WTEmployeeScheduleSimpleSMS.md) +- [WTEmployeeScheduleSimpleSMSListType](docs/Model/WTEmployeeScheduleSimpleSMSListType.md) - [WTEmployeeScheduleSimpleSMSToRecipient](docs/Model/WTEmployeeScheduleSimpleSMSToRecipient.md) - [WTEmployeeSendHelpDeskResponse](docs/Model/WTEmployeeSendHelpDeskResponse.md) - [WTEmployeeUpdate](docs/Model/WTEmployeeUpdate.md) @@ -867,12 +878,14 @@ Class | Method | HTTP request | Description - [WTImageGridUpdateParams](docs/Model/WTImageGridUpdateParams.md) - [WTImportedList](docs/Model/WTImportedList.md) - [WTImportedListRecipientFromMembershipTierImport](docs/Model/WTImportedListRecipientFromMembershipTierImport.md) +- [WTImportedListRecipientFromMembershipTierImportTierID](docs/Model/WTImportedListRecipientFromMembershipTierImportTierID.md) - [WTInfoGenesisLookupRequestErrors](docs/Model/WTInfoGenesisLookupRequestErrors.md) - [WTInfoGenesisRecordFilterParameters](docs/Model/WTInfoGenesisRecordFilterParameters.md) - [WTInfoGenesisRoutingIDs](docs/Model/WTInfoGenesisRoutingIDs.md) - [WTInfoGenesisUniquePostingIDs](docs/Model/WTInfoGenesisUniquePostingIDs.md) - [WTLinkBook](docs/Model/WTLinkBook.md) - [WTLinkBookCreateParams](docs/Model/WTLinkBookCreateParams.md) +- [WTLinkBookLinkBookSectionID](docs/Model/WTLinkBookLinkBookSectionID.md) - [WTLinkBookSectionCreateParams](docs/Model/WTLinkBookSectionCreateParams.md) - [WTLinkBookSectionUpdateParams](docs/Model/WTLinkBookSectionUpdateParams.md) - [WTLinkBookUpdateParams](docs/Model/WTLinkBookUpdateParams.md) @@ -883,6 +896,7 @@ Class | Method | HTTP request | Description - [WTMemberCreationParams](docs/Model/WTMemberCreationParams.md) - [WTMembershipTier](docs/Model/WTMembershipTier.md) - [WTMembershipTierCreationParams](docs/Model/WTMembershipTierCreationParams.md) +- [WTMembershipTierId](docs/Model/WTMembershipTierId.md) - [WTMembershipTierUpdateParams](docs/Model/WTMembershipTierUpdateParams.md) - [WTMembershipTierWithMemberCount](docs/Model/WTMembershipTierWithMemberCount.md) - [WTMerchantCredit](docs/Model/WTMerchantCredit.md) @@ -923,6 +937,9 @@ Class | Method | HTTP request | Description - [WTServiceCreateParams](docs/Model/WTServiceCreateParams.md) - [WTServiceUpdateParams](docs/Model/WTServiceUpdateParams.md) - [WTSettingsSetPassword](docs/Model/WTSettingsSetPassword.md) +- [WTSmsSubscriberCreateParams](docs/Model/WTSmsSubscriberCreateParams.md) +- [WTSmsSubscriberCreateParamsWalletUI](docs/Model/WTSmsSubscriberCreateParamsWalletUI.md) +- [WTSmsSubscriberUpdateParams](docs/Model/WTSmsSubscriberUpdateParams.md) - [WTStaticVoucher](docs/Model/WTStaticVoucher.md) - [WTStaticVoucherCampaign](docs/Model/WTStaticVoucherCampaign.md) - [WTStaticVoucherCampaignPreviewMessages](docs/Model/WTStaticVoucherCampaignPreviewMessages.md) @@ -932,6 +949,8 @@ Class | Method | HTTP request | Description - [WTSystemApprovePhoneNumber](docs/Model/WTSystemApprovePhoneNumber.md) - [WTSystemRoleCreate](docs/Model/WTSystemRoleCreate.md) - [WTTCPAOpt](docs/Model/WTTCPAOpt.md) +- [WTTCPAOptListID](docs/Model/WTTCPAOptListID.md) +- [WTTCPAOptSourceID](docs/Model/WTTCPAOptSourceID.md) - [WTTicket](docs/Model/WTTicket.md) - [WTTicketCreateParams](docs/Model/WTTicketCreateParams.md) - [WTTicketUpdateParams](docs/Model/WTTicketUpdateParams.md) @@ -947,12 +966,15 @@ Class | Method | HTTP request | Description - [WTWalletPageView](docs/Model/WTWalletPageView.md) - [WTWalletPageViewCount](docs/Model/WTWalletPageViewCount.md) - [WTWalletPageViewGeoPoint](docs/Model/WTWalletPageViewGeoPoint.md) +- [WTWalletPageViewId](docs/Model/WTWalletPageViewId.md) - [WalletConfiguration](docs/Model/WalletConfiguration.md) +- [WalletConfigurationSmsOptInSourceID](docs/Model/WalletConfigurationSmsOptInSourceID.md) - [WalletPageView](docs/Model/WalletPageView.md) - [Webpage](docs/Model/Webpage.md) ## Authorization +Authentication schemes defined for the API: ### api_key - **Type**: API key @@ -977,5 +999,5 @@ development@wallet.inc This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: `2.1.535` +- API version: `2.1.600` - Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/composer.json b/composer.json index e5f072d..02eac00 100644 --- a/composer.json +++ b/composer.json @@ -1 +1 @@ -{"description": "OpenAPI compliant library to access resources on the Wallet Platform", "keywords": ["openapitools", "php", "sdk", "wallet-sdk", "wallet-api"], "homepage": "https://github.com/WalletInc/sdk-php", "license": "unlicense", "authors": [{"name": "John Turnham", "email": "john.turnham@wallet.inc", "role": "CTO"}, {"name": "Pratheek Adidela", "email": "pratheek.adidela@wallet.inc", "role": "Developer"}], "require": {"php": "^7.3 || ^8.0", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^7.3", "guzzlehttp/psr7": "^1.7 || ^2.0"}, "require-dev": {"phpunit/phpunit": "^8.0 || ^9.0", "friendsofphp/php-cs-fixer": "^2.12"}, "autoload": {"psr-4": {"OpenAPI\\Client\\": "lib/"}}, "autoload-dev": {"psr-4": {"OpenAPI\\Client\\Test\\": "test/"}}, "name": "wallet/wallet", "type": "wallet-api-plugin", "prefer-stable": true, "minimum-stability": "dev", "config": {"platform": {"php": "7.4.24"}}, "version": "2.1.600"} \ No newline at end of file +{"description": "OpenAPI compliant library to access resources on the Wallet Platform", "keywords": ["openapitools", "php", "sdk", "wallet-sdk", "wallet-api"], "homepage": "https://github.com/WalletInc/sdk-php", "license": "unlicense", "authors": [{"name": "John Turnham", "email": "john.turnham@wallet.inc", "role": "CTO"}, {"name": "Pratheek Adidela", "email": "pratheek.adidela@wallet.inc", "role": "Developer"}], "require": {"php": "^7.4 || ^8.0", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^7.3", "guzzlehttp/psr7": "^1.7 || ^2.0"}, "require-dev": {"phpunit/phpunit": "^8.0 || ^9.0", "friendsofphp/php-cs-fixer": "^3.5"}, "autoload": {"psr-4": {"OpenAPI\\Client\\": "lib/"}}, "autoload-dev": {"psr-4": {"OpenAPI\\Client\\Test\\": "test/"}}, "name": "wallet/wallet", "type": "wallet-api-plugin", "prefer-stable": true, "minimum-stability": "dev", "config": {"platform": {"php": "7.4.24"}}, "version": "2.1.600"} \ No newline at end of file diff --git a/docs/Api/A2PApi.md b/docs/Api/A2PApi.md index 96e5847..a9956ca 100644 --- a/docs/Api/A2PApi.md +++ b/docs/Api/A2PApi.md @@ -1,13 +1,13 @@ # OpenAPI\Client\A2PApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**beginA2PApplication()**](A2PApi.md#beginA2PApplication) | **POST** /v2/a2p/application | Create A2P Application -[**fetchA2PApplication()**](A2PApi.md#fetchA2PApplication) | **GET** /v2/a2p/application | Fetch A2P Application -[**fetchA2PRegistration()**](A2PApi.md#fetchA2PRegistration) | **GET** /v2/a2p/registration | Fetch A2P Registration -[**updateA2PApplication()**](A2PApi.md#updateA2PApplication) | **PUT** /v2/a2p/application/{applicationID} | Update A2P Application +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**beginA2PApplication()**](A2PApi.md#beginA2PApplication) | **POST** /v2/a2p/application | Create A2P Application | +| [**fetchA2PApplication()**](A2PApi.md#fetchA2PApplication) | **GET** /v2/a2p/application | Fetch A2P Application | +| [**fetchA2PRegistration()**](A2PApi.md#fetchA2PRegistration) | **GET** /v2/a2p/registration | Fetch A2P Registration | +| [**updateA2PApplication()**](A2PApi.md#updateA2PApplication) | **PUT** /v2/a2p/application/{applicationID} | Update A2P Application | ## `beginA2PApplication()` @@ -43,9 +43,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **a2_p_application_submission** | [**\OpenAPI\Client\Model\A2PApplicationSubmission**](../Model/A2PApplicationSubmission.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **a2_p_application_submission** | [**\OpenAPI\Client\Model\A2PApplicationSubmission**](../Model/A2PApplicationSubmission.md)| | | ### Return type @@ -200,10 +200,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **application_id** | **string**| | - **wta2_p_application_update_params** | [**\OpenAPI\Client\Model\WTA2PApplicationUpdateParams**](../Model/WTA2PApplicationUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **application_id** | **string**| | | +| **wta2_p_application_update_params** | [**\OpenAPI\Client\Model\WTA2PApplicationUpdateParams**](../Model/WTA2PApplicationUpdateParams.md)| | | ### Return type diff --git a/docs/Api/AdvertisementCreditsApi.md b/docs/Api/AdvertisementCreditsApi.md index 24155c1..2787efe 100644 --- a/docs/Api/AdvertisementCreditsApi.md +++ b/docs/Api/AdvertisementCreditsApi.md @@ -1,16 +1,16 @@ # OpenAPI\Client\AdvertisementCreditsApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveAdvertisementCredit()**](AdvertisementCreditsApi.md#archiveAdvertisementCredit) | **DELETE** /v2/payment/advertisementCredit/{id} | Archive ad credit -[**createAdvertisementCredit()**](AdvertisementCreditsApi.md#createAdvertisementCredit) | **POST** /v2/payment/advertisementCredit | Create ad credit -[**fetchAdvertisementCreditById()**](AdvertisementCreditsApi.md#fetchAdvertisementCreditById) | **GET** /v2/payment/advertisementCredit/{id} | Fetch ad credit -[**fetchAdvertisementCreditScans()**](AdvertisementCreditsApi.md#fetchAdvertisementCreditScans) | **GET** /v2/payment/advertisementCredit/scans/{id} | Fetch scans -[**fetchAllAdvertisementCredits()**](AdvertisementCreditsApi.md#fetchAllAdvertisementCredits) | **GET** /v2/payment/advertisementCredit/all | Fetch all active ad credits -[**restoreAdvertisementCredit()**](AdvertisementCreditsApi.md#restoreAdvertisementCredit) | **PATCH** /v2/payment/advertisementCredit/{id} | Restore ad credit -[**updateAdvertisementCredit()**](AdvertisementCreditsApi.md#updateAdvertisementCredit) | **PUT** /v2/payment/advertisementCredit/{id} | Update ad credit +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveAdvertisementCredit()**](AdvertisementCreditsApi.md#archiveAdvertisementCredit) | **DELETE** /v2/payment/advertisementCredit/{id} | Archive ad credit | +| [**createAdvertisementCredit()**](AdvertisementCreditsApi.md#createAdvertisementCredit) | **POST** /v2/payment/advertisementCredit | Create ad credit | +| [**fetchAdvertisementCreditById()**](AdvertisementCreditsApi.md#fetchAdvertisementCreditById) | **GET** /v2/payment/advertisementCredit/{id} | Fetch ad credit | +| [**fetchAdvertisementCreditScans()**](AdvertisementCreditsApi.md#fetchAdvertisementCreditScans) | **GET** /v2/payment/advertisementCredit/scans/{id} | Fetch scans | +| [**fetchAllAdvertisementCredits()**](AdvertisementCreditsApi.md#fetchAllAdvertisementCredits) | **GET** /v2/payment/advertisementCredit/all | Fetch all active ad credits | +| [**restoreAdvertisementCredit()**](AdvertisementCreditsApi.md#restoreAdvertisementCredit) | **PATCH** /v2/payment/advertisementCredit/{id} | Restore ad credit | +| [**updateAdvertisementCredit()**](AdvertisementCreditsApi.md#updateAdvertisementCredit) | **PUT** /v2/payment/advertisementCredit/{id} | Update ad credit | ## `archiveAdvertisementCredit()` @@ -46,9 +46,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -100,9 +100,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_advertisement_credit_create_params** | [**\OpenAPI\Client\Model\WTAdvertisementCreditCreateParams**](../Model/WTAdvertisementCreditCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_advertisement_credit_create_params** | [**\OpenAPI\Client\Model\WTAdvertisementCreditCreateParams**](../Model/WTAdvertisementCreditCreateParams.md)| | | ### Return type @@ -154,9 +154,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -208,9 +208,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -262,9 +262,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -316,9 +316,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -371,10 +371,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_advertisement_credit_update_params** | [**\OpenAPI\Client\Model\WTAdvertisementCreditUpdateParams**](../Model/WTAdvertisementCreditUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_advertisement_credit_update_params** | [**\OpenAPI\Client\Model\WTAdvertisementCreditUpdateParams**](../Model/WTAdvertisementCreditUpdateParams.md)| | | ### Return type diff --git a/docs/Api/AmenitiesApi.md b/docs/Api/AmenitiesApi.md index a8776b7..54292a4 100644 --- a/docs/Api/AmenitiesApi.md +++ b/docs/Api/AmenitiesApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\AmenitiesApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveAmenity()**](AmenitiesApi.md#archiveAmenity) | **DELETE** /v2/amenities/{id} | Archive amenity -[**createAmenity()**](AmenitiesApi.md#createAmenity) | **POST** /v2/amenities | Create amenity -[**fetchAllAmenities()**](AmenitiesApi.md#fetchAllAmenities) | **GET** /v2/amenities/all | Fetch all amenities -[**restoreAmenity()**](AmenitiesApi.md#restoreAmenity) | **PATCH** /v2/amenities/{id} | Restore amenity -[**updateAmenity()**](AmenitiesApi.md#updateAmenity) | **PUT** /v2/amenities/{id} | Update amenity +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveAmenity()**](AmenitiesApi.md#archiveAmenity) | **DELETE** /v2/amenities/{id} | Archive amenity | +| [**createAmenity()**](AmenitiesApi.md#createAmenity) | **POST** /v2/amenities | Create amenity | +| [**fetchAllAmenities()**](AmenitiesApi.md#fetchAllAmenities) | **GET** /v2/amenities/all | Fetch all amenities | +| [**restoreAmenity()**](AmenitiesApi.md#restoreAmenity) | **PATCH** /v2/amenities/{id} | Restore amenity | +| [**updateAmenity()**](AmenitiesApi.md#updateAmenity) | **PUT** /v2/amenities/{id} | Update amenity | ## `archiveAmenity()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_amenity_create_params** | [**\OpenAPI\Client\Model\WTAmenityCreateParams**](../Model/WTAmenityCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_amenity_create_params** | [**\OpenAPI\Client\Model\WTAmenityCreateParams**](../Model/WTAmenityCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_amenity_update_params** | [**\OpenAPI\Client\Model\WTAmenityUpdateParams**](../Model/WTAmenityUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_amenity_update_params** | [**\OpenAPI\Client\Model\WTAmenityUpdateParams**](../Model/WTAmenityUpdateParams.md)| | | ### Return type diff --git a/docs/Api/AnalyticsApi.md b/docs/Api/AnalyticsApi.md index a0246bb..eb012b0 100644 --- a/docs/Api/AnalyticsApi.md +++ b/docs/Api/AnalyticsApi.md @@ -1,93 +1,93 @@ # OpenAPI\Client\AnalyticsApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**countAllSubscribers()**](AnalyticsApi.md#countAllSubscribers) | **GET** /v2/analytics/sms/all/subscribers/count | Count opt in list subscribers -[**countAuthenticatedSessions()**](AnalyticsApi.md#countAuthenticatedSessions) | **GET** /v2/analytics/walletPageViews/sessions/count/distinct/authenticated | Count authenticated sessions -[**countDistinctRedemptions()**](AnalyticsApi.md#countDistinctRedemptions) | **GET** /v2/analytics/ledger/paymentObject/distinct/count | Fetch refund amount of campaigns by Campaign -[**countHelpDeskRequests()**](AnalyticsApi.md#countHelpDeskRequests) | **GET** /v2/analytics/helpdeskrequests/count | Count help desk requests by date -[**countInboundMessages()**](AnalyticsApi.md#countInboundMessages) | **GET** /v2/analytics/sms/inbound/count | Count opt in list subscribers -[**countNewSessions()**](AnalyticsApi.md#countNewSessions) | **GET** /v2/analytics/walletPageViews/sessions/count/distinct/first | Count new sessions -[**countOptInListSubscribersPartitionedByDate()**](AnalyticsApi.md#countOptInListSubscribersPartitionedByDate) | **GET** /v2/analytics/sms/all/subscribers/count/date | Count opt in list subscribers by date -[**countOutboundMessages()**](AnalyticsApi.md#countOutboundMessages) | **GET** /v2/analytics/sms/outbound/count | Count opt in list subscribers -[**countTotalSessions()**](AnalyticsApi.md#countTotalSessions) | **GET** /v2/analytics/walletPageViews/sessions/count/distinct | Count total sessions -[**countTransactions()**](AnalyticsApi.md#countTransactions) | **GET** /v2/analytics/ledger/transactions/count | Fetch refund amount of campaigns by Campaign -[**countVerifiedWalletPageViews()**](AnalyticsApi.md#countVerifiedWalletPageViews) | **GET** /v2/analytics/walletPageViews/sessions/verified/distinct/walletObjectsCount | Fetch wallet object counts within a given time frame that have a valid phone verification token -[**countWalletPageViews()**](AnalyticsApi.md#countWalletPageViews) | **GET** /v2/analytics/walletPageViews/sessions/distinct/walletObjectsCount | Fetch wallet object counts within a given time frame -[**exitLinkSummary()**](AnalyticsApi.md#exitLinkSummary) | **GET** /v2/analytics/walletPageViews/exitLinkSummary | Count exit clicks -[**fetchAnalyticsAdCreditsCountPartitionedByEmployee()**](AnalyticsApi.md#fetchAnalyticsAdCreditsCountPartitionedByEmployee) | **GET** /v2/analytics/advertisementCredits/count/employee | Count ad credits by employee -[**fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign()**](AnalyticsApi.md#fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign) | **GET** /v2/analytics/advertisementCredits/count/paymentDesign | Count ad credits by payment design -[**fetchAnalyticsAdCreditsCountPartitionedByValueType()**](AnalyticsApi.md#fetchAnalyticsAdCreditsCountPartitionedByValueType) | **GET** /v2/analytics/advertisementCredits/count/valueType | Count ad credits by value type -[**fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID) | **GET** /v2/analytics/advertisementCredits/redemptions/amount/adCredit | Fetch redemption amount of ad credits by Ad Credit -[**fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate) | **GET** /v2/analytics/advertisementCredits/redemptions/amount/date | Fetch redemption amount of ad credits by date -[**fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID) | **GET** /v2/analytics/advertisementCredits/redemptions/count/adCredit | Count redemptions of ad credits by Ad Credit -[**fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate) | **GET** /v2/analytics/advertisementCredits/redemptions/count/date | Count redemptions of ad credits by date -[**fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID) | **GET** /v2/analytics/advertisementCredits/refunds/amount/adCredit | Fetch refund amount of ad credits by Ad Credit -[**fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate) | **GET** /v2/analytics/advertisementCredits/refunds/amount/date | Fetch refund amount of ad credits by date -[**fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID) | **GET** /v2/analytics/advertisementCredits/refunds/count/adCredit | Count refunds of ad credits by Ad Credit -[**fetchAnalyticsAdCreditsRefundsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRefundsCountPartitionedByDate) | **GET** /v2/analytics/advertisementCredits/refunds/count/date | Count refunds of ad credits by date -[**fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID()**](AnalyticsApi.md#fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID) | **GET** /v2/analytics/advertisementCredits/scans/count/adCredit | Count scans of ad credits by Ad Credit -[**fetchAnalyticsAdCreditsScansCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsAdCreditsScansCountPartitionedByDate) | **GET** /v2/analytics/advertisementCredits/scans/count/date | Count scans of ad credits by date -[**fetchAnalyticsCampaignWalletPageViews()**](AnalyticsApi.md#fetchAnalyticsCampaignWalletPageViews) | **GET** /v2/analytics/walletPageViews/campaign/{campaignID} | Fetch a campaign's wallet page views -[**fetchAnalyticsCampaignsCountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsCampaignsCountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/count/campaign/created | Count created campaigns by campaign -[**fetchAnalyticsCampaignsCountPartitionedByEmployee()**](AnalyticsApi.md#fetchAnalyticsCampaignsCountPartitionedByEmployee) | **GET** /v2/analytics/campaigns/count/employee | Count campaigns by employee -[**fetchAnalyticsCampaignsCountPartitionedByPaymentDesign()**](AnalyticsApi.md#fetchAnalyticsCampaignsCountPartitionedByPaymentDesign) | **GET** /v2/analytics/campaigns/count/paymentDesign | Count campaigns by payment design -[**fetchAnalyticsCampaignsCountPartitionedByValueType()**](AnalyticsApi.md#fetchAnalyticsCampaignsCountPartitionedByValueType) | **GET** /v2/analytics/campaigns/count/valueType | Count campaigns by value type -[**fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/redemptions/amount/campaign | Fetch redemption amount of campaigns by Campaign -[**fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate) | **GET** /v2/analytics/campaigns/redemptions/amount/date | Fetch redemption amount of campaigns by date -[**fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/redemptions/count/campaign | Count redemptions of campaigns by Campaign -[**fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate) | **GET** /v2/analytics/campaigns/redemptions/count/date | Count redemptions of campaigns by date -[**fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/refunds/amount/campaign | Fetch refund amount of campaigns by Campaign -[**fetchAnalyticsCampaignsRefundsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsCampaignsRefundsAmountPartitionedByDate) | **GET** /v2/analytics/campaigns/refunds/amount/date | Fetch refund amount of campaigns by date -[**fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/refunds/count/campaign | Fetch refund amount of campaigns by Campaign -[**fetchAnalyticsCampaignsRefundsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsCampaignsRefundsCountPartitionedByDate) | **GET** /v2/analytics/campaigns/refunds/count/date | Fetch refund amount of campaigns by date -[**fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate) | **GET** /v2/analytics/outboundSMS/count/date/delivered | Count delivered outbound messages by date -[**fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber()**](AnalyticsApi.md#fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber) | **GET** /v2/analytics/outboundSMS/count/phoneNumber/delivered | Count delivered outbound messages by phone number -[**fetchAnalyticsDistinctWalletSessions()**](AnalyticsApi.md#fetchAnalyticsDistinctWalletSessions) | **GET** /v2/analytics/walletPageViews/sessions/distinct | Fetch distinct wallet sessions -[**fetchAnalyticsDynamicVouchersCountPartitionedByEmployee()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersCountPartitionedByEmployee) | **GET** /v2/analytics/dynamicVouchers/count/employee | Count dynamic vouchers by employee -[**fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign) | **GET** /v2/analytics/dynamicVouchers/count/paymentDesign | Count dynamic vouchers by payment design -[**fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate) | **GET** /v2/analytics/dynamicVouchers/redemptions/amount/date | Fetch redemption amount of dynamic vouchers by date -[**fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID) | **GET** /v2/analytics/dynamicVouchers/redemptions/amount/dynamicVoucher | Fetch redemption amount of dynamic vouchers by dynamic voucher -[**fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate) | **GET** /v2/analytics/dynamicVouchers/redemptions/count/date | Count redemptions of dynamic vouchers by date -[**fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID) | **GET** /v2/analytics/dynamicVouchers/redemptions/count/dynamicVoucher | Count redemptions of dynamic vouchers by dynamic voucher -[**fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate) | **GET** /v2/analytics/dynamicVouchers/refunds/amount/date | Fetch refund amount of dynamic vouchers by date -[**fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID) | **GET** /v2/analytics/dynamicVouchers/refunds/amount/dynamicVoucher | Fetch refund amount of dynamic vouchers by dynamic voucher -[**fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate) | **GET** /v2/analytics/dynamicVouchers/refunds/count/date | Count refunds of dynamic vouchers by date -[**fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID) | **GET** /v2/analytics/dynamicVouchers/refunds/count/dynamicVoucher | Count refunds of dynamic vouchers by dynamic voucher -[**fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate) | **GET** /v2/analytics/helpdeskrequests/count/date/created | Count help desk requests by date -[**fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate) | **GET** /v2/analytics/helpdeskrequests/count/date/resolved | Count resolved help desk requests by date -[**fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee()**](AnalyticsApi.md#fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee) | **GET** /v2/analytics/helpdeskrequests/count/employee/resolved | Count resolved help desk requests by employee -[**fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate) | **GET** /v2/analytics/helpdeskrequests/count/date/unresolved | Count unresolved help desk requests by date -[**fetchAnalyticsItemWalletPageViews()**](AnalyticsApi.md#fetchAnalyticsItemWalletPageViews) | **GET** /v2/analytics/walletPageViews/item/{itemID} | Fetch wallet page views of item -[**fetchAnalyticsMemberCount()**](AnalyticsApi.md#fetchAnalyticsMemberCount) | **GET** /v2/analytics/membership/member/count | Count members -[**fetchAnalyticsMerchantCreditCount()**](AnalyticsApi.md#fetchAnalyticsMerchantCreditCount) | **GET** /v2/analytics/membership/merchantCredit/count | Count merchant credits -[**fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/amount/campaign/offerVsRedeemed | Fetch offer vs redeemed amount by campaign -[**fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate) | **GET** /v2/analytics/paymentObjectBroadcasts/count/date/created | Count created broadcasts by date -[**fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts) | **GET** /v2/analytics/paymentObjectBroadcasts/executionTime/completed | Fetch execution time of completed broadcasts -[**fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate) | **GET** /v2/analytics/paymentObjectBroadcasts/count/date/scheduled | Count scheduled broadcasts by date -[**fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee) | **GET** /v2/analytics/paymentObjectBroadcasts/count/employee/scheduled | Count scheduled broadcasts by employee -[**fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber) | **GET** /v2/analytics/paymentObjectBroadcasts/count/phoneNumber/scheduled | Count scheduled broadcasts by phone number -[**fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate) | **GET** /v2/analytics/paymentObjectBroadcasts/sms/count/date/scheduled | Count scheduled SMS broadcasts by date -[**fetchAnalyticsSentOutboundMessagesCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsSentOutboundMessagesCountPartitionedByDate) | **GET** /v2/analytics/outboundSMS/count/date/sent | Count sent outbound messages by date -[**fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber()**](AnalyticsApi.md#fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber) | **GET** /v2/analytics/outboundSMS/count/phoneNumber/sent | Count sent outbound messages by phone number -[**fetchAnalyticsStaticVoucherWalletPageViews()**](AnalyticsApi.md#fetchAnalyticsStaticVoucherWalletPageViews) | **GET** /v2/analytics/walletPageViews/staticVoucher/{voucherID} | Fetch a static voucher's wallet page views -[**fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate) | **GET** /v2/analytics/tcpafilters/count/date/create | Count created TCPA Filter entries by date -[**fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate) | **GET** /v2/analytics/tcpafilters/count/date/delete | Count deleted TCPA Filter entries by date -[**fetchAnalyticsTCPAStopCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsTCPAStopCountPartitionedByDate) | **GET** /v2/analytics/tcpa/count/date/stop | Count TCPA (STOP) entries by date -[**fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber()**](AnalyticsApi.md#fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber) | **GET** /v2/analytics/tcpa/count/phoneNumber/stop | Count TCPA (STOP) entries by phone number -[**fetchAnalyticsTotalAmountRedeemedPerMerchantCredit()**](AnalyticsApi.md#fetchAnalyticsTotalAmountRedeemedPerMerchantCredit) | **GET** /v2/analytics/membership/merchantCredit/amount/redeemed | Fetch redeemed amount of merchant credits -[**fetchAnalyticsTotalAmountRedeemedPerTier()**](AnalyticsApi.md#fetchAnalyticsTotalAmountRedeemedPerTier) | **GET** /v2/analytics/membership/tier/amount/redeemed | Fetch redeemed amoun̥t of tiers -[**fetchAnalyticsTotalAmountRefundedPerMerchantCredit()**](AnalyticsApi.md#fetchAnalyticsTotalAmountRefundedPerMerchantCredit) | **GET** /v2/analytics/membership/merchantCredit/amount/refunded | Fetch refunded amount of merchant credits -[**fetchAnalyticsTotalAmountRefundedPerTier()**](AnalyticsApi.md#fetchAnalyticsTotalAmountRefundedPerTier) | **GET** /v2/analytics/membership/tier/amount/refunded | Fetch refunded amount of tiers -[**fetchAnalyticsTotalPointsRedeemed()**](AnalyticsApi.md#fetchAnalyticsTotalPointsRedeemed) | **GET** /v2/analytics/membership/member/points/redeemed | Count redeemed points -[**fetchAnalyticsTotalPointsRefunded()**](AnalyticsApi.md#fetchAnalyticsTotalPointsRefunded) | **GET** /v2/analytics/membership/member/points/refunded | Count refunded points -[**fetchAnalyticsWalletSessionActivity()**](AnalyticsApi.md#fetchAnalyticsWalletSessionActivity) | **GET** /v2/analytics/walletPageViews/session/activity/{sessionID} | Fetch session activity -[**fetchWalletPageViewByID()**](AnalyticsApi.md#fetchWalletPageViewByID) | **GET** /v2/analytics/walletPageViews/activity/{id} | Fetch session activity by wallet page view ID -[**referringSitesSummary()**](AnalyticsApi.md#referringSitesSummary) | **GET** /v2/analytics/walletPageViews/referringSitesSummary | Count referring sites -[**sumRevenue()**](AnalyticsApi.md#sumRevenue) | **GET** /v2/analytics/ledger/revenue/sum | Fetch refund amount of campaigns by Campaign -[**sumTransactions()**](AnalyticsApi.md#sumTransactions) | **GET** /v2/analytics/ledger/transactions/sum | Fetch refund amount of campaigns by Campaign +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**countAllSubscribers()**](AnalyticsApi.md#countAllSubscribers) | **GET** /v2/analytics/sms/all/subscribers/count | Count opt in list subscribers | +| [**countAuthenticatedSessions()**](AnalyticsApi.md#countAuthenticatedSessions) | **GET** /v2/analytics/walletPageViews/sessions/count/distinct/authenticated | Count authenticated sessions | +| [**countDistinctRedemptions()**](AnalyticsApi.md#countDistinctRedemptions) | **GET** /v2/analytics/ledger/paymentObject/distinct/count | Fetch refund amount of campaigns by Campaign | +| [**countHelpDeskRequests()**](AnalyticsApi.md#countHelpDeskRequests) | **GET** /v2/analytics/helpdeskrequests/count | Count help desk requests by date | +| [**countInboundMessages()**](AnalyticsApi.md#countInboundMessages) | **GET** /v2/analytics/sms/inbound/count | Count opt in list subscribers | +| [**countNewSessions()**](AnalyticsApi.md#countNewSessions) | **GET** /v2/analytics/walletPageViews/sessions/count/distinct/first | Count new sessions | +| [**countOptInListSubscribersPartitionedByDate()**](AnalyticsApi.md#countOptInListSubscribersPartitionedByDate) | **GET** /v2/analytics/sms/all/subscribers/count/date | Count opt in list subscribers by date | +| [**countOutboundMessages()**](AnalyticsApi.md#countOutboundMessages) | **GET** /v2/analytics/sms/outbound/count | Count opt in list subscribers | +| [**countTotalSessions()**](AnalyticsApi.md#countTotalSessions) | **GET** /v2/analytics/walletPageViews/sessions/count/distinct | Count total sessions | +| [**countTransactions()**](AnalyticsApi.md#countTransactions) | **GET** /v2/analytics/ledger/transactions/count | Fetch refund amount of campaigns by Campaign | +| [**countVerifiedWalletPageViews()**](AnalyticsApi.md#countVerifiedWalletPageViews) | **GET** /v2/analytics/walletPageViews/sessions/verified/distinct/walletObjectsCount | Fetch wallet object counts within a given time frame that have a valid phone verification token | +| [**countWalletPageViews()**](AnalyticsApi.md#countWalletPageViews) | **GET** /v2/analytics/walletPageViews/sessions/distinct/walletObjectsCount | Fetch wallet object counts within a given time frame | +| [**exitLinkSummary()**](AnalyticsApi.md#exitLinkSummary) | **GET** /v2/analytics/walletPageViews/exitLinkSummary | Count exit clicks | +| [**fetchAnalyticsAdCreditsCountPartitionedByEmployee()**](AnalyticsApi.md#fetchAnalyticsAdCreditsCountPartitionedByEmployee) | **GET** /v2/analytics/advertisementCredits/count/employee | Count ad credits by employee | +| [**fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign()**](AnalyticsApi.md#fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign) | **GET** /v2/analytics/advertisementCredits/count/paymentDesign | Count ad credits by payment design | +| [**fetchAnalyticsAdCreditsCountPartitionedByValueType()**](AnalyticsApi.md#fetchAnalyticsAdCreditsCountPartitionedByValueType) | **GET** /v2/analytics/advertisementCredits/count/valueType | Count ad credits by value type | +| [**fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID) | **GET** /v2/analytics/advertisementCredits/redemptions/amount/adCredit | Fetch redemption amount of ad credits by Ad Credit | +| [**fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate) | **GET** /v2/analytics/advertisementCredits/redemptions/amount/date | Fetch redemption amount of ad credits by date | +| [**fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID) | **GET** /v2/analytics/advertisementCredits/redemptions/count/adCredit | Count redemptions of ad credits by Ad Credit | +| [**fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate) | **GET** /v2/analytics/advertisementCredits/redemptions/count/date | Count redemptions of ad credits by date | +| [**fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID) | **GET** /v2/analytics/advertisementCredits/refunds/amount/adCredit | Fetch refund amount of ad credits by Ad Credit | +| [**fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate) | **GET** /v2/analytics/advertisementCredits/refunds/amount/date | Fetch refund amount of ad credits by date | +| [**fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID) | **GET** /v2/analytics/advertisementCredits/refunds/count/adCredit | Count refunds of ad credits by Ad Credit | +| [**fetchAnalyticsAdCreditsRefundsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsAdCreditsRefundsCountPartitionedByDate) | **GET** /v2/analytics/advertisementCredits/refunds/count/date | Count refunds of ad credits by date | +| [**fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID()**](AnalyticsApi.md#fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID) | **GET** /v2/analytics/advertisementCredits/scans/count/adCredit | Count scans of ad credits by Ad Credit | +| [**fetchAnalyticsAdCreditsScansCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsAdCreditsScansCountPartitionedByDate) | **GET** /v2/analytics/advertisementCredits/scans/count/date | Count scans of ad credits by date | +| [**fetchAnalyticsCampaignWalletPageViews()**](AnalyticsApi.md#fetchAnalyticsCampaignWalletPageViews) | **GET** /v2/analytics/walletPageViews/campaign/{campaignID} | Fetch a campaign's wallet page views | +| [**fetchAnalyticsCampaignsCountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsCampaignsCountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/count/campaign/created | Count created campaigns by campaign | +| [**fetchAnalyticsCampaignsCountPartitionedByEmployee()**](AnalyticsApi.md#fetchAnalyticsCampaignsCountPartitionedByEmployee) | **GET** /v2/analytics/campaigns/count/employee | Count campaigns by employee | +| [**fetchAnalyticsCampaignsCountPartitionedByPaymentDesign()**](AnalyticsApi.md#fetchAnalyticsCampaignsCountPartitionedByPaymentDesign) | **GET** /v2/analytics/campaigns/count/paymentDesign | Count campaigns by payment design | +| [**fetchAnalyticsCampaignsCountPartitionedByValueType()**](AnalyticsApi.md#fetchAnalyticsCampaignsCountPartitionedByValueType) | **GET** /v2/analytics/campaigns/count/valueType | Count campaigns by value type | +| [**fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/redemptions/amount/campaign | Fetch redemption amount of campaigns by Campaign | +| [**fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate) | **GET** /v2/analytics/campaigns/redemptions/amount/date | Fetch redemption amount of campaigns by date | +| [**fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/redemptions/count/campaign | Count redemptions of campaigns by Campaign | +| [**fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate) | **GET** /v2/analytics/campaigns/redemptions/count/date | Count redemptions of campaigns by date | +| [**fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/refunds/amount/campaign | Fetch refund amount of campaigns by Campaign | +| [**fetchAnalyticsCampaignsRefundsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsCampaignsRefundsAmountPartitionedByDate) | **GET** /v2/analytics/campaigns/refunds/amount/date | Fetch refund amount of campaigns by date | +| [**fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/refunds/count/campaign | Fetch refund amount of campaigns by Campaign | +| [**fetchAnalyticsCampaignsRefundsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsCampaignsRefundsCountPartitionedByDate) | **GET** /v2/analytics/campaigns/refunds/count/date | Fetch refund amount of campaigns by date | +| [**fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate) | **GET** /v2/analytics/outboundSMS/count/date/delivered | Count delivered outbound messages by date | +| [**fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber()**](AnalyticsApi.md#fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber) | **GET** /v2/analytics/outboundSMS/count/phoneNumber/delivered | Count delivered outbound messages by phone number | +| [**fetchAnalyticsDistinctWalletSessions()**](AnalyticsApi.md#fetchAnalyticsDistinctWalletSessions) | **GET** /v2/analytics/walletPageViews/sessions/distinct | Fetch distinct wallet sessions | +| [**fetchAnalyticsDynamicVouchersCountPartitionedByEmployee()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersCountPartitionedByEmployee) | **GET** /v2/analytics/dynamicVouchers/count/employee | Count dynamic vouchers by employee | +| [**fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign) | **GET** /v2/analytics/dynamicVouchers/count/paymentDesign | Count dynamic vouchers by payment design | +| [**fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate) | **GET** /v2/analytics/dynamicVouchers/redemptions/amount/date | Fetch redemption amount of dynamic vouchers by date | +| [**fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID) | **GET** /v2/analytics/dynamicVouchers/redemptions/amount/dynamicVoucher | Fetch redemption amount of dynamic vouchers by dynamic voucher | +| [**fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate) | **GET** /v2/analytics/dynamicVouchers/redemptions/count/date | Count redemptions of dynamic vouchers by date | +| [**fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID) | **GET** /v2/analytics/dynamicVouchers/redemptions/count/dynamicVoucher | Count redemptions of dynamic vouchers by dynamic voucher | +| [**fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate) | **GET** /v2/analytics/dynamicVouchers/refunds/amount/date | Fetch refund amount of dynamic vouchers by date | +| [**fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID) | **GET** /v2/analytics/dynamicVouchers/refunds/amount/dynamicVoucher | Fetch refund amount of dynamic vouchers by dynamic voucher | +| [**fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate) | **GET** /v2/analytics/dynamicVouchers/refunds/count/date | Count refunds of dynamic vouchers by date | +| [**fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID()**](AnalyticsApi.md#fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID) | **GET** /v2/analytics/dynamicVouchers/refunds/count/dynamicVoucher | Count refunds of dynamic vouchers by dynamic voucher | +| [**fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate) | **GET** /v2/analytics/helpdeskrequests/count/date/created | Count help desk requests by date | +| [**fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate) | **GET** /v2/analytics/helpdeskrequests/count/date/resolved | Count resolved help desk requests by date | +| [**fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee()**](AnalyticsApi.md#fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee) | **GET** /v2/analytics/helpdeskrequests/count/employee/resolved | Count resolved help desk requests by employee | +| [**fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate) | **GET** /v2/analytics/helpdeskrequests/count/date/unresolved | Count unresolved help desk requests by date | +| [**fetchAnalyticsItemWalletPageViews()**](AnalyticsApi.md#fetchAnalyticsItemWalletPageViews) | **GET** /v2/analytics/walletPageViews/item/{itemID} | Fetch wallet page views of item | +| [**fetchAnalyticsMemberCount()**](AnalyticsApi.md#fetchAnalyticsMemberCount) | **GET** /v2/analytics/membership/member/count | Count members | +| [**fetchAnalyticsMerchantCreditCount()**](AnalyticsApi.md#fetchAnalyticsMerchantCreditCount) | **GET** /v2/analytics/membership/merchantCredit/count | Count merchant credits | +| [**fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID()**](AnalyticsApi.md#fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID) | **GET** /v2/analytics/campaigns/amount/campaign/offerVsRedeemed | Fetch offer vs redeemed amount by campaign | +| [**fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate) | **GET** /v2/analytics/paymentObjectBroadcasts/count/date/created | Count created broadcasts by date | +| [**fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts) | **GET** /v2/analytics/paymentObjectBroadcasts/executionTime/completed | Fetch execution time of completed broadcasts | +| [**fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate) | **GET** /v2/analytics/paymentObjectBroadcasts/count/date/scheduled | Count scheduled broadcasts by date | +| [**fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee) | **GET** /v2/analytics/paymentObjectBroadcasts/count/employee/scheduled | Count scheduled broadcasts by employee | +| [**fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber) | **GET** /v2/analytics/paymentObjectBroadcasts/count/phoneNumber/scheduled | Count scheduled broadcasts by phone number | +| [**fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate) | **GET** /v2/analytics/paymentObjectBroadcasts/sms/count/date/scheduled | Count scheduled SMS broadcasts by date | +| [**fetchAnalyticsSentOutboundMessagesCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsSentOutboundMessagesCountPartitionedByDate) | **GET** /v2/analytics/outboundSMS/count/date/sent | Count sent outbound messages by date | +| [**fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber()**](AnalyticsApi.md#fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber) | **GET** /v2/analytics/outboundSMS/count/phoneNumber/sent | Count sent outbound messages by phone number | +| [**fetchAnalyticsStaticVoucherWalletPageViews()**](AnalyticsApi.md#fetchAnalyticsStaticVoucherWalletPageViews) | **GET** /v2/analytics/walletPageViews/staticVoucher/{voucherID} | Fetch a static voucher's wallet page views | +| [**fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate) | **GET** /v2/analytics/tcpafilters/count/date/create | Count created TCPA Filter entries by date | +| [**fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate) | **GET** /v2/analytics/tcpafilters/count/date/delete | Count deleted TCPA Filter entries by date | +| [**fetchAnalyticsTCPAStopCountPartitionedByDate()**](AnalyticsApi.md#fetchAnalyticsTCPAStopCountPartitionedByDate) | **GET** /v2/analytics/tcpa/count/date/stop | Count TCPA (STOP) entries by date | +| [**fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber()**](AnalyticsApi.md#fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber) | **GET** /v2/analytics/tcpa/count/phoneNumber/stop | Count TCPA (STOP) entries by phone number | +| [**fetchAnalyticsTotalAmountRedeemedPerMerchantCredit()**](AnalyticsApi.md#fetchAnalyticsTotalAmountRedeemedPerMerchantCredit) | **GET** /v2/analytics/membership/merchantCredit/amount/redeemed | Fetch redeemed amount of merchant credits | +| [**fetchAnalyticsTotalAmountRedeemedPerTier()**](AnalyticsApi.md#fetchAnalyticsTotalAmountRedeemedPerTier) | **GET** /v2/analytics/membership/tier/amount/redeemed | Fetch redeemed amoun̥t of tiers | +| [**fetchAnalyticsTotalAmountRefundedPerMerchantCredit()**](AnalyticsApi.md#fetchAnalyticsTotalAmountRefundedPerMerchantCredit) | **GET** /v2/analytics/membership/merchantCredit/amount/refunded | Fetch refunded amount of merchant credits | +| [**fetchAnalyticsTotalAmountRefundedPerTier()**](AnalyticsApi.md#fetchAnalyticsTotalAmountRefundedPerTier) | **GET** /v2/analytics/membership/tier/amount/refunded | Fetch refunded amount of tiers | +| [**fetchAnalyticsTotalPointsRedeemed()**](AnalyticsApi.md#fetchAnalyticsTotalPointsRedeemed) | **GET** /v2/analytics/membership/member/points/redeemed | Count redeemed points | +| [**fetchAnalyticsTotalPointsRefunded()**](AnalyticsApi.md#fetchAnalyticsTotalPointsRefunded) | **GET** /v2/analytics/membership/member/points/refunded | Count refunded points | +| [**fetchAnalyticsWalletSessionActivity()**](AnalyticsApi.md#fetchAnalyticsWalletSessionActivity) | **GET** /v2/analytics/walletPageViews/session/activity/{sessionID} | Fetch session activity | +| [**fetchWalletPageViewByID()**](AnalyticsApi.md#fetchWalletPageViewByID) | **GET** /v2/analytics/walletPageViews/activity/{id} | Fetch session activity by wallet page view ID | +| [**referringSitesSummary()**](AnalyticsApi.md#referringSitesSummary) | **GET** /v2/analytics/walletPageViews/referringSitesSummary | Count referring sites | +| [**sumRevenue()**](AnalyticsApi.md#sumRevenue) | **GET** /v2/analytics/ledger/revenue/sum | Fetch refund amount of campaigns by Campaign | +| [**sumTransactions()**](AnalyticsApi.md#sumTransactions) | **GET** /v2/analytics/ledger/transactions/sum | Fetch refund amount of campaigns by Campaign | ## `countAllSubscribers()` @@ -127,13 +127,13 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_subscribed** | **bool**| | [optional] - **is_pending_age21_verification** | **bool**| | [optional] - **is_archive_included** | **bool**| | [optional] - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_subscribed** | **bool**| | [optional] | +| **is_pending_age21_verification** | **bool**| | [optional] | +| **is_archive_included** | **bool**| | [optional] | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -186,10 +186,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -244,12 +244,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **transaction_type** | **string**| | [optional] - **segment_type** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **transaction_type** | **string**| | [optional] | +| **segment_type** | **string**| | [optional] | ### Return type @@ -305,13 +305,13 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | - **is_resolved** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | +| **is_resolved** | **bool**| | [optional] | ### Return type @@ -364,10 +364,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -420,10 +420,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -476,10 +476,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -532,10 +532,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -588,10 +588,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -646,12 +646,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **transaction_type** | **string**| | [optional] - **segment_type** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **transaction_type** | **string**| | [optional] | +| **segment_type** | **string**| | [optional] | ### Return type @@ -704,10 +704,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -760,10 +760,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -816,10 +816,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -872,10 +872,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -928,10 +928,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -984,10 +984,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -1040,10 +1040,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -1098,12 +1098,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -1156,10 +1156,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -1214,12 +1214,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -1272,10 +1272,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -1330,12 +1330,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -1388,10 +1388,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -1446,12 +1446,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -1504,10 +1504,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -1562,12 +1562,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -1619,9 +1619,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -1674,10 +1674,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -1730,10 +1730,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -1786,10 +1786,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -1842,10 +1842,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -1898,10 +1898,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -1956,12 +1956,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -2014,10 +2014,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -2072,12 +2072,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -2130,10 +2130,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -2188,12 +2188,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -2246,10 +2246,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -2304,12 +2304,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -2364,12 +2364,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -2422,10 +2422,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -2478,10 +2478,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -2534,10 +2534,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -2590,10 +2590,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -2648,12 +2648,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -2706,10 +2706,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -2764,12 +2764,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -2822,10 +2822,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -2880,12 +2880,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -2938,10 +2938,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -2996,12 +2996,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -3054,10 +3054,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -3112,12 +3112,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -3172,12 +3172,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -3230,10 +3230,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -3288,12 +3288,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -3345,9 +3345,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | ### Return type @@ -3402,12 +3402,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -3462,12 +3462,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -3520,10 +3520,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -3578,12 +3578,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -3636,10 +3636,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -3694,12 +3694,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -3752,10 +3752,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -3808,10 +3808,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -3866,12 +3866,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -3926,12 +3926,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -3984,10 +3984,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -4039,9 +4039,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **voucher_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **voucher_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -4094,10 +4094,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -4150,10 +4150,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -4208,12 +4208,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -4266,10 +4266,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | ### Return type @@ -4324,12 +4324,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -4384,12 +4384,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -4444,12 +4444,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -4504,12 +4504,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -4564,12 +4564,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -4624,12 +4624,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **locale** | **string**| | - **timezone** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **locale** | **string**| | | +| **timezone** | **string**| | | ### Return type @@ -4681,9 +4681,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **session_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **session_id** | **string**| | | ### Return type @@ -4735,9 +4735,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | ### Return type @@ -4790,10 +4790,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -4848,12 +4848,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **transaction_type** | **string**| | [optional] - **segment_type** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **transaction_type** | **string**| | [optional] | +| **segment_type** | **string**| | [optional] | ### Return type @@ -4908,12 +4908,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **\DateTime**| | - **end_date** | **\DateTime**| | - **transaction_type** | **string**| | [optional] - **segment_type** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date** | **\DateTime**| | | +| **end_date** | **\DateTime**| | | +| **transaction_type** | **string**| | [optional] | +| **segment_type** | **string**| | [optional] | ### Return type diff --git a/docs/Api/AppleWalletSubscribersApi.md b/docs/Api/AppleWalletSubscribersApi.md index 373084b..d836767 100644 --- a/docs/Api/AppleWalletSubscribersApi.md +++ b/docs/Api/AppleWalletSubscribersApi.md @@ -1,11 +1,11 @@ # OpenAPI\Client\AppleWalletSubscribersApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchAppleWalletSubscriberActivity()**](AppleWalletSubscribersApi.md#fetchAppleWalletSubscriberActivity) | **GET** /v2/apple/wallet/pass/subscriber/activity/{subscriptionID} | Fetch subscriber activity -[**fetchAppleWalletSubscribers()**](AppleWalletSubscribersApi.md#fetchAppleWalletSubscribers) | **GET** /v2/apple/wallet/pass/subscribers/all | Fetch all subscribers +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchAppleWalletSubscriberActivity()**](AppleWalletSubscribersApi.md#fetchAppleWalletSubscriberActivity) | **GET** /v2/apple/wallet/pass/subscriber/activity/{subscriptionID} | Fetch subscriber activity | +| [**fetchAppleWalletSubscribers()**](AppleWalletSubscribersApi.md#fetchAppleWalletSubscribers) | **GET** /v2/apple/wallet/pass/subscribers/all | Fetch all subscribers | ## `fetchAppleWalletSubscriberActivity()` @@ -41,9 +41,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **subscription_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **subscription_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -96,10 +96,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | [optional] - **end_date_time** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | [optional] | +| **end_date_time** | **\DateTime**| | [optional] | ### Return type diff --git a/docs/Api/BillingApi.md b/docs/Api/BillingApi.md index 5dcbda9..bc89c7c 100644 --- a/docs/Api/BillingApi.md +++ b/docs/Api/BillingApi.md @@ -1,22 +1,22 @@ # OpenAPI\Client\BillingApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**buyAddOn()**](BillingApi.md#buyAddOn) | **POST** /v2/billing/products/addOns/{productID} | Fetch add-on products, or 1-time purchase products (non-subscription products) -[**buySpecialOffer()**](BillingApi.md#buySpecialOffer) | **POST** /v2/billing/products/specialOffers/{productID} | Buy special offer -[**cancelPlan()**](BillingApi.md#cancelPlan) | **DELETE** /v2/billing/plan | Cancel billing plan and revert to default -[**changePlan()**](BillingApi.md#changePlan) | **PUT** /v2/billing/plan | Change billing plan -[**fetchAddOns()**](BillingApi.md#fetchAddOns) | **GET** /v2/billing/products/addOns | Fetch add-on products, or 1-time purchase products (non-subscription products) -[**fetchIndustry()**](BillingApi.md#fetchIndustry) | **GET** /v2/billing/industry | Fetch merchant's industry -[**fetchInvoices()**](BillingApi.md#fetchInvoices) | **GET** /v2/billing/invoices/all | Fetch all invoices -[**fetchSpecialOffers()**](BillingApi.md#fetchSpecialOffers) | **GET** /v2/billing/products/specialOffers | Fetch special offer products -[**fetchSubscription()**](BillingApi.md#fetchSubscription) | **GET** /v2/billing/subscription | Fetch subscription -[**fetchUsageSummary()**](BillingApi.md#fetchUsageSummary) | **GET** /v2/billing/summary | Fetch usage summary -[**savePaymentMethod()**](BillingApi.md#savePaymentMethod) | **PUT** /v2/billing/paymentMethod | Save payment method -[**upcomingInvoices()**](BillingApi.md#upcomingInvoices) | **GET** /v2/billing/invoices/upcoming | Fetch upcoming invoices -[**verifyPaymentMethod()**](BillingApi.md#verifyPaymentMethod) | **GET** /v2/billing/paymentMethod | Verify payment method +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**buyAddOn()**](BillingApi.md#buyAddOn) | **POST** /v2/billing/products/addOns/{productID} | Fetch add-on products, or 1-time purchase products (non-subscription products) | +| [**buySpecialOffer()**](BillingApi.md#buySpecialOffer) | **POST** /v2/billing/products/specialOffers/{productID} | Buy special offer | +| [**cancelPlan()**](BillingApi.md#cancelPlan) | **DELETE** /v2/billing/plan | Cancel billing plan and revert to default | +| [**changePlan()**](BillingApi.md#changePlan) | **PUT** /v2/billing/plan | Change billing plan | +| [**fetchAddOns()**](BillingApi.md#fetchAddOns) | **GET** /v2/billing/products/addOns | Fetch add-on products, or 1-time purchase products (non-subscription products) | +| [**fetchIndustry()**](BillingApi.md#fetchIndustry) | **GET** /v2/billing/industry | Fetch merchant's industry | +| [**fetchInvoices()**](BillingApi.md#fetchInvoices) | **GET** /v2/billing/invoices/all | Fetch all invoices | +| [**fetchSpecialOffers()**](BillingApi.md#fetchSpecialOffers) | **GET** /v2/billing/products/specialOffers | Fetch special offer products | +| [**fetchSubscription()**](BillingApi.md#fetchSubscription) | **GET** /v2/billing/subscription | Fetch subscription | +| [**fetchUsageSummary()**](BillingApi.md#fetchUsageSummary) | **GET** /v2/billing/summary | Fetch usage summary | +| [**savePaymentMethod()**](BillingApi.md#savePaymentMethod) | **PUT** /v2/billing/paymentMethod | Save payment method | +| [**upcomingInvoices()**](BillingApi.md#upcomingInvoices) | **GET** /v2/billing/invoices/upcoming | Fetch upcoming invoices | +| [**verifyPaymentMethod()**](BillingApi.md#verifyPaymentMethod) | **GET** /v2/billing/paymentMethod | Verify payment method | ## `buyAddOn()` @@ -52,9 +52,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **product_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **product_id** | **string**| | | ### Return type @@ -106,9 +106,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **product_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **product_id** | **string**| | | ### Return type @@ -211,9 +211,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_billing_change_plan** | [**\OpenAPI\Client\Model\WTBillingChangePlan**](../Model/WTBillingChangePlan.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_billing_change_plan** | [**\OpenAPI\Client\Model\WTBillingChangePlan**](../Model/WTBillingChangePlan.md)| | | ### Return type @@ -286,7 +286,7 @@ No authorization required ## `fetchIndustry()` ```php -fetchIndustry(): \OpenAPI\Client\Model\InlineResponse200 +fetchIndustry(): \OpenAPI\Client\Model\FetchIndustry200Response ``` Fetch merchant's industry @@ -319,7 +319,7 @@ This endpoint does not need any parameter. ### Return type -[**\OpenAPI\Client\Model\InlineResponse200**](../Model/InlineResponse200.md) +[**\OpenAPI\Client\Model\FetchIndustry200Response**](../Model/FetchIndustry200Response.md) ### Authorization @@ -521,10 +521,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | [optional] - **end_date_time** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | [optional] | +| **end_date_time** | **\DateTime**| | [optional] | ### Return type @@ -576,9 +576,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_billing_save_payment_method** | [**\OpenAPI\Client\Model\WTBillingSavePaymentMethod**](../Model/WTBillingSavePaymentMethod.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_billing_save_payment_method** | [**\OpenAPI\Client\Model\WTBillingSavePaymentMethod**](../Model/WTBillingSavePaymentMethod.md)| | | ### Return type diff --git a/docs/Api/ClubMembersPointsApi.md b/docs/Api/ClubMembersPointsApi.md index 81709a4..2c9d2bc 100644 --- a/docs/Api/ClubMembersPointsApi.md +++ b/docs/Api/ClubMembersPointsApi.md @@ -1,19 +1,19 @@ # OpenAPI\Client\ClubMembersPointsApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveMember()**](ClubMembersPointsApi.md#archiveMember) | **DELETE** /v2/membership/member/{id} | Archive member -[**createMember()**](ClubMembersPointsApi.md#createMember) | **POST** /v2/membership/member | Create member -[**fetchMemberById()**](ClubMembersPointsApi.md#fetchMemberById) | **GET** /v2/membership/member/{id} | Fetch member -[**fetchMemberHistoryLog()**](ClubMembersPointsApi.md#fetchMemberHistoryLog) | **POST** /v2/membership/member/history/log | Fetch history -[**fetchMemberRedemptionLog()**](ClubMembersPointsApi.md#fetchMemberRedemptionLog) | **POST** /v2/membership/member/redemption/log | Fetch redemption log -[**fetchMembersByPage()**](ClubMembersPointsApi.md#fetchMembersByPage) | **POST** /v2/membership/member/page | Fetch members by page -[**fetchMembersCount()**](ClubMembersPointsApi.md#fetchMembersCount) | **GET** /v2/membership/member/count | Count active members -[**restoreMember()**](ClubMembersPointsApi.md#restoreMember) | **PATCH** /v2/membership/member/{id} | Restore member -[**searchMembers()**](ClubMembersPointsApi.md#searchMembers) | **POST** /v2/membership/member/search | Search for members -[**updateMember()**](ClubMembersPointsApi.md#updateMember) | **PUT** /v2/membership/member/{id} | Update member +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveMember()**](ClubMembersPointsApi.md#archiveMember) | **DELETE** /v2/membership/member/{id} | Archive member | +| [**createMember()**](ClubMembersPointsApi.md#createMember) | **POST** /v2/membership/member | Create member | +| [**fetchMemberById()**](ClubMembersPointsApi.md#fetchMemberById) | **GET** /v2/membership/member/{id} | Fetch member | +| [**fetchMemberHistoryLog()**](ClubMembersPointsApi.md#fetchMemberHistoryLog) | **POST** /v2/membership/member/history/log | Fetch history | +| [**fetchMemberRedemptionLog()**](ClubMembersPointsApi.md#fetchMemberRedemptionLog) | **POST** /v2/membership/member/redemption/log | Fetch redemption log | +| [**fetchMembersByPage()**](ClubMembersPointsApi.md#fetchMembersByPage) | **POST** /v2/membership/member/page | Fetch members by page | +| [**fetchMembersCount()**](ClubMembersPointsApi.md#fetchMembersCount) | **GET** /v2/membership/member/count | Count active members | +| [**restoreMember()**](ClubMembersPointsApi.md#restoreMember) | **PATCH** /v2/membership/member/{id} | Restore member | +| [**searchMembers()**](ClubMembersPointsApi.md#searchMembers) | **POST** /v2/membership/member/search | Search for members | +| [**updateMember()**](ClubMembersPointsApi.md#updateMember) | **PUT** /v2/membership/member/{id} | Update member | ## `archiveMember()` @@ -49,9 +49,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -103,9 +103,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_member_creation_params** | [**\OpenAPI\Client\Model\WTMemberCreationParams**](../Model/WTMemberCreationParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_member_creation_params** | [**\OpenAPI\Client\Model\WTMemberCreationParams**](../Model/WTMemberCreationParams.md)| | | ### Return type @@ -157,9 +157,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -211,9 +211,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | | ### Return type @@ -265,9 +265,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | | ### Return type @@ -319,9 +319,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pagination_request_with_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithSortOptions**](../Model/PaginationRequestWithSortOptions.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pagination_request_with_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithSortOptions**](../Model/PaginationRequestWithSortOptions.md)| | | ### Return type @@ -343,7 +343,7 @@ No authorization required ## `fetchMembersCount()` ```php -fetchMembersCount(): \OpenAPI\Client\Model\InlineResponse2003 +fetchMembersCount(): \OpenAPI\Client\Model\FetchMembersCount200Response ``` Count active members @@ -376,7 +376,7 @@ This endpoint does not need any parameter. ### Return type -[**\OpenAPI\Client\Model\InlineResponse2003**](../Model/InlineResponse2003.md) +[**\OpenAPI\Client\Model\FetchMembersCount200Response**](../Model/FetchMembersCount200Response.md) ### Authorization @@ -424,9 +424,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -478,9 +478,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **member_search** | [**\OpenAPI\Client\Model\MemberSearch**](../Model/MemberSearch.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **member_search** | [**\OpenAPI\Client\Model\MemberSearch**](../Model/MemberSearch.md)| | | ### Return type @@ -502,7 +502,7 @@ No authorization required ## `updateMember()` ```php -updateMember($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number): \OpenAPI\Client\Model\WTMember +updateMember($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday): \OpenAPI\Client\Model\WTMember ``` Update member @@ -521,10 +521,10 @@ $apiInstance = new OpenAPI\Client\Api\ClubMembersPointsApi( new GuzzleHttp\Client() ); $id = NULL; // mixed -$pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number = new \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber(); // \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber +$pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday = new \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday(); // \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday try { - $result = $apiInstance->updateMember($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number); + $result = $apiInstance->updateMember($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday); print_r($result); } catch (Exception $e) { echo 'Exception when calling ClubMembersPointsApi->updateMember: ', $e->getMessage(), PHP_EOL; @@ -533,10 +533,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number** | [**\OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber**](../Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday** | [**\OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday**](../Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday.md)| | | ### Return type diff --git a/docs/Api/ConfigurationApi.md b/docs/Api/ConfigurationApi.md index 716a1b6..1d217b9 100644 --- a/docs/Api/ConfigurationApi.md +++ b/docs/Api/ConfigurationApi.md @@ -1,12 +1,12 @@ # OpenAPI\Client\ConfigurationApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createPublicChatRoom()**](ConfigurationApi.md#createPublicChatRoom) | **POST** /v2/wallet/createPublicChatRoom | -[**saveMerchantCreditPaymentDesign()**](ConfigurationApi.md#saveMerchantCreditPaymentDesign) | **PUT** /v2/wallet/merchantCredit/paymentDesign | Update wallet record -[**saveWalletRecord()**](ConfigurationApi.md#saveWalletRecord) | **PUT** /v2/wallet | Update wallet record +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createPublicChatRoom()**](ConfigurationApi.md#createPublicChatRoom) | **POST** /v2/wallet/createPublicChatRoom | | +| [**saveMerchantCreditPaymentDesign()**](ConfigurationApi.md#saveMerchantCreditPaymentDesign) | **PUT** /v2/wallet/merchantCredit/paymentDesign | Update wallet record | +| [**saveWalletRecord()**](ConfigurationApi.md#saveWalletRecord) | **PUT** /v2/wallet | Update wallet record | ## `createPublicChatRoom()` @@ -65,7 +65,7 @@ No authorization required ## `saveMerchantCreditPaymentDesign()` ```php -saveMerchantCreditPaymentDesign($inline_object3): mixed +saveMerchantCreditPaymentDesign($save_merchant_credit_payment_design_request): mixed ``` Update wallet record @@ -83,10 +83,10 @@ $apiInstance = new OpenAPI\Client\Api\ConfigurationApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$inline_object3 = new \OpenAPI\Client\Model\InlineObject3(); // \OpenAPI\Client\Model\InlineObject3 +$save_merchant_credit_payment_design_request = new \OpenAPI\Client\Model\SaveMerchantCreditPaymentDesignRequest(); // \OpenAPI\Client\Model\SaveMerchantCreditPaymentDesignRequest try { - $result = $apiInstance->saveMerchantCreditPaymentDesign($inline_object3); + $result = $apiInstance->saveMerchantCreditPaymentDesign($save_merchant_credit_payment_design_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling ConfigurationApi->saveMerchantCreditPaymentDesign: ', $e->getMessage(), PHP_EOL; @@ -95,9 +95,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **inline_object3** | [**\OpenAPI\Client\Model\InlineObject3**](../Model/InlineObject3.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **save_merchant_credit_payment_design_request** | [**\OpenAPI\Client\Model\SaveMerchantCreditPaymentDesignRequest**](../Model/SaveMerchantCreditPaymentDesignRequest.md)| | | ### Return type @@ -149,9 +149,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_wallet_configuration_save_wallet_record** | [**\OpenAPI\Client\Model\WTWalletConfigurationSaveWalletRecord**](../Model/WTWalletConfigurationSaveWalletRecord.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_wallet_configuration_save_wallet_record** | [**\OpenAPI\Client\Model\WTWalletConfigurationSaveWalletRecord**](../Model/WTWalletConfigurationSaveWalletRecord.md)| | | ### Return type diff --git a/docs/Api/CountriesApi.md b/docs/Api/CountriesApi.md index d457831..27e5af7 100644 --- a/docs/Api/CountriesApi.md +++ b/docs/Api/CountriesApi.md @@ -1,16 +1,16 @@ # OpenAPI\Client\CountriesApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchAllCountries()**](CountriesApi.md#fetchAllCountries) | **GET** /system/countries/all | Fetch all countries +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchAllCountries()**](CountriesApi.md#fetchAllCountries) | **GET** /system/countries/all | Fetch all countries | ## `fetchAllCountries()` ```php -fetchAllCountries(): \OpenAPI\Client\Model\InlineResponse20011[] +fetchAllCountries(): \OpenAPI\Client\Model\FetchAllCountries200ResponseInner[] ``` Fetch all countries @@ -43,7 +43,7 @@ This endpoint does not need any parameter. ### Return type -[**\OpenAPI\Client\Model\InlineResponse20011[]**](../Model/InlineResponse20011.md) +[**\OpenAPI\Client\Model\FetchAllCountries200ResponseInner[]**](../Model/FetchAllCountries200ResponseInner.md) ### Authorization diff --git a/docs/Api/CustomerApi.md b/docs/Api/CustomerApi.md index 8929e25..a8e3776 100644 --- a/docs/Api/CustomerApi.md +++ b/docs/Api/CustomerApi.md @@ -1,18 +1,18 @@ # OpenAPI\Client\CustomerApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchActiveVouchers()**](CustomerApi.md#fetchActiveVouchers) | **GET** /v2/customer/vouchers/active | Fetch active static vouchers -[**fetchAllVouchers()**](CustomerApi.md#fetchAllVouchers) | **GET** /v2/customer/vouchers/all | Fetch all static vouchers -[**fetchExpiredVouchers()**](CustomerApi.md#fetchExpiredVouchers) | **GET** /v2/customer/vouchers/expired | Fetch expired static vouchers -[**fetchRedeemedVouchers()**](CustomerApi.md#fetchRedeemedVouchers) | **GET** /v2/customer/vouchers/redeemed | Fetch redeemed static vouchers -[**fetchRefundedVouchers()**](CustomerApi.md#fetchRefundedVouchers) | **GET** /v2/customer/vouchers/refunded | Fetch refunded static vouchers -[**fetchUpcomingVouchers()**](CustomerApi.md#fetchUpcomingVouchers) | **GET** /v2/customer/vouchers/upcoming | Fetch upcoming static vouchers -[**fetchWalletViewsForSession()**](CustomerApi.md#fetchWalletViewsForSession) | **GET** /v2/customer/walletViews/session/{id} | Fetch Wallet Views for Session -[**searchByMemberID()**](CustomerApi.md#searchByMemberID) | **POST** /v2/customer/search/memberID | Find members with memberID -[**searchByPhoneNumber()**](CustomerApi.md#searchByPhoneNumber) | **POST** /v2/customer/search/phoneNumber | Find members with phone number +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchActiveVouchers()**](CustomerApi.md#fetchActiveVouchers) | **GET** /v2/customer/vouchers/active | Fetch active static vouchers | +| [**fetchAllVouchers()**](CustomerApi.md#fetchAllVouchers) | **GET** /v2/customer/vouchers/all | Fetch all static vouchers | +| [**fetchExpiredVouchers()**](CustomerApi.md#fetchExpiredVouchers) | **GET** /v2/customer/vouchers/expired | Fetch expired static vouchers | +| [**fetchRedeemedVouchers()**](CustomerApi.md#fetchRedeemedVouchers) | **GET** /v2/customer/vouchers/redeemed | Fetch redeemed static vouchers | +| [**fetchRefundedVouchers()**](CustomerApi.md#fetchRefundedVouchers) | **GET** /v2/customer/vouchers/refunded | Fetch refunded static vouchers | +| [**fetchUpcomingVouchers()**](CustomerApi.md#fetchUpcomingVouchers) | **GET** /v2/customer/vouchers/upcoming | Fetch upcoming static vouchers | +| [**fetchWalletViewsForSession()**](CustomerApi.md#fetchWalletViewsForSession) | **GET** /v2/customer/walletViews/session/{id} | Fetch Wallet Views for Session | +| [**searchByMemberID()**](CustomerApi.md#searchByMemberID) | **POST** /v2/customer/search/memberID | Find members with memberID | +| [**searchByPhoneNumber()**](CustomerApi.md#searchByPhoneNumber) | **POST** /v2/customer/search/phoneNumber | Find members with phone number | ## `fetchActiveVouchers()` @@ -49,10 +49,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **member_id** | **string**| | [optional] - **cell_phone_number** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **member_id** | **string**| | [optional] | +| **cell_phone_number** | **string**| | [optional] | ### Return type @@ -105,10 +105,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **member_id** | **string**| | [optional] - **cell_phone_number** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **member_id** | **string**| | [optional] | +| **cell_phone_number** | **string**| | [optional] | ### Return type @@ -161,10 +161,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **member_id** | **string**| | [optional] - **cell_phone_number** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **member_id** | **string**| | [optional] | +| **cell_phone_number** | **string**| | [optional] | ### Return type @@ -217,10 +217,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **member_id** | **string**| | [optional] - **cell_phone_number** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **member_id** | **string**| | [optional] | +| **cell_phone_number** | **string**| | [optional] | ### Return type @@ -273,10 +273,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **member_id** | **string**| | [optional] - **cell_phone_number** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **member_id** | **string**| | [optional] | +| **cell_phone_number** | **string**| | [optional] | ### Return type @@ -329,10 +329,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **member_id** | **string**| | [optional] - **cell_phone_number** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **member_id** | **string**| | [optional] | +| **cell_phone_number** | **string**| | [optional] | ### Return type @@ -384,9 +384,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | ### Return type @@ -438,9 +438,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_customer_search_by_member_id** | [**\OpenAPI\Client\Model\WTCustomerSearchByMemberID**](../Model/WTCustomerSearchByMemberID.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_customer_search_by_member_id** | [**\OpenAPI\Client\Model\WTCustomerSearchByMemberID**](../Model/WTCustomerSearchByMemberID.md)| | | ### Return type @@ -492,9 +492,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_customer_search_by_phone_number** | [**\OpenAPI\Client\Model\WTCustomerSearchByPhoneNumber**](../Model/WTCustomerSearchByPhoneNumber.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_customer_search_by_phone_number** | [**\OpenAPI\Client\Model\WTCustomerSearchByPhoneNumber**](../Model/WTCustomerSearchByPhoneNumber.md)| | | ### Return type diff --git a/docs/Api/DashboardApi.md b/docs/Api/DashboardApi.md index 4943277..1b3059d 100644 --- a/docs/Api/DashboardApi.md +++ b/docs/Api/DashboardApi.md @@ -1,27 +1,27 @@ # OpenAPI\Client\DashboardApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchDashboardActiveStaticVoucherCampaignsCount()**](DashboardApi.md#fetchDashboardActiveStaticVoucherCampaignsCount) | **GET** /v2/dashboard/count/staticVoucherCampaigns/active | Count active static voucher campaigns -[**fetchDashboardActiveStaticVouchersCount()**](DashboardApi.md#fetchDashboardActiveStaticVouchersCount) | **GET** /v2/dashboard/count/staticVouchers/active | Count active static vouchers -[**fetchDashboardAppleWalletSubscribersCount()**](DashboardApi.md#fetchDashboardAppleWalletSubscribersCount) | **GET** /v2/dashboard/count/appleWallet/subscribers | Count Apple Wallet Subscribers -[**fetchDashboardEmployeesCount()**](DashboardApi.md#fetchDashboardEmployeesCount) | **GET** /v2/dashboard/count/employees | Count employees -[**fetchDashboardMembersCount()**](DashboardApi.md#fetchDashboardMembersCount) | **GET** /v2/dashboard/count/members | Count members -[**fetchDashboardMembershipTiersCount()**](DashboardApi.md#fetchDashboardMembershipTiersCount) | **GET** /v2/dashboard/count/membershipTiers | Count tiers -[**fetchDashboardNewsArticlesCount()**](DashboardApi.md#fetchDashboardNewsArticlesCount) | **GET** /v2/dashboard/count/newsArticles | Count News Articles -[**fetchDashboardOptInListsCount()**](DashboardApi.md#fetchDashboardOptInListsCount) | **GET** /v2/dashboard/count/optInLists | Count opt in lists -[**fetchDashboardOptInSourcesCount()**](DashboardApi.md#fetchDashboardOptInSourcesCount) | **GET** /v2/dashboard/count/optInSources | Count opt in sources -[**fetchDashboardOutboundSMSCount()**](DashboardApi.md#fetchDashboardOutboundSMSCount) | **GET** /v2/dashboard/count/sms/outbound | Count Outbound SMS -[**fetchDashboardPOSMachinesCount()**](DashboardApi.md#fetchDashboardPOSMachinesCount) | **GET** /v2/dashboard/count/pos/machines | Count POS Machines -[**fetchDashboardPOSTransactionsCount()**](DashboardApi.md#fetchDashboardPOSTransactionsCount) | **GET** /v2/dashboard/count/pos/transactions | Count POS Transactions -[**fetchDashboardPerformancesCount()**](DashboardApi.md#fetchDashboardPerformancesCount) | **GET** /v2/dashboard/count/performances | Count Performances -[**fetchDashboardPhoneNumbersCount()**](DashboardApi.md#fetchDashboardPhoneNumbersCount) | **GET** /v2/dashboard/count/phoneNumbers | Count phone numbers -[**fetchDashboardRedemptionsCount()**](DashboardApi.md#fetchDashboardRedemptionsCount) | **GET** /v2/dashboard/count/pos/redemptions | Count POS redemptions -[**fetchDashboardRefundsCount()**](DashboardApi.md#fetchDashboardRefundsCount) | **GET** /v2/dashboard/count/pos/refunds | Count POS refunds -[**fetchDashboardWalletPageViewsCount()**](DashboardApi.md#fetchDashboardWalletPageViewsCount) | **GET** /v2/dashboard/count/wallet/pageViews | Count Wallet page views -[**fetchDashboardWidgetsCatalog()**](DashboardApi.md#fetchDashboardWidgetsCatalog) | **GET** /v2/dashboard/widgets | Fetch widgets catalog +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchDashboardActiveStaticVoucherCampaignsCount()**](DashboardApi.md#fetchDashboardActiveStaticVoucherCampaignsCount) | **GET** /v2/dashboard/count/staticVoucherCampaigns/active | Count active static voucher campaigns | +| [**fetchDashboardActiveStaticVouchersCount()**](DashboardApi.md#fetchDashboardActiveStaticVouchersCount) | **GET** /v2/dashboard/count/staticVouchers/active | Count active static vouchers | +| [**fetchDashboardAppleWalletSubscribersCount()**](DashboardApi.md#fetchDashboardAppleWalletSubscribersCount) | **GET** /v2/dashboard/count/appleWallet/subscribers | Count Apple Wallet Subscribers | +| [**fetchDashboardEmployeesCount()**](DashboardApi.md#fetchDashboardEmployeesCount) | **GET** /v2/dashboard/count/employees | Count employees | +| [**fetchDashboardMembersCount()**](DashboardApi.md#fetchDashboardMembersCount) | **GET** /v2/dashboard/count/members | Count members | +| [**fetchDashboardMembershipTiersCount()**](DashboardApi.md#fetchDashboardMembershipTiersCount) | **GET** /v2/dashboard/count/membershipTiers | Count tiers | +| [**fetchDashboardNewsArticlesCount()**](DashboardApi.md#fetchDashboardNewsArticlesCount) | **GET** /v2/dashboard/count/newsArticles | Count News Articles | +| [**fetchDashboardOptInListsCount()**](DashboardApi.md#fetchDashboardOptInListsCount) | **GET** /v2/dashboard/count/optInLists | Count opt in lists | +| [**fetchDashboardOptInSourcesCount()**](DashboardApi.md#fetchDashboardOptInSourcesCount) | **GET** /v2/dashboard/count/optInSources | Count opt in sources | +| [**fetchDashboardOutboundSMSCount()**](DashboardApi.md#fetchDashboardOutboundSMSCount) | **GET** /v2/dashboard/count/sms/outbound | Count Outbound SMS | +| [**fetchDashboardPOSMachinesCount()**](DashboardApi.md#fetchDashboardPOSMachinesCount) | **GET** /v2/dashboard/count/pos/machines | Count POS Machines | +| [**fetchDashboardPOSTransactionsCount()**](DashboardApi.md#fetchDashboardPOSTransactionsCount) | **GET** /v2/dashboard/count/pos/transactions | Count POS Transactions | +| [**fetchDashboardPerformancesCount()**](DashboardApi.md#fetchDashboardPerformancesCount) | **GET** /v2/dashboard/count/performances | Count Performances | +| [**fetchDashboardPhoneNumbersCount()**](DashboardApi.md#fetchDashboardPhoneNumbersCount) | **GET** /v2/dashboard/count/phoneNumbers | Count phone numbers | +| [**fetchDashboardRedemptionsCount()**](DashboardApi.md#fetchDashboardRedemptionsCount) | **GET** /v2/dashboard/count/pos/redemptions | Count POS redemptions | +| [**fetchDashboardRefundsCount()**](DashboardApi.md#fetchDashboardRefundsCount) | **GET** /v2/dashboard/count/pos/refunds | Count POS refunds | +| [**fetchDashboardWalletPageViewsCount()**](DashboardApi.md#fetchDashboardWalletPageViewsCount) | **GET** /v2/dashboard/count/wallet/pageViews | Count Wallet page views | +| [**fetchDashboardWidgetsCatalog()**](DashboardApi.md#fetchDashboardWidgetsCatalog) | **GET** /v2/dashboard/widgets | Fetch widgets catalog | ## `fetchDashboardActiveStaticVoucherCampaignsCount()` @@ -58,10 +58,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -114,10 +114,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -170,10 +170,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -226,10 +226,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -282,10 +282,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -338,10 +338,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -394,10 +394,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -450,10 +450,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -506,10 +506,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -562,10 +562,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -618,10 +618,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -674,10 +674,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -730,10 +730,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -786,10 +786,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -842,10 +842,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -898,10 +898,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -955,11 +955,11 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | - **wallet_object_prefix** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | +| **wallet_object_prefix** | **string**| | [optional] | ### Return type diff --git a/docs/Api/DiningApi.md b/docs/Api/DiningApi.md index 5b111f6..0f68cd2 100644 --- a/docs/Api/DiningApi.md +++ b/docs/Api/DiningApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\DiningApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveDining()**](DiningApi.md#archiveDining) | **DELETE** /v2/dining/{id} | Archive dining -[**createDining()**](DiningApi.md#createDining) | **POST** /v2/dining | Create dining -[**fetchAllDining()**](DiningApi.md#fetchAllDining) | **GET** /v2/dining/all | Fetch all dining -[**restoreDining()**](DiningApi.md#restoreDining) | **PATCH** /v2/dining/{id} | Restore dining -[**updateDining()**](DiningApi.md#updateDining) | **PUT** /v2/dining/{id} | Update dining +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveDining()**](DiningApi.md#archiveDining) | **DELETE** /v2/dining/{id} | Archive dining | +| [**createDining()**](DiningApi.md#createDining) | **POST** /v2/dining | Create dining | +| [**fetchAllDining()**](DiningApi.md#fetchAllDining) | **GET** /v2/dining/all | Fetch all dining | +| [**restoreDining()**](DiningApi.md#restoreDining) | **PATCH** /v2/dining/{id} | Restore dining | +| [**updateDining()**](DiningApi.md#updateDining) | **PUT** /v2/dining/{id} | Update dining | ## `archiveDining()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_dining_create_params** | [**\OpenAPI\Client\Model\WTDiningCreateParams**](../Model/WTDiningCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_dining_create_params** | [**\OpenAPI\Client\Model\WTDiningCreateParams**](../Model/WTDiningCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_dining_update_params** | [**\OpenAPI\Client\Model\WTDiningUpdateParams**](../Model/WTDiningUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_dining_update_params** | [**\OpenAPI\Client\Model\WTDiningUpdateParams**](../Model/WTDiningUpdateParams.md)| | | ### Return type diff --git a/docs/Api/DynamicVouchersApi.md b/docs/Api/DynamicVouchersApi.md index ce1c952..a79b478 100644 --- a/docs/Api/DynamicVouchersApi.md +++ b/docs/Api/DynamicVouchersApi.md @@ -1,18 +1,18 @@ # OpenAPI\Client\DynamicVouchersApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveDynamicVoucherCampaign()**](DynamicVouchersApi.md#archiveDynamicVoucherCampaign) | **DELETE** /v2/payment/dynamicVoucher/{campaignID} | Archive dynamic voucher campaign -[**createDynamicVoucher()**](DynamicVouchersApi.md#createDynamicVoucher) | **POST** /v2/payment/dynamicVoucher | Create dynamic voucher -[**fetchAllDynamicVouchers()**](DynamicVouchersApi.md#fetchAllDynamicVouchers) | **GET** /v2/payment/dynamicVoucher/all | Fetch all active dynamic vouchers -[**fetchDynamicVoucherById()**](DynamicVouchersApi.md#fetchDynamicVoucherById) | **GET** /v2/payment/dynamicVoucher/{id} | Fetch dynamic voucher -[**fetchDynamicVoucherRedemptions()**](DynamicVouchersApi.md#fetchDynamicVoucherRedemptions) | **GET** /v2/payment/dynamicVoucher/redemptions/{id} | Fetch redemptions -[**fetchReachStatsOfAllDynamicVouchers()**](DynamicVouchersApi.md#fetchReachStatsOfAllDynamicVouchers) | **GET** /v2/payment/dynamicVoucher/reach/all | Get the reach statistics of all the dynamic vouchers -[**fetchReachStatsOfIndividualDynamicVoucher()**](DynamicVouchersApi.md#fetchReachStatsOfIndividualDynamicVoucher) | **GET** /v2/payment/dynamicVoucher/reach/{dynamicVoucherID} | Get the reach statistics of an individual dynamic voucher -[**restoreDynamicVoucherCampaign()**](DynamicVouchersApi.md#restoreDynamicVoucherCampaign) | **PATCH** /v2/payment/dynamicVoucher/{campaignID} | Restore dynamic voucher campaign -[**saveDynamicVoucher()**](DynamicVouchersApi.md#saveDynamicVoucher) | **PUT** /v2/payment/dynamicVoucher/{id} | Update dynamic voucher +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveDynamicVoucherCampaign()**](DynamicVouchersApi.md#archiveDynamicVoucherCampaign) | **DELETE** /v2/payment/dynamicVoucher/{campaignID} | Archive dynamic voucher campaign | +| [**createDynamicVoucher()**](DynamicVouchersApi.md#createDynamicVoucher) | **POST** /v2/payment/dynamicVoucher | Create dynamic voucher | +| [**fetchAllDynamicVouchers()**](DynamicVouchersApi.md#fetchAllDynamicVouchers) | **GET** /v2/payment/dynamicVoucher/all | Fetch all active dynamic vouchers | +| [**fetchDynamicVoucherById()**](DynamicVouchersApi.md#fetchDynamicVoucherById) | **GET** /v2/payment/dynamicVoucher/{id} | Fetch dynamic voucher | +| [**fetchDynamicVoucherRedemptions()**](DynamicVouchersApi.md#fetchDynamicVoucherRedemptions) | **GET** /v2/payment/dynamicVoucher/redemptions/{id} | Fetch redemptions | +| [**fetchReachStatsOfAllDynamicVouchers()**](DynamicVouchersApi.md#fetchReachStatsOfAllDynamicVouchers) | **GET** /v2/payment/dynamicVoucher/reach/all | Get the reach statistics of all the dynamic vouchers | +| [**fetchReachStatsOfIndividualDynamicVoucher()**](DynamicVouchersApi.md#fetchReachStatsOfIndividualDynamicVoucher) | **GET** /v2/payment/dynamicVoucher/reach/{dynamicVoucherID} | Get the reach statistics of an individual dynamic voucher | +| [**restoreDynamicVoucherCampaign()**](DynamicVouchersApi.md#restoreDynamicVoucherCampaign) | **PATCH** /v2/payment/dynamicVoucher/{campaignID} | Restore dynamic voucher campaign | +| [**saveDynamicVoucher()**](DynamicVouchersApi.md#saveDynamicVoucher) | **PUT** /v2/payment/dynamicVoucher/{id} | Update dynamic voucher | ## `archiveDynamicVoucherCampaign()` @@ -48,9 +48,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -102,9 +102,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_dynamic_voucher_create_params** | [**\OpenAPI\Client\Model\WTDynamicVoucherCreateParams**](../Model/WTDynamicVoucherCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_dynamic_voucher_create_params** | [**\OpenAPI\Client\Model\WTDynamicVoucherCreateParams**](../Model/WTDynamicVoucherCreateParams.md)| | | ### Return type @@ -156,9 +156,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -210,9 +210,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -264,9 +264,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -319,10 +319,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **broadcast_scheduled_start_at** | **\DateTime**| | [optional] - **broadcast_scheduled_end_at** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **broadcast_scheduled_start_at** | **\DateTime**| | [optional] | +| **broadcast_scheduled_end_at** | **\DateTime**| | [optional] | ### Return type @@ -376,11 +376,11 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **dynamic_voucher_id** | [**mixed**](../Model/.md)| | - **broadcast_scheduled_start_at** | **\DateTime**| | [optional] - **broadcast_scheduled_end_at** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **dynamic_voucher_id** | [**mixed**](../Model/.md)| | | +| **broadcast_scheduled_start_at** | **\DateTime**| | [optional] | +| **broadcast_scheduled_end_at** | **\DateTime**| | [optional] | ### Return type @@ -432,9 +432,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -487,10 +487,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_dynamic_voucher_update_params** | [**\OpenAPI\Client\Model\WTDynamicVoucherUpdateParams**](../Model/WTDynamicVoucherUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_dynamic_voucher_update_params** | [**\OpenAPI\Client\Model\WTDynamicVoucherUpdateParams**](../Model/WTDynamicVoucherUpdateParams.md)| | | ### Return type diff --git a/docs/Api/EmailSubscriberApi.md b/docs/Api/EmailSubscriberApi.md index 4ff1c82..9321a1b 100644 --- a/docs/Api/EmailSubscriberApi.md +++ b/docs/Api/EmailSubscriberApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\EmailSubscriberApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveEmailSubscriber()**](EmailSubscriberApi.md#archiveEmailSubscriber) | **DELETE** /v2/emailSubscriber/{id} | Archive email subscriber -[**createEmailSubscriber()**](EmailSubscriberApi.md#createEmailSubscriber) | **POST** /v2/emailSubscriber | Create email subscriber -[**fetchAllEmailSubscribers()**](EmailSubscriberApi.md#fetchAllEmailSubscribers) | **GET** /v2/emailSubscriber/all | Fetch all email subscribers -[**restoreEmailSubscriber()**](EmailSubscriberApi.md#restoreEmailSubscriber) | **PATCH** /v2/emailSubscriber/{id} | Restore email subscriber -[**updateEmailSubscriber()**](EmailSubscriberApi.md#updateEmailSubscriber) | **PUT** /v2/emailSubscriber/{id} | Update email subscriber +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveEmailSubscriber()**](EmailSubscriberApi.md#archiveEmailSubscriber) | **DELETE** /v2/emailSubscriber/{id} | Archive email subscriber | +| [**createEmailSubscriber()**](EmailSubscriberApi.md#createEmailSubscriber) | **POST** /v2/emailSubscriber | Create email subscriber | +| [**fetchAllEmailSubscribers()**](EmailSubscriberApi.md#fetchAllEmailSubscribers) | **GET** /v2/emailSubscriber/all | Fetch all email subscribers | +| [**restoreEmailSubscriber()**](EmailSubscriberApi.md#restoreEmailSubscriber) | **PATCH** /v2/emailSubscriber/{id} | Restore email subscriber | +| [**updateEmailSubscriber()**](EmailSubscriberApi.md#updateEmailSubscriber) | **PUT** /v2/emailSubscriber/{id} | Update email subscriber | ## `archiveEmailSubscriber()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_email_subscriber_create_params** | [**\OpenAPI\Client\Model\WTEmailSubscriberCreateParams**](../Model/WTEmailSubscriberCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_email_subscriber_create_params** | [**\OpenAPI\Client\Model\WTEmailSubscriberCreateParams**](../Model/WTEmailSubscriberCreateParams.md)| | | ### Return type @@ -154,11 +154,11 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | [optional] - **end_date_time** | **\DateTime**| | [optional] - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | [optional] | +| **end_date_time** | **\DateTime**| | [optional] | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -210,9 +210,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -265,10 +265,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_email_subscriber_update_params** | [**\OpenAPI\Client\Model\WTEmailSubscriberUpdateParams**](../Model/WTEmailSubscriberUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_email_subscriber_update_params** | [**\OpenAPI\Client\Model\WTEmailSubscriberUpdateParams**](../Model/WTEmailSubscriberUpdateParams.md)| | | ### Return type diff --git a/docs/Api/EmployeeAPIKeysApi.md b/docs/Api/EmployeeAPIKeysApi.md index 480bf4f..1418e1c 100644 --- a/docs/Api/EmployeeAPIKeysApi.md +++ b/docs/Api/EmployeeAPIKeysApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\EmployeeAPIKeysApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveEmployeeAPIKeys()**](EmployeeAPIKeysApi.md#archiveEmployeeAPIKeys) | **DELETE** /v2/employee/apiKeys/{id} | Archive employee API Key -[**createEmployeeAPIKeys()**](EmployeeAPIKeysApi.md#createEmployeeAPIKeys) | **POST** /v2/employee/apiKeys | Create employee API Key -[**fetchAllEmployeeAPIKeys()**](EmployeeAPIKeysApi.md#fetchAllEmployeeAPIKeys) | **GET** /v2/employee/apiKeys/all | Fetch all employee API Keys -[**fetchEmployeeAPIKeyById()**](EmployeeAPIKeysApi.md#fetchEmployeeAPIKeyById) | **GET** /v2/employee/apiKeys/{id} | Fetch API Key -[**updateEmployeeAPIKeys()**](EmployeeAPIKeysApi.md#updateEmployeeAPIKeys) | **PUT** /v2/employee/apiKeys/{id} | Update employee API Key +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveEmployeeAPIKeys()**](EmployeeAPIKeysApi.md#archiveEmployeeAPIKeys) | **DELETE** /v2/employee/apiKeys/{id} | Archive employee API Key | +| [**createEmployeeAPIKeys()**](EmployeeAPIKeysApi.md#createEmployeeAPIKeys) | **POST** /v2/employee/apiKeys | Create employee API Key | +| [**fetchAllEmployeeAPIKeys()**](EmployeeAPIKeysApi.md#fetchAllEmployeeAPIKeys) | **GET** /v2/employee/apiKeys/all | Fetch all employee API Keys | +| [**fetchEmployeeAPIKeyById()**](EmployeeAPIKeysApi.md#fetchEmployeeAPIKeyById) | **GET** /v2/employee/apiKeys/{id} | Fetch API Key | +| [**updateEmployeeAPIKeys()**](EmployeeAPIKeysApi.md#updateEmployeeAPIKeys) | **PUT** /v2/employee/apiKeys/{id} | Update employee API Key | ## `archiveEmployeeAPIKeys()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_api_key_create_params** | [**\OpenAPI\Client\Model\WTEmployeeAPIKeyCreateParams**](../Model/WTEmployeeAPIKeyCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_api_key_create_params** | [**\OpenAPI\Client\Model\WTEmployeeAPIKeyCreateParams**](../Model/WTEmployeeAPIKeyCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_employee_api_key_update_params** | [**\OpenAPI\Client\Model\WTEmployeeAPIKeyUpdateParams**](../Model/WTEmployeeAPIKeyUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_employee_api_key_update_params** | [**\OpenAPI\Client\Model\WTEmployeeAPIKeyUpdateParams**](../Model/WTEmployeeAPIKeyUpdateParams.md)| | | ### Return type diff --git a/docs/Api/EmployeeAccessApi.md b/docs/Api/EmployeeAccessApi.md index 1a12447..2bdabac 100644 --- a/docs/Api/EmployeeAccessApi.md +++ b/docs/Api/EmployeeAccessApi.md @@ -1,10 +1,10 @@ # OpenAPI\Client\EmployeeAccessApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**register()**](EmployeeAccessApi.md#register) | **POST** /authentication/register | Register +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**register()**](EmployeeAccessApi.md#register) | **POST** /authentication/register | Register | ## `register()` @@ -40,9 +40,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_authentication_register** | [**\OpenAPI\Client\Model\WTAuthenticationRegister**](../Model/WTAuthenticationRegister.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_authentication_register** | [**\OpenAPI\Client\Model\WTAuthenticationRegister**](../Model/WTAuthenticationRegister.md)| | | ### Return type diff --git a/docs/Api/EmployeesApi.md b/docs/Api/EmployeesApi.md index d2ddb47..3843978 100644 --- a/docs/Api/EmployeesApi.md +++ b/docs/Api/EmployeesApi.md @@ -1,55 +1,55 @@ # OpenAPI\Client\EmployeesApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPeerToRoles()**](EmployeesApi.md#addPeerToRoles) | **POST** /v2/employee/roles/peer/{userID} | Add peer to roles -[**createDocument()**](EmployeesApi.md#createDocument) | **POST** /v2/employee/document | Create document -[**createEmployeePeer()**](EmployeesApi.md#createEmployeePeer) | **POST** /v2/employee/peer | Create employee peer -[**createFile()**](EmployeesApi.md#createFile) | **POST** /v2/employee/file/create | Create file -[**createMediaFile()**](EmployeesApi.md#createMediaFile) | **POST** /v2/employee/mediaFile | Create media file -[**createStaticVoucherCampaignsGroup()**](EmployeesApi.md#createStaticVoucherCampaignsGroup) | **POST** /v2/employee/staticVoucherCampaignsGroup | Create static voucher campaign group -[**deleteDocument()**](EmployeesApi.md#deleteDocument) | **DELETE** /v2/employee/document/{documentID} | Delete document -[**deleteMediaFile()**](EmployeesApi.md#deleteMediaFile) | **DELETE** /v2/employee/mediaFile/{mediaFileID} | Delete media file -[**downloadFile()**](EmployeesApi.md#downloadFile) | **GET** /v2/employee/file/download/{fileID} | Fetch URL for file download -[**exportClubMembers()**](EmployeesApi.md#exportClubMembers) | **PUT** /v2/employee/export/members | Export club members -[**exportMerchantCredits()**](EmployeesApi.md#exportMerchantCredits) | **PUT** /v2/employee/export/merchantCredits | Export merchant credits -[**exportStaticVoucherCampaign()**](EmployeesApi.md#exportStaticVoucherCampaign) | **PUT** /v2/employee/export/staticVoucherCampaign/{campaignID} | Export static voucher campaign -[**failedImport()**](EmployeesApi.md#failedImport) | **GET** /v2/employee/file/imports/failed/{fileID} | Fetch URL to download a failed import -[**fetchDocuments()**](EmployeesApi.md#fetchDocuments) | **GET** /v2/employee/documents/all | Fetch all documents -[**fetchDynamicVouchers()**](EmployeesApi.md#fetchDynamicVouchers) | **GET** /v2/employee/dynamicVouchers/all | Fetch all dynamic vouchers -[**fetchEmployeeStaticVoucherCampaignGroups()**](EmployeesApi.md#fetchEmployeeStaticVoucherCampaignGroups) | **GET** /v2/employee/staticVoucherCampaignGroups/all | Fetch static voucher campaign groups -[**fetchEmployeeStaticVoucherCampaigns()**](EmployeesApi.md#fetchEmployeeStaticVoucherCampaigns) | **GET** /v2/employee/staticVoucherCampaigns/all | Fetch static voucher campaigns -[**fetchMediaFiles()**](EmployeesApi.md#fetchMediaFiles) | **GET** /v2/employee/mediaFiles/all | Fetch all media files -[**fetchMerchant()**](EmployeesApi.md#fetchMerchant) | **GET** /v2/employee/merchant | Create employee alert -[**fetchMessages()**](EmployeesApi.md#fetchMessages) | **GET** /v2/employee/messages/all | Fetch all messages -[**fetchOptInListSource()**](EmployeesApi.md#fetchOptInListSource) | **GET** /v2/employee/optInListSource/{sourceID} | Fetch opt in list source -[**fetchOptInListSourcesCreatedByEmployee()**](EmployeesApi.md#fetchOptInListSourcesCreatedByEmployee) | **GET** /v2/employee/optInListSources/all | Fetch all opt in list sources -[**fetchPeerActivity()**](EmployeesApi.md#fetchPeerActivity) | **GET** /v2/employee/peer/activity/{employeeID} | Fetch peer activity -[**fetchPeersPermissions()**](EmployeesApi.md#fetchPeersPermissions) | **GET** /v2/employee/peer/permissions/{userID} | Fetch peer permissions -[**fetchProfileInfo()**](EmployeesApi.md#fetchProfileInfo) | **GET** /v2/employee | Retrieve employee's webpages -[**importClubMembers()**](EmployeesApi.md#importClubMembers) | **POST** /v2/employee/import/members | Import club members -[**importMerchantCredits()**](EmployeesApi.md#importMerchantCredits) | **POST** /v2/employee/import/merchantCredits | Import merchant credits -[**loadWebpagesOfEmployee()**](EmployeesApi.md#loadWebpagesOfEmployee) | **GET** /v2/employee/webpages/all | Retrieve employee's webpages -[**modifyPeersRoles()**](EmployeesApi.md#modifyPeersRoles) | **PUT** /v2/employee/peer/permissions/{userID} | Modify peer's roles -[**presignFile()**](EmployeesApi.md#presignFile) | **POST** /v2/employee/file/presign | Presign file for upload -[**removePeerFromAllRoles()**](EmployeesApi.md#removePeerFromAllRoles) | **DELETE** /v2/employee/peer/permissions/{userID} | Remove peer from all roles -[**scheduleAdvertisementCredit()**](EmployeesApi.md#scheduleAdvertisementCredit) | **POST** /v2/employee/sms/schedule/adCredit/{advertisementCreditID} | Schedule Ad Credit -[**scheduleDynamicVoucher()**](EmployeesApi.md#scheduleDynamicVoucher) | **POST** /v2/employee/sms/schedule/dynamicVoucher/{dynamicVoucherID} | Schedule Dynamic Voucher to list -[**scheduleDynamicVoucherToRecipient()**](EmployeesApi.md#scheduleDynamicVoucherToRecipient) | **POST** /v2/employee/sms/schedule/recipient/dynamicVoucher/{dynamicVoucherID} | Schedule Dyanamic Voucher to recipient -[**scheduleSimpleSMS()**](EmployeesApi.md#scheduleSimpleSMS) | **POST** /v2/employee/sms/schedule/simple | Schedule Simple SMS broadcast to list -[**scheduleSimpleSMSToRecipient()**](EmployeesApi.md#scheduleSimpleSMSToRecipient) | **POST** /v2/employee/sms/schedule/recipient/simple | Schedule Simple SMS broadcast to recipient -[**sendHelpDeskResponse()**](EmployeesApi.md#sendHelpDeskResponse) | **POST** /v2/employee/helpDesk/response | Send help desk response -[**sendSmsCampaignBroadcast()**](EmployeesApi.md#sendSmsCampaignBroadcast) | **POST** /v2/employee/sms/schedule/campaign/{staticVoucherCampaignID} | Schedule SMS Campaign Broadcast -[**setAlertsRead()**](EmployeesApi.md#setAlertsRead) | **PATCH** /v2/employee/alerts | Mark alerts as read -[**setExportDataFilesRead()**](EmployeesApi.md#setExportDataFilesRead) | **PUT** /v2/employee/export/dataFiles | Mark export data files as read -[**setHelpDeskRequestResolved()**](EmployeesApi.md#setHelpDeskRequestResolved) | **PATCH** /v2/employee/helpDesk/request/{helpDeskRequestID} | Resolve help desk request -[**setMessagesRead()**](EmployeesApi.md#setMessagesRead) | **PATCH** /v2/employee/messages | Mark messages as read -[**setProfilePicture()**](EmployeesApi.md#setProfilePicture) | **PUT** /v2/employee/profile/picture | Set profile picture -[**updateClubMembers()**](EmployeesApi.md#updateClubMembers) | **PUT** /v2/employee/update/members | Update club members -[**updateEmailNotificationPreference()**](EmployeesApi.md#updateEmailNotificationPreference) | **PUT** /v2/employee/emailNotificationPreference | Changes the employee's email notification preference to enabled or disabled -[**updateEmployeePeer()**](EmployeesApi.md#updateEmployeePeer) | **PUT** /v2/employee/peer/{userID} | Update peer +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**addPeerToRoles()**](EmployeesApi.md#addPeerToRoles) | **POST** /v2/employee/roles/peer/{userID} | Add peer to roles | +| [**createDocument()**](EmployeesApi.md#createDocument) | **POST** /v2/employee/document | Create document | +| [**createEmployeePeer()**](EmployeesApi.md#createEmployeePeer) | **POST** /v2/employee/peer | Create employee peer | +| [**createFile()**](EmployeesApi.md#createFile) | **POST** /v2/employee/file/create | Create file | +| [**createMediaFile()**](EmployeesApi.md#createMediaFile) | **POST** /v2/employee/mediaFile | Create media file | +| [**createStaticVoucherCampaignsGroup()**](EmployeesApi.md#createStaticVoucherCampaignsGroup) | **POST** /v2/employee/staticVoucherCampaignsGroup | Create static voucher campaign group | +| [**deleteDocument()**](EmployeesApi.md#deleteDocument) | **DELETE** /v2/employee/document/{documentID} | Delete document | +| [**deleteMediaFile()**](EmployeesApi.md#deleteMediaFile) | **DELETE** /v2/employee/mediaFile/{mediaFileID} | Delete media file | +| [**downloadFile()**](EmployeesApi.md#downloadFile) | **GET** /v2/employee/file/download/{fileID} | Fetch URL for file download | +| [**exportClubMembers()**](EmployeesApi.md#exportClubMembers) | **PUT** /v2/employee/export/members | Export club members | +| [**exportMerchantCredits()**](EmployeesApi.md#exportMerchantCredits) | **PUT** /v2/employee/export/merchantCredits | Export merchant credits | +| [**exportStaticVoucherCampaign()**](EmployeesApi.md#exportStaticVoucherCampaign) | **PUT** /v2/employee/export/staticVoucherCampaign/{campaignID} | Export static voucher campaign | +| [**failedImport()**](EmployeesApi.md#failedImport) | **GET** /v2/employee/file/imports/failed/{fileID} | Fetch URL to download a failed import | +| [**fetchDocuments()**](EmployeesApi.md#fetchDocuments) | **GET** /v2/employee/documents/all | Fetch all documents | +| [**fetchDynamicVouchers()**](EmployeesApi.md#fetchDynamicVouchers) | **GET** /v2/employee/dynamicVouchers/all | Fetch all dynamic vouchers | +| [**fetchEmployeeStaticVoucherCampaignGroups()**](EmployeesApi.md#fetchEmployeeStaticVoucherCampaignGroups) | **GET** /v2/employee/staticVoucherCampaignGroups/all | Fetch static voucher campaign groups | +| [**fetchEmployeeStaticVoucherCampaigns()**](EmployeesApi.md#fetchEmployeeStaticVoucherCampaigns) | **GET** /v2/employee/staticVoucherCampaigns/all | Fetch static voucher campaigns | +| [**fetchMediaFiles()**](EmployeesApi.md#fetchMediaFiles) | **GET** /v2/employee/mediaFiles/all | Fetch all media files | +| [**fetchMerchant()**](EmployeesApi.md#fetchMerchant) | **GET** /v2/employee/merchant | Create employee alert | +| [**fetchMessages()**](EmployeesApi.md#fetchMessages) | **GET** /v2/employee/messages/all | Fetch all messages | +| [**fetchOptInListSource()**](EmployeesApi.md#fetchOptInListSource) | **GET** /v2/employee/optInListSource/{sourceID} | Fetch opt in list source | +| [**fetchOptInListSourcesCreatedByEmployee()**](EmployeesApi.md#fetchOptInListSourcesCreatedByEmployee) | **GET** /v2/employee/optInListSources/all | Fetch all opt in list sources | +| [**fetchPeerActivity()**](EmployeesApi.md#fetchPeerActivity) | **GET** /v2/employee/peer/activity/{employeeID} | Fetch peer activity | +| [**fetchPeersPermissions()**](EmployeesApi.md#fetchPeersPermissions) | **GET** /v2/employee/peer/permissions/{userID} | Fetch peer permissions | +| [**fetchProfileInfo()**](EmployeesApi.md#fetchProfileInfo) | **GET** /v2/employee | Retrieve employee's webpages | +| [**importClubMembers()**](EmployeesApi.md#importClubMembers) | **POST** /v2/employee/import/members | Import club members | +| [**importMerchantCredits()**](EmployeesApi.md#importMerchantCredits) | **POST** /v2/employee/import/merchantCredits | Import merchant credits | +| [**loadWebpagesOfEmployee()**](EmployeesApi.md#loadWebpagesOfEmployee) | **GET** /v2/employee/webpages/all | Retrieve employee's webpages | +| [**modifyPeersRoles()**](EmployeesApi.md#modifyPeersRoles) | **PUT** /v2/employee/peer/permissions/{userID} | Modify peer's roles | +| [**presignFile()**](EmployeesApi.md#presignFile) | **POST** /v2/employee/file/presign | Presign file for upload | +| [**removePeerFromAllRoles()**](EmployeesApi.md#removePeerFromAllRoles) | **DELETE** /v2/employee/peer/permissions/{userID} | Remove peer from all roles | +| [**scheduleAdvertisementCredit()**](EmployeesApi.md#scheduleAdvertisementCredit) | **POST** /v2/employee/sms/schedule/adCredit/{advertisementCreditID} | Schedule Ad Credit | +| [**scheduleDynamicVoucher()**](EmployeesApi.md#scheduleDynamicVoucher) | **POST** /v2/employee/sms/schedule/dynamicVoucher/{dynamicVoucherID} | Schedule Dynamic Voucher to list | +| [**scheduleDynamicVoucherToRecipient()**](EmployeesApi.md#scheduleDynamicVoucherToRecipient) | **POST** /v2/employee/sms/schedule/recipient/dynamicVoucher/{dynamicVoucherID} | Schedule Dyanamic Voucher to recipient | +| [**scheduleSimpleSMS()**](EmployeesApi.md#scheduleSimpleSMS) | **POST** /v2/employee/sms/schedule/simple | Schedule Simple SMS broadcast to list | +| [**scheduleSimpleSMSToRecipient()**](EmployeesApi.md#scheduleSimpleSMSToRecipient) | **POST** /v2/employee/sms/schedule/recipient/simple | Schedule Simple SMS broadcast to recipient | +| [**sendHelpDeskResponse()**](EmployeesApi.md#sendHelpDeskResponse) | **POST** /v2/employee/helpDesk/response | Send help desk response | +| [**sendSmsCampaignBroadcast()**](EmployeesApi.md#sendSmsCampaignBroadcast) | **POST** /v2/employee/sms/schedule/campaign/{staticVoucherCampaignID} | Schedule SMS Campaign Broadcast | +| [**setAlertsRead()**](EmployeesApi.md#setAlertsRead) | **PATCH** /v2/employee/alerts | Mark alerts as read | +| [**setExportDataFilesRead()**](EmployeesApi.md#setExportDataFilesRead) | **PUT** /v2/employee/export/dataFiles | Mark export data files as read | +| [**setHelpDeskRequestResolved()**](EmployeesApi.md#setHelpDeskRequestResolved) | **PATCH** /v2/employee/helpDesk/request/{helpDeskRequestID} | Resolve help desk request | +| [**setMessagesRead()**](EmployeesApi.md#setMessagesRead) | **PATCH** /v2/employee/messages | Mark messages as read | +| [**setProfilePicture()**](EmployeesApi.md#setProfilePicture) | **PUT** /v2/employee/profile/picture | Set profile picture | +| [**updateClubMembers()**](EmployeesApi.md#updateClubMembers) | **PUT** /v2/employee/update/members | Update club members | +| [**updateEmailNotificationPreference()**](EmployeesApi.md#updateEmailNotificationPreference) | **PUT** /v2/employee/emailNotificationPreference | Changes the employee's email notification preference to enabled or disabled | +| [**updateEmployeePeer()**](EmployeesApi.md#updateEmployeePeer) | **PUT** /v2/employee/peer/{userID} | Update peer | ## `addPeerToRoles()` @@ -86,10 +86,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | [**mixed**](../Model/.md)| | - **wt_employee_peer_roles** | [**\OpenAPI\Client\Model\WTEmployeePeerRoles**](../Model/WTEmployeePeerRoles.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user_id** | [**mixed**](../Model/.md)| | | +| **wt_employee_peer_roles** | [**\OpenAPI\Client\Model\WTEmployeePeerRoles**](../Model/WTEmployeePeerRoles.md)| | | ### Return type @@ -141,9 +141,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_create_document** | [**\OpenAPI\Client\Model\WTEmployeeCreateDocument**](../Model/WTEmployeeCreateDocument.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_create_document** | [**\OpenAPI\Client\Model\WTEmployeeCreateDocument**](../Model/WTEmployeeCreateDocument.md)| | | ### Return type @@ -195,9 +195,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_create** | [**\OpenAPI\Client\Model\WTEmployeeCreate**](../Model/WTEmployeeCreate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_create** | [**\OpenAPI\Client\Model\WTEmployeeCreate**](../Model/WTEmployeeCreate.md)| | | ### Return type @@ -219,7 +219,7 @@ No authorization required ## `createFile()` ```php -createFile($wt_employee_file_create): \OpenAPI\Client\Model\InlineResponse2001 +createFile($wt_employee_file_create): \OpenAPI\Client\Model\CreateFile200Response ``` Create file @@ -249,13 +249,13 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_file_create** | [**\OpenAPI\Client\Model\WTEmployeeFileCreate**](../Model/WTEmployeeFileCreate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_file_create** | [**\OpenAPI\Client\Model\WTEmployeeFileCreate**](../Model/WTEmployeeFileCreate.md)| | | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2001**](../Model/InlineResponse2001.md) +[**\OpenAPI\Client\Model\CreateFile200Response**](../Model/CreateFile200Response.md) ### Authorization @@ -303,9 +303,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_create_media_file** | [**\OpenAPI\Client\Model\WTEmployeeCreateMediaFile**](../Model/WTEmployeeCreateMediaFile.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_create_media_file** | [**\OpenAPI\Client\Model\WTEmployeeCreateMediaFile**](../Model/WTEmployeeCreateMediaFile.md)| | | ### Return type @@ -357,9 +357,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_create_static_voucher_campaign_group** | [**\OpenAPI\Client\Model\WTEmployeeCreateStaticVoucherCampaignGroup**](../Model/WTEmployeeCreateStaticVoucherCampaignGroup.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_create_static_voucher_campaign_group** | [**\OpenAPI\Client\Model\WTEmployeeCreateStaticVoucherCampaignGroup**](../Model/WTEmployeeCreateStaticVoucherCampaignGroup.md)| | | ### Return type @@ -411,9 +411,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **document_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **document_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -465,9 +465,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **media_file_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **media_file_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -519,9 +519,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file_id** | **string**| | | ### Return type @@ -675,9 +675,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -729,9 +729,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file_id** | **string**| | | ### Return type @@ -783,9 +783,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **folder** | **string**| | [optional] | ### Return type @@ -837,9 +837,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -931,7 +931,7 @@ $apiInstance = new OpenAPI\Client\Api\EmployeesApi( new GuzzleHttp\Client() ); $is_archive_included = True; // bool -$source_id = 3.4; // double +$source_id = 3.4; // float try { $result = $apiInstance->fetchEmployeeStaticVoucherCampaigns($is_archive_included, $source_id); @@ -943,10 +943,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] - **source_id** | **double**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | +| **source_id** | **float**| | [optional] | ### Return type @@ -998,9 +998,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **folder** | **string**| | [optional] | ### Return type @@ -1154,9 +1154,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **source_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **source_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -1259,9 +1259,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **employee_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **employee_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -1313,9 +1313,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -1418,9 +1418,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_import_records** | [**\OpenAPI\Client\Model\WTEmployeeImportRecords**](../Model/WTEmployeeImportRecords.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_import_records** | [**\OpenAPI\Client\Model\WTEmployeeImportRecords**](../Model/WTEmployeeImportRecords.md)| | | ### Return type @@ -1472,9 +1472,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_import_records** | [**\OpenAPI\Client\Model\WTEmployeeImportRecords**](../Model/WTEmployeeImportRecords.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_import_records** | [**\OpenAPI\Client\Model\WTEmployeeImportRecords**](../Model/WTEmployeeImportRecords.md)| | | ### Return type @@ -1578,10 +1578,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | [**mixed**](../Model/.md)| | - **wt_employee_peer_roles** | [**\OpenAPI\Client\Model\WTEmployeePeerRoles**](../Model/WTEmployeePeerRoles.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user_id** | [**mixed**](../Model/.md)| | | +| **wt_employee_peer_roles** | [**\OpenAPI\Client\Model\WTEmployeePeerRoles**](../Model/WTEmployeePeerRoles.md)| | | ### Return type @@ -1633,9 +1633,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_s3_file_presign** | [**\OpenAPI\Client\Model\WTEmployeeS3FilePresign**](../Model/WTEmployeeS3FilePresign.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_s3_file_presign** | [**\OpenAPI\Client\Model\WTEmployeeS3FilePresign**](../Model/WTEmployeeS3FilePresign.md)| | | ### Return type @@ -1687,9 +1687,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -1742,10 +1742,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **advertisement_credit_id** | [**mixed**](../Model/.md)| | - **wt_employee_schedule_simple_sms** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS**](../Model/WTEmployeeScheduleSimpleSMS.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **advertisement_credit_id** | [**mixed**](../Model/.md)| | | +| **wt_employee_schedule_simple_sms** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS**](../Model/WTEmployeeScheduleSimpleSMS.md)| | | ### Return type @@ -1798,10 +1798,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **dynamic_voucher_id** | [**mixed**](../Model/.md)| | - **wt_employee_schedule_simple_sms** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS**](../Model/WTEmployeeScheduleSimpleSMS.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **dynamic_voucher_id** | [**mixed**](../Model/.md)| | | +| **wt_employee_schedule_simple_sms** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS**](../Model/WTEmployeeScheduleSimpleSMS.md)| | | ### Return type @@ -1854,10 +1854,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **dynamic_voucher_id** | [**mixed**](../Model/.md)| | - **wt_employee_schedule_simple_smsto_recipient** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient**](../Model/WTEmployeeScheduleSimpleSMSToRecipient.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **dynamic_voucher_id** | [**mixed**](../Model/.md)| | | +| **wt_employee_schedule_simple_smsto_recipient** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient**](../Model/WTEmployeeScheduleSimpleSMSToRecipient.md)| | | ### Return type @@ -1879,7 +1879,7 @@ No authorization required ## `scheduleSimpleSMS()` ```php -scheduleSimpleSMS($wt_employee_schedule_simple_sms): \OpenAPI\Client\Model\SimpleSMSBroadcast +scheduleSimpleSMS($wt_employee_schedule_simple_sms): bool ``` Schedule Simple SMS broadcast to list @@ -1909,13 +1909,13 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_schedule_simple_sms** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS**](../Model/WTEmployeeScheduleSimpleSMS.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_schedule_simple_sms** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS**](../Model/WTEmployeeScheduleSimpleSMS.md)| | | ### Return type -[**\OpenAPI\Client\Model\SimpleSMSBroadcast**](../Model/SimpleSMSBroadcast.md) +**bool** ### Authorization @@ -1933,7 +1933,7 @@ No authorization required ## `scheduleSimpleSMSToRecipient()` ```php -scheduleSimpleSMSToRecipient($wt_employee_schedule_simple_smsto_recipient): \OpenAPI\Client\Model\SimpleSMSBroadcast +scheduleSimpleSMSToRecipient($wt_employee_schedule_simple_smsto_recipient): bool ``` Schedule Simple SMS broadcast to recipient @@ -1963,13 +1963,13 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_schedule_simple_smsto_recipient** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient**](../Model/WTEmployeeScheduleSimpleSMSToRecipient.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_schedule_simple_smsto_recipient** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient**](../Model/WTEmployeeScheduleSimpleSMSToRecipient.md)| | | ### Return type -[**\OpenAPI\Client\Model\SimpleSMSBroadcast**](../Model/SimpleSMSBroadcast.md) +**bool** ### Authorization @@ -2017,9 +2017,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_send_help_desk_response** | [**\OpenAPI\Client\Model\WTEmployeeSendHelpDeskResponse**](../Model/WTEmployeeSendHelpDeskResponse.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_send_help_desk_response** | [**\OpenAPI\Client\Model\WTEmployeeSendHelpDeskResponse**](../Model/WTEmployeeSendHelpDeskResponse.md)| | | ### Return type @@ -2072,10 +2072,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **static_voucher_campaign_id** | [**mixed**](../Model/.md)| | - **wt_employee_schedule_sms_campaign_broadcast** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSMSCampaignBroadcast**](../Model/WTEmployeeScheduleSMSCampaignBroadcast.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **static_voucher_campaign_id** | [**mixed**](../Model/.md)| | | +| **wt_employee_schedule_sms_campaign_broadcast** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSMSCampaignBroadcast**](../Model/WTEmployeeScheduleSMSCampaignBroadcast.md)| | | ### Return type @@ -2229,9 +2229,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **help_desk_request_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **help_desk_request_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -2334,9 +2334,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_create_media_file** | [**\OpenAPI\Client\Model\WTEmployeeCreateMediaFile**](../Model/WTEmployeeCreateMediaFile.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_create_media_file** | [**\OpenAPI\Client\Model\WTEmployeeCreateMediaFile**](../Model/WTEmployeeCreateMediaFile.md)| | | ### Return type @@ -2388,9 +2388,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_employee_update_records** | [**\OpenAPI\Client\Model\WTEmployeeUpdateRecords**](../Model/WTEmployeeUpdateRecords.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_employee_update_records** | [**\OpenAPI\Client\Model\WTEmployeeUpdateRecords**](../Model/WTEmployeeUpdateRecords.md)| | | ### Return type @@ -2412,7 +2412,7 @@ No authorization required ## `updateEmailNotificationPreference()` ```php -updateEmailNotificationPreference($inline_object): \OpenAPI\Client\Model\Employee +updateEmailNotificationPreference($update_email_notification_preference_request): \OpenAPI\Client\Model\Employee ``` Changes the employee's email notification preference to enabled or disabled @@ -2430,10 +2430,10 @@ $apiInstance = new OpenAPI\Client\Api\EmployeesApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$inline_object = new \OpenAPI\Client\Model\InlineObject(); // \OpenAPI\Client\Model\InlineObject +$update_email_notification_preference_request = new \OpenAPI\Client\Model\UpdateEmailNotificationPreferenceRequest(); // \OpenAPI\Client\Model\UpdateEmailNotificationPreferenceRequest try { - $result = $apiInstance->updateEmailNotificationPreference($inline_object); + $result = $apiInstance->updateEmailNotificationPreference($update_email_notification_preference_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling EmployeesApi->updateEmailNotificationPreference: ', $e->getMessage(), PHP_EOL; @@ -2442,9 +2442,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **inline_object** | [**\OpenAPI\Client\Model\InlineObject**](../Model/InlineObject.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **update_email_notification_preference_request** | [**\OpenAPI\Client\Model\UpdateEmailNotificationPreferenceRequest**](../Model/UpdateEmailNotificationPreferenceRequest.md)| | | ### Return type @@ -2497,10 +2497,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_id** | **string**| | - **wt_employee_update** | [**\OpenAPI\Client\Model\WTEmployeeUpdate**](../Model/WTEmployeeUpdate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user_id** | **string**| | | +| **wt_employee_update** | [**\OpenAPI\Client\Model\WTEmployeeUpdate**](../Model/WTEmployeeUpdate.md)| | | ### Return type diff --git a/docs/Api/GamingApi.md b/docs/Api/GamingApi.md index 9a97aad..ce36585 100644 --- a/docs/Api/GamingApi.md +++ b/docs/Api/GamingApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\GamingApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveGaming()**](GamingApi.md#archiveGaming) | **DELETE** /v2/gaming/{id} | Archive gaming -[**createGaming()**](GamingApi.md#createGaming) | **POST** /v2/gaming | Create gaming -[**fetchAllGaming()**](GamingApi.md#fetchAllGaming) | **GET** /v2/gaming/all | Fetch all gaming -[**restoreGaming()**](GamingApi.md#restoreGaming) | **PATCH** /v2/gaming/{id} | Restore gaming -[**updateGaming()**](GamingApi.md#updateGaming) | **PUT** /v2/gaming/{id} | Update gaming +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveGaming()**](GamingApi.md#archiveGaming) | **DELETE** /v2/gaming/{id} | Archive gaming | +| [**createGaming()**](GamingApi.md#createGaming) | **POST** /v2/gaming | Create gaming | +| [**fetchAllGaming()**](GamingApi.md#fetchAllGaming) | **GET** /v2/gaming/all | Fetch all gaming | +| [**restoreGaming()**](GamingApi.md#restoreGaming) | **PATCH** /v2/gaming/{id} | Restore gaming | +| [**updateGaming()**](GamingApi.md#updateGaming) | **PUT** /v2/gaming/{id} | Update gaming | ## `archiveGaming()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_gaming_create_params** | [**\OpenAPI\Client\Model\WTGamingCreateParams**](../Model/WTGamingCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_gaming_create_params** | [**\OpenAPI\Client\Model\WTGamingCreateParams**](../Model/WTGamingCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_gaming_update_params** | [**\OpenAPI\Client\Model\WTGamingUpdateParams**](../Model/WTGamingUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_gaming_update_params** | [**\OpenAPI\Client\Model\WTGamingUpdateParams**](../Model/WTGamingUpdateParams.md)| | | ### Return type diff --git a/docs/Api/ImageGridApi.md b/docs/Api/ImageGridApi.md index 80b200a..3944280 100644 --- a/docs/Api/ImageGridApi.md +++ b/docs/Api/ImageGridApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\ImageGridApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveImageGrid()**](ImageGridApi.md#archiveImageGrid) | **DELETE** /v2/imageGrid/{id} | Archive image -[**createImageGrid()**](ImageGridApi.md#createImageGrid) | **POST** /v2/imageGrid | Create image -[**fetchAllImageGrid()**](ImageGridApi.md#fetchAllImageGrid) | **GET** /v2/imageGrid/all | Fetch all images -[**restoreImageGrid()**](ImageGridApi.md#restoreImageGrid) | **PATCH** /v2/imageGrid/{id} | Restore image -[**updateImageGrid()**](ImageGridApi.md#updateImageGrid) | **PUT** /v2/imageGrid/{id} | Update image +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveImageGrid()**](ImageGridApi.md#archiveImageGrid) | **DELETE** /v2/imageGrid/{id} | Archive image | +| [**createImageGrid()**](ImageGridApi.md#createImageGrid) | **POST** /v2/imageGrid | Create image | +| [**fetchAllImageGrid()**](ImageGridApi.md#fetchAllImageGrid) | **GET** /v2/imageGrid/all | Fetch all images | +| [**restoreImageGrid()**](ImageGridApi.md#restoreImageGrid) | **PATCH** /v2/imageGrid/{id} | Restore image | +| [**updateImageGrid()**](ImageGridApi.md#updateImageGrid) | **PUT** /v2/imageGrid/{id} | Update image | ## `archiveImageGrid()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_image_grid_create_params** | [**\OpenAPI\Client\Model\WTImageGridCreateParams**](../Model/WTImageGridCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_image_grid_create_params** | [**\OpenAPI\Client\Model\WTImageGridCreateParams**](../Model/WTImageGridCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_image_grid_update_params** | [**\OpenAPI\Client\Model\WTImageGridUpdateParams**](../Model/WTImageGridUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_image_grid_update_params** | [**\OpenAPI\Client\Model\WTImageGridUpdateParams**](../Model/WTImageGridUpdateParams.md)| | | ### Return type diff --git a/docs/Api/IndustriesApi.md b/docs/Api/IndustriesApi.md index 6faa83f..010b2a5 100644 --- a/docs/Api/IndustriesApi.md +++ b/docs/Api/IndustriesApi.md @@ -1,18 +1,18 @@ # OpenAPI\Client\IndustriesApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchAllIndustries()**](IndustriesApi.md#fetchAllIndustries) | **GET** /system/industries/all | Fetch all industries -[**fetchDomainsByIndustry()**](IndustriesApi.md#fetchDomainsByIndustry) | **GET** /system/industries/domains | Fetch all industries -[**fetchIndustriesIDs()**](IndustriesApi.md#fetchIndustriesIDs) | **GET** /system/industries/trimmed | Fetch all industries +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchAllIndustries()**](IndustriesApi.md#fetchAllIndustries) | **GET** /system/industries/all | Fetch all industries | +| [**fetchDomainsByIndustry()**](IndustriesApi.md#fetchDomainsByIndustry) | **GET** /system/industries/domains | Fetch all industries | +| [**fetchIndustriesIDs()**](IndustriesApi.md#fetchIndustriesIDs) | **GET** /system/industries/trimmed | Fetch all industries | ## `fetchAllIndustries()` ```php -fetchAllIndustries(): \OpenAPI\Client\Model\InlineResponse200[] +fetchAllIndustries(): \OpenAPI\Client\Model\FetchIndustry200Response[] ``` Fetch all industries @@ -45,7 +45,7 @@ This endpoint does not need any parameter. ### Return type -[**\OpenAPI\Client\Model\InlineResponse200[]**](../Model/InlineResponse200.md) +[**\OpenAPI\Client\Model\FetchIndustry200Response[]**](../Model/FetchIndustry200Response.md) ### Authorization @@ -63,7 +63,7 @@ No authorization required ## `fetchDomainsByIndustry()` ```php -fetchDomainsByIndustry(): \OpenAPI\Client\Model\InlineResponse20012 +fetchDomainsByIndustry(): \OpenAPI\Client\Model\FetchDomainsByIndustry200Response ``` Fetch all industries @@ -96,7 +96,7 @@ This endpoint does not need any parameter. ### Return type -[**\OpenAPI\Client\Model\InlineResponse20012**](../Model/InlineResponse20012.md) +[**\OpenAPI\Client\Model\FetchDomainsByIndustry200Response**](../Model/FetchDomainsByIndustry200Response.md) ### Authorization diff --git a/docs/Api/InfoGenesisReportsApi.md b/docs/Api/InfoGenesisReportsApi.md index fa0822e..4b26a78 100644 --- a/docs/Api/InfoGenesisReportsApi.md +++ b/docs/Api/InfoGenesisReportsApi.md @@ -1,36 +1,36 @@ # OpenAPI\Client\InfoGenesisReportsApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**countAdCreditsRedemptions()**](InfoGenesisReportsApi.md#countAdCreditsRedemptions) | **POST** /v2/pos/infogenesis/count/adCredits/redemptions | Count redeemed ad credits -[**countAdCreditsRefunds()**](InfoGenesisReportsApi.md#countAdCreditsRefunds) | **POST** /v2/pos/infogenesis/count/adCredits/refunds | Count refunded ad credits -[**countDynamicVoucherRedemptions()**](InfoGenesisReportsApi.md#countDynamicVoucherRedemptions) | **POST** /v2/pos/infogenesis/count/dynamicVoucher/redemptions | Count dynamic voucher redemptions -[**countDynamicVoucherRefunds()**](InfoGenesisReportsApi.md#countDynamicVoucherRefunds) | **POST** /v2/pos/infogenesis/count/dynamicVoucher/refunds | Count dynamic voucher refunds -[**countMembershipPointsRedemptions()**](InfoGenesisReportsApi.md#countMembershipPointsRedemptions) | **POST** /v2/pos/infogenesis/count/membershipPoints/redemptions | Count redeemed membership points -[**countMembershipPointsRefunds()**](InfoGenesisReportsApi.md#countMembershipPointsRefunds) | **POST** /v2/pos/infogenesis/count/membershipPoints/refunds | Count refunded membership points -[**countMembershipTierRedemptions()**](InfoGenesisReportsApi.md#countMembershipTierRedemptions) | **POST** /v2/pos/infogenesis/count/membershipTier/redemptions | Count tier redemptions -[**countMembershipTierRefunds()**](InfoGenesisReportsApi.md#countMembershipTierRefunds) | **POST** /v2/pos/infogenesis/count/membershipTier/refunds | Count tier refunds -[**countMerchantCreditRedemptions()**](InfoGenesisReportsApi.md#countMerchantCreditRedemptions) | **POST** /v2/pos/infogenesis/count/merchantCredit/redemptions | Count redeemed merchant credits -[**countMerchantCreditRefunds()**](InfoGenesisReportsApi.md#countMerchantCreditRefunds) | **POST** /v2/pos/infogenesis/count/merchantCredit/refunds | Count refunded merchant credits -[**countStaticVoucherRedemptions()**](InfoGenesisReportsApi.md#countStaticVoucherRedemptions) | **POST** /v2/pos/infogenesis/count/staticVoucher/redemptions | Count static voucher redemptions -[**countStaticVoucherRefunds()**](InfoGenesisReportsApi.md#countStaticVoucherRefunds) | **POST** /v2/pos/infogenesis/count/staticVoucher/refunds | Count static voucher refunds -[**fetchInfoGenesisAuthorizations()**](InfoGenesisReportsApi.md#fetchInfoGenesisAuthorizations) | **POST** /v2/pos/infogenesis/authorizations | Fetch InfoGenesis authorizations -[**fetchInfoGenesisCampaignData()**](InfoGenesisReportsApi.md#fetchInfoGenesisCampaignData) | **POST** /v2/pos/infogenesis/campaign | Fetch campaign information -[**fetchInfoGenesisLookupRequests()**](InfoGenesisReportsApi.md#fetchInfoGenesisLookupRequests) | **POST** /v2/pos/infogenesis/requests/lookup | Fetch InfoGenesis lookup requests -[**fetchInfoGenesisLookupRequestsErrors()**](InfoGenesisReportsApi.md#fetchInfoGenesisLookupRequestsErrors) | **POST** /v2/pos/infogenesis/requests/lookup/errors | Fetch InfoGenesis lookup request errors -[**fetchInfoGenesisRedeemedStaticVouchers()**](InfoGenesisReportsApi.md#fetchInfoGenesisRedeemedStaticVouchers) | **POST** /v2/pos/infogenesis/staticVouchers/redeemed | Fetch redeemed static vouchers -[**fetchInfoGenesisRedeemedUniquePostingIDs()**](InfoGenesisReportsApi.md#fetchInfoGenesisRedeemedUniquePostingIDs) | **GET** /v2/pos/infogenesis/postingIDs/redeemed | Fetch redeemed InfoGenesis unique posting IDs -[**fetchInfoGenesisRedemptions()**](InfoGenesisReportsApi.md#fetchInfoGenesisRedemptions) | **POST** /v2/pos/infogenesis/redemptions | Fetch InfoGenesis redemptions -[**fetchInfoGenesisRefundedRoutingIDs()**](InfoGenesisReportsApi.md#fetchInfoGenesisRefundedRoutingIDs) | **POST** /v2/pos/infogenesis/routingIDs/refunded | Fetch refunded InfoGenesis unique posting IDs -[**fetchInfoGenesisRefundedStaticVouchers()**](InfoGenesisReportsApi.md#fetchInfoGenesisRefundedStaticVouchers) | **POST** /v2/pos/infogenesis/staticVouchers/refunded | Fetch refunded static vouchers -[**fetchInfoGenesisRefunds()**](InfoGenesisReportsApi.md#fetchInfoGenesisRefunds) | **POST** /v2/pos/infogenesis/refunds | Fetch InfoGenesis refunds -[**fetchInfoGenesisRequest()**](InfoGenesisReportsApi.md#fetchInfoGenesisRequest) | **GET** /v2/pos/infogenesis/request/{transactionID} | Fetch InfoGenesis request with transaction ID -[**fetchInfoGenesisRequests()**](InfoGenesisReportsApi.md#fetchInfoGenesisRequests) | **POST** /v2/pos/infogenesis/requests | Fetch InfoGenesis requests with routing IDs -[**fetchInfoGenesisResponseErrors()**](InfoGenesisReportsApi.md#fetchInfoGenesisResponseErrors) | **GET** /v2/pos/infogenesis/responses/errors | Fetch InfoGenesis response errors -[**fetchInfoGenesisResponses()**](InfoGenesisReportsApi.md#fetchInfoGenesisResponses) | **POST** /v2/pos/infogenesis/responses | Fetch InfoGenesis responses with routing IDs -[**fetchInfoGenesisTransactionsWithUniquePostingIDs()**](InfoGenesisReportsApi.md#fetchInfoGenesisTransactionsWithUniquePostingIDs) | **POST** /v2/pos/infogenesis/transactions | Fetch InfoGenesis transactions +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**countAdCreditsRedemptions()**](InfoGenesisReportsApi.md#countAdCreditsRedemptions) | **POST** /v2/pos/infogenesis/count/adCredits/redemptions | Count redeemed ad credits | +| [**countAdCreditsRefunds()**](InfoGenesisReportsApi.md#countAdCreditsRefunds) | **POST** /v2/pos/infogenesis/count/adCredits/refunds | Count refunded ad credits | +| [**countDynamicVoucherRedemptions()**](InfoGenesisReportsApi.md#countDynamicVoucherRedemptions) | **POST** /v2/pos/infogenesis/count/dynamicVoucher/redemptions | Count dynamic voucher redemptions | +| [**countDynamicVoucherRefunds()**](InfoGenesisReportsApi.md#countDynamicVoucherRefunds) | **POST** /v2/pos/infogenesis/count/dynamicVoucher/refunds | Count dynamic voucher refunds | +| [**countMembershipPointsRedemptions()**](InfoGenesisReportsApi.md#countMembershipPointsRedemptions) | **POST** /v2/pos/infogenesis/count/membershipPoints/redemptions | Count redeemed membership points | +| [**countMembershipPointsRefunds()**](InfoGenesisReportsApi.md#countMembershipPointsRefunds) | **POST** /v2/pos/infogenesis/count/membershipPoints/refunds | Count refunded membership points | +| [**countMembershipTierRedemptions()**](InfoGenesisReportsApi.md#countMembershipTierRedemptions) | **POST** /v2/pos/infogenesis/count/membershipTier/redemptions | Count tier redemptions | +| [**countMembershipTierRefunds()**](InfoGenesisReportsApi.md#countMembershipTierRefunds) | **POST** /v2/pos/infogenesis/count/membershipTier/refunds | Count tier refunds | +| [**countMerchantCreditRedemptions()**](InfoGenesisReportsApi.md#countMerchantCreditRedemptions) | **POST** /v2/pos/infogenesis/count/merchantCredit/redemptions | Count redeemed merchant credits | +| [**countMerchantCreditRefunds()**](InfoGenesisReportsApi.md#countMerchantCreditRefunds) | **POST** /v2/pos/infogenesis/count/merchantCredit/refunds | Count refunded merchant credits | +| [**countStaticVoucherRedemptions()**](InfoGenesisReportsApi.md#countStaticVoucherRedemptions) | **POST** /v2/pos/infogenesis/count/staticVoucher/redemptions | Count static voucher redemptions | +| [**countStaticVoucherRefunds()**](InfoGenesisReportsApi.md#countStaticVoucherRefunds) | **POST** /v2/pos/infogenesis/count/staticVoucher/refunds | Count static voucher refunds | +| [**fetchInfoGenesisAuthorizations()**](InfoGenesisReportsApi.md#fetchInfoGenesisAuthorizations) | **POST** /v2/pos/infogenesis/authorizations | Fetch InfoGenesis authorizations | +| [**fetchInfoGenesisCampaignData()**](InfoGenesisReportsApi.md#fetchInfoGenesisCampaignData) | **POST** /v2/pos/infogenesis/campaign | Fetch campaign information | +| [**fetchInfoGenesisLookupRequests()**](InfoGenesisReportsApi.md#fetchInfoGenesisLookupRequests) | **POST** /v2/pos/infogenesis/requests/lookup | Fetch InfoGenesis lookup requests | +| [**fetchInfoGenesisLookupRequestsErrors()**](InfoGenesisReportsApi.md#fetchInfoGenesisLookupRequestsErrors) | **POST** /v2/pos/infogenesis/requests/lookup/errors | Fetch InfoGenesis lookup request errors | +| [**fetchInfoGenesisRedeemedStaticVouchers()**](InfoGenesisReportsApi.md#fetchInfoGenesisRedeemedStaticVouchers) | **POST** /v2/pos/infogenesis/staticVouchers/redeemed | Fetch redeemed static vouchers | +| [**fetchInfoGenesisRedeemedUniquePostingIDs()**](InfoGenesisReportsApi.md#fetchInfoGenesisRedeemedUniquePostingIDs) | **GET** /v2/pos/infogenesis/postingIDs/redeemed | Fetch redeemed InfoGenesis unique posting IDs | +| [**fetchInfoGenesisRedemptions()**](InfoGenesisReportsApi.md#fetchInfoGenesisRedemptions) | **POST** /v2/pos/infogenesis/redemptions | Fetch InfoGenesis redemptions | +| [**fetchInfoGenesisRefundedRoutingIDs()**](InfoGenesisReportsApi.md#fetchInfoGenesisRefundedRoutingIDs) | **POST** /v2/pos/infogenesis/routingIDs/refunded | Fetch refunded InfoGenesis unique posting IDs | +| [**fetchInfoGenesisRefundedStaticVouchers()**](InfoGenesisReportsApi.md#fetchInfoGenesisRefundedStaticVouchers) | **POST** /v2/pos/infogenesis/staticVouchers/refunded | Fetch refunded static vouchers | +| [**fetchInfoGenesisRefunds()**](InfoGenesisReportsApi.md#fetchInfoGenesisRefunds) | **POST** /v2/pos/infogenesis/refunds | Fetch InfoGenesis refunds | +| [**fetchInfoGenesisRequest()**](InfoGenesisReportsApi.md#fetchInfoGenesisRequest) | **GET** /v2/pos/infogenesis/request/{transactionID} | Fetch InfoGenesis request with transaction ID | +| [**fetchInfoGenesisRequests()**](InfoGenesisReportsApi.md#fetchInfoGenesisRequests) | **POST** /v2/pos/infogenesis/requests | Fetch InfoGenesis requests with routing IDs | +| [**fetchInfoGenesisResponseErrors()**](InfoGenesisReportsApi.md#fetchInfoGenesisResponseErrors) | **GET** /v2/pos/infogenesis/responses/errors | Fetch InfoGenesis response errors | +| [**fetchInfoGenesisResponses()**](InfoGenesisReportsApi.md#fetchInfoGenesisResponses) | **POST** /v2/pos/infogenesis/responses | Fetch InfoGenesis responses with routing IDs | +| [**fetchInfoGenesisTransactionsWithUniquePostingIDs()**](InfoGenesisReportsApi.md#fetchInfoGenesisTransactionsWithUniquePostingIDs) | **POST** /v2/pos/infogenesis/transactions | Fetch InfoGenesis transactions | ## `countAdCreditsRedemptions()` @@ -66,9 +66,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -120,9 +120,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -174,9 +174,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -228,9 +228,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -282,9 +282,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -336,9 +336,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -390,9 +390,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -444,9 +444,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -498,9 +498,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -552,9 +552,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -606,9 +606,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -660,9 +660,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -714,9 +714,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -768,9 +768,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -822,9 +822,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -876,9 +876,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_lookup_request_errors** | [**\OpenAPI\Client\Model\WTInfoGenesisLookupRequestErrors**](../Model/WTInfoGenesisLookupRequestErrors.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_lookup_request_errors** | [**\OpenAPI\Client\Model\WTInfoGenesisLookupRequestErrors**](../Model/WTInfoGenesisLookupRequestErrors.md)| | | ### Return type @@ -930,9 +930,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_unique_posting_ids** | [**\OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs**](../Model/WTInfoGenesisUniquePostingIDs.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_unique_posting_ids** | [**\OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs**](../Model/WTInfoGenesisUniquePostingIDs.md)| | | ### Return type @@ -985,10 +985,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -1040,9 +1040,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -1095,10 +1095,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -1150,9 +1150,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_routing_ids** | [**\OpenAPI\Client\Model\WTInfoGenesisRoutingIDs**](../Model/WTInfoGenesisRoutingIDs.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_routing_ids** | [**\OpenAPI\Client\Model\WTInfoGenesisRoutingIDs**](../Model/WTInfoGenesisRoutingIDs.md)| | | ### Return type @@ -1204,9 +1204,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_record_filter_parameters** | [**\OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters**](../Model/WTInfoGenesisRecordFilterParameters.md)| | | ### Return type @@ -1258,9 +1258,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **transaction_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **transaction_id** | **string**| | | ### Return type @@ -1312,9 +1312,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_routing_ids** | [**\OpenAPI\Client\Model\WTInfoGenesisRoutingIDs**](../Model/WTInfoGenesisRoutingIDs.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_routing_ids** | [**\OpenAPI\Client\Model\WTInfoGenesisRoutingIDs**](../Model/WTInfoGenesisRoutingIDs.md)| | | ### Return type @@ -1367,10 +1367,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -1422,9 +1422,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_routing_ids** | [**\OpenAPI\Client\Model\WTInfoGenesisRoutingIDs**](../Model/WTInfoGenesisRoutingIDs.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_routing_ids** | [**\OpenAPI\Client\Model\WTInfoGenesisRoutingIDs**](../Model/WTInfoGenesisRoutingIDs.md)| | | ### Return type @@ -1476,9 +1476,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_info_genesis_unique_posting_ids** | [**\OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs**](../Model/WTInfoGenesisUniquePostingIDs.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_info_genesis_unique_posting_ids** | [**\OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs**](../Model/WTInfoGenesisUniquePostingIDs.md)| | | ### Return type diff --git a/docs/Api/IntegratedTerminalsApi.md b/docs/Api/IntegratedTerminalsApi.md index a588f8e..a7e0a18 100644 --- a/docs/Api/IntegratedTerminalsApi.md +++ b/docs/Api/IntegratedTerminalsApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\IntegratedTerminalsApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archivePOSMachine()**](IntegratedTerminalsApi.md#archivePOSMachine) | **DELETE** /v2/pos/machine/{id} | Archive POS machine -[**createPOSMachine()**](IntegratedTerminalsApi.md#createPOSMachine) | **POST** /v2/pos/machine | Create POS machine -[**fetchAllPOSMachines()**](IntegratedTerminalsApi.md#fetchAllPOSMachines) | **GET** /v2/pos/machine/all | Fetch all POS machines -[**restorePOSMachine()**](IntegratedTerminalsApi.md#restorePOSMachine) | **PATCH** /v2/pos/machine/{id} | Restore POS machine -[**updatePOSMachine()**](IntegratedTerminalsApi.md#updatePOSMachine) | **PUT** /v2/pos/machine/{id} | Update POS machine +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archivePOSMachine()**](IntegratedTerminalsApi.md#archivePOSMachine) | **DELETE** /v2/pos/machine/{id} | Archive POS machine | +| [**createPOSMachine()**](IntegratedTerminalsApi.md#createPOSMachine) | **POST** /v2/pos/machine | Create POS machine | +| [**fetchAllPOSMachines()**](IntegratedTerminalsApi.md#fetchAllPOSMachines) | **GET** /v2/pos/machine/all | Fetch all POS machines | +| [**restorePOSMachine()**](IntegratedTerminalsApi.md#restorePOSMachine) | **PATCH** /v2/pos/machine/{id} | Restore POS machine | +| [**updatePOSMachine()**](IntegratedTerminalsApi.md#updatePOSMachine) | **PUT** /v2/pos/machine/{id} | Update POS machine | ## `archivePOSMachine()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_pos_machine_create_params** | [**\OpenAPI\Client\Model\WTPosMachineCreateParams**](../Model/WTPosMachineCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_pos_machine_create_params** | [**\OpenAPI\Client\Model\WTPosMachineCreateParams**](../Model/WTPosMachineCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_pos_machine_update_params** | [**\OpenAPI\Client\Model\WTPosMachineUpdateParams**](../Model/WTPosMachineUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_pos_machine_update_params** | [**\OpenAPI\Client\Model\WTPosMachineUpdateParams**](../Model/WTPosMachineUpdateParams.md)| | | ### Return type diff --git a/docs/Api/InteractionsApi.md b/docs/Api/InteractionsApi.md index 1b1e980..732b282 100644 --- a/docs/Api/InteractionsApi.md +++ b/docs/Api/InteractionsApi.md @@ -1,31 +1,32 @@ # OpenAPI\Client\InteractionsApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**claimTicket()**](InteractionsApi.md#claimTicket) | **PUT** /wallet/ticket/claim/{id} | Update ticket -[**createAdvertisementCreditScan()**](InteractionsApi.md#createAdvertisementCreditScan) | **POST** /wallet/advertisementCredit/scan/{adCreditID} | Create ad credit scan -[**createEmployeeVCard()**](InteractionsApi.md#createEmployeeVCard) | **GET** /wallet/employee/vcard/{id} | Fetch an employee's VCard -[**createIcsFile()**](InteractionsApi.md#createIcsFile) | **GET** /wallet/liveevent/ics/{id} | Fetch ICS for live event -[**createVirtualBusinessCardVCard()**](InteractionsApi.md#createVirtualBusinessCardVCard) | **GET** /wallet/virtualBusinessCard/vCard/{id} | Fetch an employee's VCard -[**fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID()**](InteractionsApi.md#fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID) | **GET** /wallet/staticVoucher/all | Fetch a customer's static vouchers on the basis of a given voucher ID -[**fetchCustomerTicketsWithToken()**](InteractionsApi.md#fetchCustomerTicketsWithToken) | **POST** /wallet/tickets/fetchCustomerTicketsWithToken | Update ticket -[**fetchDynamicVoucherWithVoucherID()**](InteractionsApi.md#fetchDynamicVoucherWithVoucherID) | **GET** /wallet/dynamicVoucher/{voucherID} | Fetch dynamic voucher -[**fetchMemberInformation()**](InteractionsApi.md#fetchMemberInformation) | **GET** /wallet/member | Fetch member information -[**fetchStaticVoucherWithVoucherID()**](InteractionsApi.md#fetchStaticVoucherWithVoucherID) | **GET** /wallet/staticVoucher/{voucherID} | Fetch static voucher -[**fetchWalletPageWithToken()**](InteractionsApi.md#fetchWalletPageWithToken) | **POST** /wallet/page/token | Fetch page with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. -[**fetchWalletPaymentObjectsWithToken()**](InteractionsApi.md#fetchWalletPaymentObjectsWithToken) | **POST** /wallet/paymentObject/token | Fetch payment objects with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. -[**findByVanityHandle()**](InteractionsApi.md#findByVanityHandle) | **GET** /wallet/vanityHandle/{handle} | Fetch vanity handle -[**identifyItem()**](InteractionsApi.md#identifyItem) | **GET** /wallet/item/identify/{itemID} | Identify item -[**requestMerchantURLRedirect()**](InteractionsApi.md#requestMerchantURLRedirect) | **POST** /wallet/merchantURL/{itemID} | Identify item -[**subscribeEmail()**](InteractionsApi.md#subscribeEmail) | **POST** /wallet/subscribeEmail | Create email subscriber +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**claimTicket()**](InteractionsApi.md#claimTicket) | **PUT** /wallet/ticket/claim/{id} | Update ticket | +| [**createAdvertisementCreditScan()**](InteractionsApi.md#createAdvertisementCreditScan) | **POST** /wallet/advertisementCredit/scan/{adCreditID} | Create ad credit scan | +| [**createEmployeeVCard()**](InteractionsApi.md#createEmployeeVCard) | **GET** /wallet/employee/vcard/{id} | Fetch an employee's VCard | +| [**createIcsFile()**](InteractionsApi.md#createIcsFile) | **GET** /wallet/liveevent/ics/{id} | Fetch ICS for live event | +| [**createVirtualBusinessCardVCard()**](InteractionsApi.md#createVirtualBusinessCardVCard) | **GET** /wallet/virtualBusinessCard/vCard/{id} | Fetch an employee's VCard | +| [**fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID()**](InteractionsApi.md#fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID) | **GET** /wallet/staticVoucher/all | Fetch a customer's static vouchers on the basis of a given voucher ID | +| [**fetchCustomerTicketsWithToken()**](InteractionsApi.md#fetchCustomerTicketsWithToken) | **POST** /wallet/tickets/fetchCustomerTicketsWithToken | Update ticket | +| [**fetchDynamicVoucherWithVoucherID()**](InteractionsApi.md#fetchDynamicVoucherWithVoucherID) | **GET** /wallet/dynamicVoucher/{voucherID} | Fetch dynamic voucher | +| [**fetchMemberInformation()**](InteractionsApi.md#fetchMemberInformation) | **GET** /wallet/member | Fetch member information | +| [**fetchStaticVoucherWithVoucherID()**](InteractionsApi.md#fetchStaticVoucherWithVoucherID) | **GET** /wallet/staticVoucher/{voucherID} | Fetch static voucher | +| [**fetchWalletPageWithToken()**](InteractionsApi.md#fetchWalletPageWithToken) | **POST** /wallet/page/token | Fetch page with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. | +| [**fetchWalletPaymentObjectsWithToken()**](InteractionsApi.md#fetchWalletPaymentObjectsWithToken) | **POST** /wallet/paymentObject/token | Fetch payment objects with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. | +| [**findByVanityHandle()**](InteractionsApi.md#findByVanityHandle) | **GET** /wallet/vanityHandle/{handle} | Fetch vanity handle | +| [**identifyItem()**](InteractionsApi.md#identifyItem) | **GET** /wallet/item/identify/{itemID} | Identify item | +| [**requestMerchantURLRedirect()**](InteractionsApi.md#requestMerchantURLRedirect) | **POST** /wallet/merchantURL/{itemID} | Request Merchant URL | +| [**subscribeEmail()**](InteractionsApi.md#subscribeEmail) | **POST** /wallet/subscribeEmail | Create email subscriber | +| [**subscribeSms()**](InteractionsApi.md#subscribeSms) | **POST** /wallet/subscribeSms | Create sms subscriber | ## `claimTicket()` ```php -claimTicket($id, $inline_object4): \OpenAPI\Client\Model\Ticket +claimTicket($id, $claim_ticket_request): \OpenAPI\Client\Model\Ticket ``` Update ticket @@ -44,10 +45,10 @@ $apiInstance = new OpenAPI\Client\Api\InteractionsApi( new GuzzleHttp\Client() ); $id = NULL; // mixed -$inline_object4 = new \OpenAPI\Client\Model\InlineObject4(); // \OpenAPI\Client\Model\InlineObject4 +$claim_ticket_request = new \OpenAPI\Client\Model\ClaimTicketRequest(); // \OpenAPI\Client\Model\ClaimTicketRequest try { - $result = $apiInstance->claimTicket($id, $inline_object4); + $result = $apiInstance->claimTicket($id, $claim_ticket_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling InteractionsApi->claimTicket: ', $e->getMessage(), PHP_EOL; @@ -56,10 +57,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **inline_object4** | [**\OpenAPI\Client\Model\InlineObject4**](../Model/InlineObject4.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **claim_ticket_request** | [**\OpenAPI\Client\Model\ClaimTicketRequest**](../Model/ClaimTicketRequest.md)| | | ### Return type @@ -111,9 +112,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ad_credit_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ad_credit_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -165,9 +166,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -219,9 +220,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -273,9 +274,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -297,7 +298,7 @@ No authorization required ## `fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID()` ```php -fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID($voucher_id): \OpenAPI\Client\Model\InlineResponse20010[] +fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID($voucher_id): \OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner[] ``` Fetch a customer's static vouchers on the basis of a given voucher ID @@ -327,13 +328,13 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **voucher_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **voucher_id** | [**mixed**](../Model/.md)| | | ### Return type -[**\OpenAPI\Client\Model\InlineResponse20010[]**](../Model/InlineResponse20010.md) +[**\OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner[]**](../Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner.md) ### Authorization @@ -351,7 +352,7 @@ No authorization required ## `fetchCustomerTicketsWithToken()` ```php -fetchCustomerTicketsWithToken($inline_object5): \OpenAPI\Client\Model\Ticket[] +fetchCustomerTicketsWithToken($fetch_customer_tickets_with_token_request): \OpenAPI\Client\Model\Ticket[] ``` Update ticket @@ -369,10 +370,10 @@ $apiInstance = new OpenAPI\Client\Api\InteractionsApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$inline_object5 = new \OpenAPI\Client\Model\InlineObject5(); // \OpenAPI\Client\Model\InlineObject5 +$fetch_customer_tickets_with_token_request = new \OpenAPI\Client\Model\FetchCustomerTicketsWithTokenRequest(); // \OpenAPI\Client\Model\FetchCustomerTicketsWithTokenRequest try { - $result = $apiInstance->fetchCustomerTicketsWithToken($inline_object5); + $result = $apiInstance->fetchCustomerTicketsWithToken($fetch_customer_tickets_with_token_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling InteractionsApi->fetchCustomerTicketsWithToken: ', $e->getMessage(), PHP_EOL; @@ -381,9 +382,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **inline_object5** | [**\OpenAPI\Client\Model\InlineObject5**](../Model/InlineObject5.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **fetch_customer_tickets_with_token_request** | [**\OpenAPI\Client\Model\FetchCustomerTicketsWithTokenRequest**](../Model/FetchCustomerTicketsWithTokenRequest.md)| | | ### Return type @@ -435,9 +436,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **voucher_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **voucher_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -490,10 +491,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **member_id** | **string**| | - **merchant_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **member_id** | **string**| | | +| **merchant_id** | **string**| | | ### Return type @@ -545,9 +546,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **voucher_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **voucher_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -599,9 +600,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_fetch_wallet_payment_objects_with_token** | [**\OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken**](../Model/WTFetchWalletPaymentObjectsWithToken.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_fetch_wallet_payment_objects_with_token** | [**\OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken**](../Model/WTFetchWalletPaymentObjectsWithToken.md)| | | ### Return type @@ -653,9 +654,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_fetch_wallet_payment_objects_with_token** | [**\OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken**](../Model/WTFetchWalletPaymentObjectsWithToken.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_fetch_wallet_payment_objects_with_token** | [**\OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken**](../Model/WTFetchWalletPaymentObjectsWithToken.md)| | | ### Return type @@ -707,9 +708,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **handle** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **handle** | **string**| | | ### Return type @@ -764,12 +765,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | - **is_refresh** | **bool**| | [optional] - **phone_verification_token** | **string**| | [optional] - **referrer** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | +| **is_refresh** | **bool**| | [optional] | +| **phone_verification_token** | **string**| | [optional] | +| **referrer** | **string**| | [optional] | ### Return type @@ -794,7 +795,7 @@ No authorization required requestMerchantURLRedirect($item_id, $browser_details): mixed ``` -Identify item +Request Merchant URL ### Example @@ -822,10 +823,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | - **browser_details** | [**\OpenAPI\Client\Model\BrowserDetails**](../Model/BrowserDetails.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | +| **browser_details** | [**\OpenAPI\Client\Model\BrowserDetails**](../Model/BrowserDetails.md)| | | ### Return type @@ -877,9 +878,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_email_subscriber_create_params_wallet_ui** | [**\OpenAPI\Client\Model\WTEmailSubscriberCreateParamsWalletUI**](../Model/WTEmailSubscriberCreateParamsWalletUI.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_email_subscriber_create_params_wallet_ui** | [**\OpenAPI\Client\Model\WTEmailSubscriberCreateParamsWalletUI**](../Model/WTEmailSubscriberCreateParamsWalletUI.md)| | | ### Return type @@ -897,3 +898,57 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#endpoints) [[Back to Model list]](../../README.md#models) [[Back to README]](../../README.md) + +## `subscribeSms()` + +```php +subscribeSms($wt_sms_subscriber_create_params_wallet_ui): \OpenAPI\Client\Model\SmsSubscriber +``` + +Create sms subscriber + +### Example + +```php +subscribeSms($wt_sms_subscriber_create_params_wallet_ui); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling InteractionsApi->subscribeSms: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_sms_subscriber_create_params_wallet_ui** | [**\OpenAPI\Client\Model\WTSmsSubscriberCreateParamsWalletUI**](../Model/WTSmsSubscriberCreateParamsWalletUI.md)| | | + +### Return type + +[**\OpenAPI\Client\Model\SmsSubscriber**](../Model/SmsSubscriber.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/LoginAndLogoutApi.md b/docs/Api/LoginAndLogoutApi.md index 38c22d3..fe54e01 100644 --- a/docs/Api/LoginAndLogoutApi.md +++ b/docs/Api/LoginAndLogoutApi.md @@ -1,12 +1,12 @@ # OpenAPI\Client\LoginAndLogoutApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**login()**](LoginAndLogoutApi.md#login) | **POST** /authentication/login | Login -[**loginStatus()**](LoginAndLogoutApi.md#loginStatus) | **GET** /authentication/status/{token} | Retrieve status of session token -[**logout()**](LoginAndLogoutApi.md#logout) | **DELETE** /authentication/logout | Logout +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**login()**](LoginAndLogoutApi.md#login) | **POST** /authentication/login | Login | +| [**loginStatus()**](LoginAndLogoutApi.md#loginStatus) | **GET** /authentication/status/{token} | Retrieve status of session token | +| [**logout()**](LoginAndLogoutApi.md#logout) | **DELETE** /authentication/logout | Logout | ## `login()` @@ -42,9 +42,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_authentication_login_request** | [**\OpenAPI\Client\Model\WTAuthenticationLoginRequest**](../Model/WTAuthenticationLoginRequest.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_authentication_login_request** | [**\OpenAPI\Client\Model\WTAuthenticationLoginRequest**](../Model/WTAuthenticationLoginRequest.md)| | | ### Return type @@ -66,7 +66,7 @@ No authorization required ## `loginStatus()` ```php -loginStatus($token): AnyOfObjectWTAuthenticationCheckSessionTokenStatusResponse +loginStatus($token): \OpenAPI\Client\Model\LoginStatus200Response ``` Retrieve status of session token @@ -96,13 +96,13 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **token** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **token** | **string**| | | ### Return type -[**AnyOfObjectWTAuthenticationCheckSessionTokenStatusResponse**](../Model/AnyOfObjectWTAuthenticationCheckSessionTokenStatusResponse.md) +[**\OpenAPI\Client\Model\LoginStatus200Response**](../Model/LoginStatus200Response.md) ### Authorization diff --git a/docs/Api/LoungeApi.md b/docs/Api/LoungeApi.md index 23372db..1860608 100644 --- a/docs/Api/LoungeApi.md +++ b/docs/Api/LoungeApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\LoungeApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveLounge()**](LoungeApi.md#archiveLounge) | **DELETE** /v2/lounge/{id} | Archive lounge -[**createLounge()**](LoungeApi.md#createLounge) | **POST** /v2/lounge | Create lounge -[**fetchAllLounge()**](LoungeApi.md#fetchAllLounge) | **GET** /v2/lounge/all | Fetch all lounge -[**restoreLounge()**](LoungeApi.md#restoreLounge) | **PATCH** /v2/lounge/{id} | Restore lounge -[**updateLounge()**](LoungeApi.md#updateLounge) | **PUT** /v2/lounge/{id} | Update lounge +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveLounge()**](LoungeApi.md#archiveLounge) | **DELETE** /v2/lounge/{id} | Archive lounge | +| [**createLounge()**](LoungeApi.md#createLounge) | **POST** /v2/lounge | Create lounge | +| [**fetchAllLounge()**](LoungeApi.md#fetchAllLounge) | **GET** /v2/lounge/all | Fetch all lounge | +| [**restoreLounge()**](LoungeApi.md#restoreLounge) | **PATCH** /v2/lounge/{id} | Restore lounge | +| [**updateLounge()**](LoungeApi.md#updateLounge) | **PUT** /v2/lounge/{id} | Update lounge | ## `archiveLounge()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_lounge_create_params** | [**\OpenAPI\Client\Model\WTLoungeCreateParams**](../Model/WTLoungeCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_lounge_create_params** | [**\OpenAPI\Client\Model\WTLoungeCreateParams**](../Model/WTLoungeCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_lounge_update_params** | [**\OpenAPI\Client\Model\WTLoungeUpdateParams**](../Model/WTLoungeUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_lounge_update_params** | [**\OpenAPI\Client\Model\WTLoungeUpdateParams**](../Model/WTLoungeUpdateParams.md)| | | ### Return type diff --git a/docs/Api/MembershipTiersApi.md b/docs/Api/MembershipTiersApi.md index 4d9560c..23e2c49 100644 --- a/docs/Api/MembershipTiersApi.md +++ b/docs/Api/MembershipTiersApi.md @@ -1,18 +1,18 @@ # OpenAPI\Client\MembershipTiersApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveMembershipTier()**](MembershipTiersApi.md#archiveMembershipTier) | **DELETE** /v2/membership/tier/{id} | Archive tier -[**createMembershipTier()**](MembershipTiersApi.md#createMembershipTier) | **POST** /v2/membership/tier | Create tier -[**fetchAllMembershipTiers()**](MembershipTiersApi.md#fetchAllMembershipTiers) | **GET** /v2/membership/tier/all | Fetch all tiers -[**fetchAllMembershipTiersWithMemberCount()**](MembershipTiersApi.md#fetchAllMembershipTiersWithMemberCount) | **GET** /v2/membership/tier/allWithMemberCount | Fetch all tiers with member count -[**fetchMembershipTierById()**](MembershipTiersApi.md#fetchMembershipTierById) | **GET** /v2/membership/tier/{id} | Fetch tier -[**fetchMembershipTierHistoryLog()**](MembershipTiersApi.md#fetchMembershipTierHistoryLog) | **POST** /v2/membership/tier/history/log | Fetch history -[**fetchMembershipTierRedemptionLog()**](MembershipTiersApi.md#fetchMembershipTierRedemptionLog) | **POST** /v2/membership/tier/redemption/log | Fetch redemption log -[**restoreMembershipTier()**](MembershipTiersApi.md#restoreMembershipTier) | **PATCH** /v2/membership/tier/{id} | Restore tier -[**updateMembershipTier()**](MembershipTiersApi.md#updateMembershipTier) | **PUT** /v2/membership/tier/{id} | Update tier +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveMembershipTier()**](MembershipTiersApi.md#archiveMembershipTier) | **DELETE** /v2/membership/tier/{id} | Archive tier | +| [**createMembershipTier()**](MembershipTiersApi.md#createMembershipTier) | **POST** /v2/membership/tier | Create tier | +| [**fetchAllMembershipTiers()**](MembershipTiersApi.md#fetchAllMembershipTiers) | **GET** /v2/membership/tier/all | Fetch all tiers | +| [**fetchAllMembershipTiersWithMemberCount()**](MembershipTiersApi.md#fetchAllMembershipTiersWithMemberCount) | **GET** /v2/membership/tier/allWithMemberCount | Fetch all tiers with member count | +| [**fetchMembershipTierById()**](MembershipTiersApi.md#fetchMembershipTierById) | **GET** /v2/membership/tier/{id} | Fetch tier | +| [**fetchMembershipTierHistoryLog()**](MembershipTiersApi.md#fetchMembershipTierHistoryLog) | **POST** /v2/membership/tier/history/log | Fetch history | +| [**fetchMembershipTierRedemptionLog()**](MembershipTiersApi.md#fetchMembershipTierRedemptionLog) | **POST** /v2/membership/tier/redemption/log | Fetch redemption log | +| [**restoreMembershipTier()**](MembershipTiersApi.md#restoreMembershipTier) | **PATCH** /v2/membership/tier/{id} | Restore tier | +| [**updateMembershipTier()**](MembershipTiersApi.md#updateMembershipTier) | **PUT** /v2/membership/tier/{id} | Update tier | ## `archiveMembershipTier()` @@ -48,9 +48,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -102,9 +102,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_membership_tier_creation_params** | [**\OpenAPI\Client\Model\WTMembershipTierCreationParams**](../Model/WTMembershipTierCreationParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_membership_tier_creation_params** | [**\OpenAPI\Client\Model\WTMembershipTierCreationParams**](../Model/WTMembershipTierCreationParams.md)| | | ### Return type @@ -156,9 +156,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -210,9 +210,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -264,9 +264,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -318,9 +318,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | | ### Return type @@ -372,9 +372,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | | ### Return type @@ -426,9 +426,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | ### Return type @@ -481,10 +481,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_membership_tier_update_params** | [**\OpenAPI\Client\Model\WTMembershipTierUpdateParams**](../Model/WTMembershipTierUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_membership_tier_update_params** | [**\OpenAPI\Client\Model\WTMembershipTierUpdateParams**](../Model/WTMembershipTierUpdateParams.md)| | | ### Return type diff --git a/docs/Api/MerchantApi.md b/docs/Api/MerchantApi.md index d4ff20f..78e37ed 100644 --- a/docs/Api/MerchantApi.md +++ b/docs/Api/MerchantApi.md @@ -1,36 +1,36 @@ # OpenAPI\Client\MerchantApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveMerchantProfile()**](MerchantApi.md#archiveMerchantProfile) | **DELETE** /v2/merchant/delete | Archive Merchant -[**archivePaymentObjectBroadcast()**](MerchantApi.md#archivePaymentObjectBroadcast) | **DELETE** /v2/merchant/paymentObjectBroadcast/{broadcastID} | Archive payment object broadcast -[**countInboundSMS()**](MerchantApi.md#countInboundSMS) | **GET** /v2/merchant/sms/inbound/count/{phoneNumberID} | Count inbound SMSes -[**exportInboundMessages()**](MerchantApi.md#exportInboundMessages) | **PUT** /v2/merchant/sms/inbound/export/{phoneNumberID} | Export inbound messages -[**exportOutboundMessages()**](MerchantApi.md#exportOutboundMessages) | **PUT** /v2/merchant/sms/outbound/export/{phoneNumberID} | Export outbound messages -[**fetchAdvertisementCreditBroadcasts()**](MerchantApi.md#fetchAdvertisementCreditBroadcasts) | **GET** /v2/merchant/broadcasts/adCredits/all | Fetch all ad credit broadcasts -[**fetchCustomRoles()**](MerchantApi.md#fetchCustomRoles) | **GET** /v2/merchant/roles/custom | Fetch custom roles -[**fetchDynamicVoucherBroadcasts()**](MerchantApi.md#fetchDynamicVoucherBroadcasts) | **GET** /v2/merchant/broadcasts/dynamicVouchers/all | Fetch all dynamic voucher broadcasts -[**fetchEmployees()**](MerchantApi.md#fetchEmployees) | **GET** /v2/merchant/employees/all | Fetch all employees -[**fetchHelpDeskRequests()**](MerchantApi.md#fetchHelpDeskRequests) | **GET** /v2/merchant/helpDeskRequests/{phoneNumberID} | Fetch help desk requests -[**fetchImportedList()**](MerchantApi.md#fetchImportedList) | **GET** /v2/merchant/lists/imported/{listID} | Fetch imported list -[**fetchImportedLists()**](MerchantApi.md#fetchImportedLists) | **GET** /v2/merchant/lists/imported/all | Fetch all imported lists -[**fetchInboundSMS()**](MerchantApi.md#fetchInboundSMS) | **GET** /v2/merchant/sms/inbound/{phoneNumberID} | Fetch inbound SMSes -[**fetchInboundSMSByPage()**](MerchantApi.md#fetchInboundSMSByPage) | **GET** /v2/merchant/sms/inbound/page/{phoneNumberID} | Fetch inbound SMSes by page -[**fetchMerchantOutboundSMS()**](MerchantApi.md#fetchMerchantOutboundSMS) | **GET** /v2/merchant/sms/outbound/{phoneNumberID} | Fetch outbound SMSes -[**fetchMerchantPhoneNumbers()**](MerchantApi.md#fetchMerchantPhoneNumbers) | **GET** /v2/merchant/phoneNumbers/all | Fetch all phone numbers -[**fetchOptInList()**](MerchantApi.md#fetchOptInList) | **GET** /v2/merchant/lists/optIn/{listID} | Fetch opt in list -[**fetchOptInLists()**](MerchantApi.md#fetchOptInLists) | **GET** /v2/merchant/lists/optIn/all | Fetch all opt in lists -[**fetchPhoneNumber()**](MerchantApi.md#fetchPhoneNumber) | **GET** /v2/merchant/phoneNumber/{phoneNumberID} | Fetch phone number -[**fetchPublicEmployees()**](MerchantApi.md#fetchPublicEmployees) | **GET** /v2/merchant/employees/public | Fetch public representative employees of the merchant -[**fetchSimpleSMSBroadcasts()**](MerchantApi.md#fetchSimpleSMSBroadcasts) | **GET** /v2/merchant/broadcasts/simpleSMS/all | Fetch all simple SMS broadcasts -[**fetchStaticVoucherCampaignBroadcasts()**](MerchantApi.md#fetchStaticVoucherCampaignBroadcasts) | **GET** /v2/merchant/broadcasts/staticVoucherCampaign/all | Fetch all static voucher campaign broadcasts -[**fetchTCPAFilter()**](MerchantApi.md#fetchTCPAFilter) | **GET** /v2/merchant/tcpa/filter/all | Fetch all TCPA Filters -[**fetchWalletConfiguration()**](MerchantApi.md#fetchWalletConfiguration) | **GET** /v2/merchant/wallet/configuration | Fetch wallet configuration -[**updateMerchant()**](MerchantApi.md#updateMerchant) | **PUT** /v2/merchant | Update merchant details -[**updatePointsOfContact()**](MerchantApi.md#updatePointsOfContact) | **PUT** /v2/merchant/pointsOfContact | Update billing contact -[**updatePosIntegration()**](MerchantApi.md#updatePosIntegration) | **PUT** /v2/merchant/pos/integration | Update POS Integration +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveMerchantProfile()**](MerchantApi.md#archiveMerchantProfile) | **DELETE** /v2/merchant/delete | Archive Merchant | +| [**archivePaymentObjectBroadcast()**](MerchantApi.md#archivePaymentObjectBroadcast) | **DELETE** /v2/merchant/paymentObjectBroadcast/{broadcastID} | Archive payment object broadcast | +| [**countInboundSMS()**](MerchantApi.md#countInboundSMS) | **GET** /v2/merchant/sms/inbound/count/{phoneNumberID} | Count inbound SMSes | +| [**exportInboundMessages()**](MerchantApi.md#exportInboundMessages) | **PUT** /v2/merchant/sms/inbound/export/{phoneNumberID} | Export inbound messages | +| [**exportOutboundMessages()**](MerchantApi.md#exportOutboundMessages) | **PUT** /v2/merchant/sms/outbound/export/{phoneNumberID} | Export outbound messages | +| [**fetchAdvertisementCreditBroadcasts()**](MerchantApi.md#fetchAdvertisementCreditBroadcasts) | **GET** /v2/merchant/broadcasts/adCredits/all | Fetch all ad credit broadcasts | +| [**fetchCustomRoles()**](MerchantApi.md#fetchCustomRoles) | **GET** /v2/merchant/roles/custom | Fetch custom roles | +| [**fetchDynamicVoucherBroadcasts()**](MerchantApi.md#fetchDynamicVoucherBroadcasts) | **GET** /v2/merchant/broadcasts/dynamicVouchers/all | Fetch all dynamic voucher broadcasts | +| [**fetchEmployees()**](MerchantApi.md#fetchEmployees) | **GET** /v2/merchant/employees/all | Fetch all employees | +| [**fetchHelpDeskRequests()**](MerchantApi.md#fetchHelpDeskRequests) | **GET** /v2/merchant/helpDeskRequests/{phoneNumberID} | Fetch help desk requests | +| [**fetchImportedList()**](MerchantApi.md#fetchImportedList) | **GET** /v2/merchant/lists/imported/{listID} | Fetch imported list | +| [**fetchImportedLists()**](MerchantApi.md#fetchImportedLists) | **GET** /v2/merchant/lists/imported/all | Fetch all imported lists | +| [**fetchInboundSMS()**](MerchantApi.md#fetchInboundSMS) | **GET** /v2/merchant/sms/inbound/{phoneNumberID} | Fetch inbound SMSes | +| [**fetchInboundSMSByPage()**](MerchantApi.md#fetchInboundSMSByPage) | **GET** /v2/merchant/sms/inbound/page/{phoneNumberID} | Fetch inbound SMSes by page | +| [**fetchMerchantOutboundSMS()**](MerchantApi.md#fetchMerchantOutboundSMS) | **GET** /v2/merchant/sms/outbound/{phoneNumberID} | Fetch outbound SMSes | +| [**fetchMerchantPhoneNumbers()**](MerchantApi.md#fetchMerchantPhoneNumbers) | **GET** /v2/merchant/phoneNumbers/all | Fetch all phone numbers | +| [**fetchOptInList()**](MerchantApi.md#fetchOptInList) | **GET** /v2/merchant/lists/optIn/{listID} | Fetch opt in list | +| [**fetchOptInLists()**](MerchantApi.md#fetchOptInLists) | **GET** /v2/merchant/lists/optIn/all | Fetch all opt in lists | +| [**fetchPhoneNumber()**](MerchantApi.md#fetchPhoneNumber) | **GET** /v2/merchant/phoneNumber/{phoneNumberID} | Fetch phone number | +| [**fetchPublicEmployees()**](MerchantApi.md#fetchPublicEmployees) | **GET** /v2/merchant/employees/public | Fetch public representative employees of the merchant | +| [**fetchSimpleSMSBroadcasts()**](MerchantApi.md#fetchSimpleSMSBroadcasts) | **GET** /v2/merchant/broadcasts/simpleSMS/all | Fetch all simple SMS broadcasts | +| [**fetchStaticVoucherCampaignBroadcasts()**](MerchantApi.md#fetchStaticVoucherCampaignBroadcasts) | **GET** /v2/merchant/broadcasts/staticVoucherCampaign/all | Fetch all static voucher campaign broadcasts | +| [**fetchTCPAFilter()**](MerchantApi.md#fetchTCPAFilter) | **GET** /v2/merchant/tcpa/filter/all | Fetch all TCPA Filters | +| [**fetchWalletConfiguration()**](MerchantApi.md#fetchWalletConfiguration) | **GET** /v2/merchant/wallet/configuration | Fetch wallet configuration | +| [**updateMerchant()**](MerchantApi.md#updateMerchant) | **PUT** /v2/merchant | Update merchant details | +| [**updatePointsOfContact()**](MerchantApi.md#updatePointsOfContact) | **PUT** /v2/merchant/pointsOfContact | Update billing contact | +| [**updatePosIntegration()**](MerchantApi.md#updatePosIntegration) | **PUT** /v2/merchant/pos/integration | Update POS Integration | ## `archiveMerchantProfile()` @@ -117,9 +117,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **broadcast_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **broadcast_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -173,11 +173,11 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | [**mixed**](../Model/.md)| | - **from_phone_number** | **string**| | [optional] - **body** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | [**mixed**](../Model/.md)| | | +| **from_phone_number** | **string**| | [optional] | +| **body** | **string**| | [optional] | ### Return type @@ -230,10 +230,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | - **locale** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | +| **locale** | **string**| | | ### Return type @@ -287,11 +287,11 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | - **locale** | **string**| | - **payment_object_broadcast_id** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | +| **locale** | **string**| | | +| **payment_object_broadcast_id** | **string**| | [optional] | ### Return type @@ -343,9 +343,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -448,9 +448,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -554,10 +554,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | [**mixed**](../Model/.md)| | - **is_resolved** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | [**mixed**](../Model/.md)| | | +| **is_resolved** | **bool**| | [optional] | ### Return type @@ -609,9 +609,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -663,9 +663,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -718,10 +718,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | [**mixed**](../Model/.md)| | - **from_phone_number** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | [**mixed**](../Model/.md)| | | +| **from_phone_number** | **string**| | [optional] | ### Return type @@ -743,7 +743,7 @@ No authorization required ## `fetchInboundSMSByPage()` ```php -fetchInboundSMSByPage($phone_number_id, $from_phone_number, $page_size, $page_num): \OpenAPI\Client\Model\InlineResponse2002 +fetchInboundSMSByPage($phone_number_id, $from_phone_number, $page_size, $page_num): \OpenAPI\Client\Model\FetchInboundSMSByPage200Response ``` Fetch inbound SMSes by page @@ -763,8 +763,8 @@ $apiInstance = new OpenAPI\Client\Api\MerchantApi( ); $phone_number_id = NULL; // mixed $from_phone_number = 'from_phone_number_example'; // string -$page_size = 3.4; // double -$page_num = 3.4; // double +$page_size = 3.4; // float +$page_num = 3.4; // float try { $result = $apiInstance->fetchInboundSMSByPage($phone_number_id, $from_phone_number, $page_size, $page_num); @@ -776,16 +776,16 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | [**mixed**](../Model/.md)| | - **from_phone_number** | **string**| | [optional] - **page_size** | **double**| | [optional] - **page_num** | **double**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | [**mixed**](../Model/.md)| | | +| **from_phone_number** | **string**| | [optional] | +| **page_size** | **float**| | [optional] | +| **page_num** | **float**| | [optional] | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2002**](../Model/InlineResponse2002.md) +[**\OpenAPI\Client\Model\FetchInboundSMSByPage200Response**](../Model/FetchInboundSMSByPage200Response.md) ### Authorization @@ -834,10 +834,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | [**mixed**](../Model/.md)| | - **to_phone_number** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | [**mixed**](../Model/.md)| | | +| **to_phone_number** | **string**| | | ### Return type @@ -890,10 +890,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] - **is_approved** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | +| **is_approved** | **bool**| | [optional] | ### Return type @@ -945,9 +945,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -999,9 +999,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -1053,9 +1053,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -1158,9 +1158,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -1212,9 +1212,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -1368,9 +1368,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_merchant_update** | [**\OpenAPI\Client\Model\WTMerchantUpdate**](../Model/WTMerchantUpdate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_merchant_update** | [**\OpenAPI\Client\Model\WTMerchantUpdate**](../Model/WTMerchantUpdate.md)| | | ### Return type @@ -1422,9 +1422,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_merchant_update_points_of_contact** | [**\OpenAPI\Client\Model\WTMerchantUpdatePointsOfContact**](../Model/WTMerchantUpdatePointsOfContact.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_merchant_update_points_of_contact** | [**\OpenAPI\Client\Model\WTMerchantUpdatePointsOfContact**](../Model/WTMerchantUpdatePointsOfContact.md)| | | ### Return type @@ -1476,9 +1476,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_merchant_update_pos_integration** | [**\OpenAPI\Client\Model\WTMerchantUpdatePOSIntegration**](../Model/WTMerchantUpdatePOSIntegration.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_merchant_update_pos_integration** | [**\OpenAPI\Client\Model\WTMerchantUpdatePOSIntegration**](../Model/WTMerchantUpdatePOSIntegration.md)| | | ### Return type diff --git a/docs/Api/MerchantCreditsApi.md b/docs/Api/MerchantCreditsApi.md index 9f4461d..3cc08cb 100644 --- a/docs/Api/MerchantCreditsApi.md +++ b/docs/Api/MerchantCreditsApi.md @@ -1,19 +1,19 @@ # OpenAPI\Client\MerchantCreditsApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveMerchantCredit()**](MerchantCreditsApi.md#archiveMerchantCredit) | **DELETE** /v2/payment/merchantcredit/{id} | Archive merchant credit -[**createMerchantCredit()**](MerchantCreditsApi.md#createMerchantCredit) | **POST** /v2/payment/merchantcredit | Create merchant credit -[**fetchMerchantCreditById()**](MerchantCreditsApi.md#fetchMerchantCreditById) | **GET** /v2/payment/merchantcredit/{id} | Fetch merchant credit -[**fetchMerchantCreditCount()**](MerchantCreditsApi.md#fetchMerchantCreditCount) | **GET** /v2/payment/merchantcredit/count | Fetch all active merchant credits -[**fetchMerchantCreditHistoryLog()**](MerchantCreditsApi.md#fetchMerchantCreditHistoryLog) | **POST** /v2/payment/merchantcredit/history/log | Fetch history -[**fetchMerchantCreditRedemptionLog()**](MerchantCreditsApi.md#fetchMerchantCreditRedemptionLog) | **POST** /v2/payment/merchantcredit/redemption/log | Fetch redemption log -[**fetchMerchantCreditsByPage()**](MerchantCreditsApi.md#fetchMerchantCreditsByPage) | **POST** /v2/payment/merchantcredit/page | Fetch merchant credits by page -[**restoreMerchantCredit()**](MerchantCreditsApi.md#restoreMerchantCredit) | **PATCH** /v2/payment/merchantcredit/{id} | Restore merchant credit -[**searchMerchantCredits()**](MerchantCreditsApi.md#searchMerchantCredits) | **POST** /v2/payment/merchantcredit/search | Search for merchant credits -[**updateMerchantCredit()**](MerchantCreditsApi.md#updateMerchantCredit) | **PUT** /v2/payment/merchantcredit/{id} | Update merchant credit +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveMerchantCredit()**](MerchantCreditsApi.md#archiveMerchantCredit) | **DELETE** /v2/payment/merchantcredit/{id} | Archive merchant credit | +| [**createMerchantCredit()**](MerchantCreditsApi.md#createMerchantCredit) | **POST** /v2/payment/merchantcredit | Create merchant credit | +| [**fetchMerchantCreditById()**](MerchantCreditsApi.md#fetchMerchantCreditById) | **GET** /v2/payment/merchantcredit/{id} | Fetch merchant credit | +| [**fetchMerchantCreditCount()**](MerchantCreditsApi.md#fetchMerchantCreditCount) | **GET** /v2/payment/merchantcredit/count | Fetch all active merchant credits | +| [**fetchMerchantCreditHistoryLog()**](MerchantCreditsApi.md#fetchMerchantCreditHistoryLog) | **POST** /v2/payment/merchantcredit/history/log | Fetch history | +| [**fetchMerchantCreditRedemptionLog()**](MerchantCreditsApi.md#fetchMerchantCreditRedemptionLog) | **POST** /v2/payment/merchantcredit/redemption/log | Fetch redemption log | +| [**fetchMerchantCreditsByPage()**](MerchantCreditsApi.md#fetchMerchantCreditsByPage) | **POST** /v2/payment/merchantcredit/page | Fetch merchant credits by page | +| [**restoreMerchantCredit()**](MerchantCreditsApi.md#restoreMerchantCredit) | **PATCH** /v2/payment/merchantcredit/{id} | Restore merchant credit | +| [**searchMerchantCredits()**](MerchantCreditsApi.md#searchMerchantCredits) | **POST** /v2/payment/merchantcredit/search | Search for merchant credits | +| [**updateMerchantCredit()**](MerchantCreditsApi.md#updateMerchantCredit) | **PUT** /v2/payment/merchantcredit/{id} | Update merchant credit | ## `archiveMerchantCredit()` @@ -49,9 +49,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -103,9 +103,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_merchant_credit_creation_params** | [**\OpenAPI\Client\Model\WTMerchantCreditCreationParams**](../Model/WTMerchantCreditCreationParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_merchant_credit_creation_params** | [**\OpenAPI\Client\Model\WTMerchantCreditCreationParams**](../Model/WTMerchantCreditCreationParams.md)| | | ### Return type @@ -157,9 +157,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -181,7 +181,7 @@ No authorization required ## `fetchMerchantCreditCount()` ```php -fetchMerchantCreditCount(): \OpenAPI\Client\Model\InlineResponse2003 +fetchMerchantCreditCount(): \OpenAPI\Client\Model\FetchMembersCount200Response ``` Fetch all active merchant credits @@ -214,7 +214,7 @@ This endpoint does not need any parameter. ### Return type -[**\OpenAPI\Client\Model\InlineResponse2003**](../Model/InlineResponse2003.md) +[**\OpenAPI\Client\Model\FetchMembersCount200Response**](../Model/FetchMembersCount200Response.md) ### Authorization @@ -262,9 +262,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | | ### Return type @@ -316,9 +316,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pagination_request_with_id_and_without_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions**](../Model/PaginationRequestWithIDAndWithoutSortOptions.md)| | | ### Return type @@ -370,9 +370,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pagination_request_with_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithSortOptions**](../Model/PaginationRequestWithSortOptions.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pagination_request_with_sort_options** | [**\OpenAPI\Client\Model\PaginationRequestWithSortOptions**](../Model/PaginationRequestWithSortOptions.md)| | | ### Return type @@ -424,9 +424,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -478,9 +478,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **merchant_credit_search** | [**\OpenAPI\Client\Model\MerchantCreditSearch**](../Model/MerchantCreditSearch.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **merchant_credit_search** | [**\OpenAPI\Client\Model\MerchantCreditSearch**](../Model/MerchantCreditSearch.md)| | | ### Return type @@ -533,10 +533,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number** | [**\OpenAPI\Client\Model\PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber**](../Model/PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number** | [**\OpenAPI\Client\Model\PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber**](../Model/PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.md)| | | ### Return type diff --git a/docs/Api/MerchantURLsApi.md b/docs/Api/MerchantURLsApi.md index 53801d1..61e602e 100644 --- a/docs/Api/MerchantURLsApi.md +++ b/docs/Api/MerchantURLsApi.md @@ -1,16 +1,16 @@ # OpenAPI\Client\MerchantURLsApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveMerchantURL()**](MerchantURLsApi.md#archiveMerchantURL) | **DELETE** /v2/business/merchantUrl/{id} | Archive merchant url -[**createMerchantURL()**](MerchantURLsApi.md#createMerchantURL) | **POST** /v2/business/merchantUrl | Create merchant url -[**fetchAllMerchantURLs()**](MerchantURLsApi.md#fetchAllMerchantURLs) | **GET** /v2/business/merchantUrl/all | Fetch all merchant urls -[**fetchMerchantURL()**](MerchantURLsApi.md#fetchMerchantURL) | **GET** /v2/business/merchantUrl/{id} | Fetch merchant url -[**fetchMerchantURLRequests()**](MerchantURLsApi.md#fetchMerchantURLRequests) | **GET** /v2/business/merchantUrl/requests/{id} | Fetch requests -[**restoreMerchantURL()**](MerchantURLsApi.md#restoreMerchantURL) | **PATCH** /v2/business/merchantUrl/{id} | Restore merchant url -[**updateMerchantURL()**](MerchantURLsApi.md#updateMerchantURL) | **PUT** /v2/business/merchantUrl/{id} | Update merchant url +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveMerchantURL()**](MerchantURLsApi.md#archiveMerchantURL) | **DELETE** /v2/business/merchantUrl/{id} | Archive merchant url | +| [**createMerchantURL()**](MerchantURLsApi.md#createMerchantURL) | **POST** /v2/business/merchantUrl | Create merchant url | +| [**fetchAllMerchantURLs()**](MerchantURLsApi.md#fetchAllMerchantURLs) | **GET** /v2/business/merchantUrl/all | Fetch all merchant urls | +| [**fetchMerchantURL()**](MerchantURLsApi.md#fetchMerchantURL) | **GET** /v2/business/merchantUrl/{id} | Fetch merchant url | +| [**fetchMerchantURLRequests()**](MerchantURLsApi.md#fetchMerchantURLRequests) | **GET** /v2/business/merchantUrl/requests/{id} | Fetch requests | +| [**restoreMerchantURL()**](MerchantURLsApi.md#restoreMerchantURL) | **PATCH** /v2/business/merchantUrl/{id} | Restore merchant url | +| [**updateMerchantURL()**](MerchantURLsApi.md#updateMerchantURL) | **PUT** /v2/business/merchantUrl/{id} | Update merchant url | ## `archiveMerchantURL()` @@ -46,9 +46,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -100,9 +100,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_merchant_url_create** | [**\OpenAPI\Client\Model\WTMerchantURLCreate**](../Model/WTMerchantURLCreate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_merchant_url_create** | [**\OpenAPI\Client\Model\WTMerchantURLCreate**](../Model/WTMerchantURLCreate.md)| | | ### Return type @@ -154,9 +154,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -208,9 +208,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -262,9 +262,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -316,9 +316,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -371,10 +371,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_merchant_url_update** | [**\OpenAPI\Client\Model\WTMerchantURLUpdate**](../Model/WTMerchantURLUpdate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_merchant_url_update** | [**\OpenAPI\Client\Model\WTMerchantURLUpdate**](../Model/WTMerchantURLUpdate.md)| | | ### Return type diff --git a/docs/Api/MobileTerminalApi.md b/docs/Api/MobileTerminalApi.md index e5ab29f..ae9a137 100644 --- a/docs/Api/MobileTerminalApi.md +++ b/docs/Api/MobileTerminalApi.md @@ -1,12 +1,12 @@ # OpenAPI\Client\MobileTerminalApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchWalletItemFromMobileTerminal()**](MobileTerminalApi.md#fetchWalletItemFromMobileTerminal) | **GET** /v2/pos/mobile/item/{itemID} | Fetch item -[**findMemberByID()**](MobileTerminalApi.md#findMemberByID) | **GET** /v2/pos/mobile/member/{memberID} | Find member -[**redeemWalletItemFromMobileTerminal()**](MobileTerminalApi.md#redeemWalletItemFromMobileTerminal) | **POST** /v2/pos/mobile/item/redeem/{itemID} | Redeem item +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchWalletItemFromMobileTerminal()**](MobileTerminalApi.md#fetchWalletItemFromMobileTerminal) | **GET** /v2/pos/mobile/item/{itemID} | Fetch item | +| [**findMemberByID()**](MobileTerminalApi.md#findMemberByID) | **GET** /v2/pos/mobile/member/{memberID} | Find member | +| [**redeemWalletItemFromMobileTerminal()**](MobileTerminalApi.md#redeemWalletItemFromMobileTerminal) | **POST** /v2/pos/mobile/item/redeem/{itemID} | Redeem item | ## `fetchWalletItemFromMobileTerminal()` @@ -42,9 +42,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | ### Return type @@ -96,9 +96,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **member_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **member_id** | **string**| | | ### Return type @@ -151,10 +151,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | - **wt_wallet_item_redemption** | [**\OpenAPI\Client\Model\WTWalletItemRedemption**](../Model/WTWalletItemRedemption.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | +| **wt_wallet_item_redemption** | [**\OpenAPI\Client\Model\WTWalletItemRedemption**](../Model/WTWalletItemRedemption.md)| | | ### Return type diff --git a/docs/Api/NewsApi.md b/docs/Api/NewsApi.md index 0d7bda9..bcc7323 100644 --- a/docs/Api/NewsApi.md +++ b/docs/Api/NewsApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\NewsApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveNewsArticle()**](NewsApi.md#archiveNewsArticle) | **DELETE** /v2/news/{id} | Archive news article -[**createNewsArticle()**](NewsApi.md#createNewsArticle) | **POST** /v2/news | Create news article -[**fetchAllNewsArticles()**](NewsApi.md#fetchAllNewsArticles) | **GET** /v2/news/all | Fetch all news articles -[**restoreNewsArticle()**](NewsApi.md#restoreNewsArticle) | **PATCH** /v2/news/{id} | Restore news article -[**updateNewsArticle()**](NewsApi.md#updateNewsArticle) | **PUT** /v2/news/{id} | Update news article +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveNewsArticle()**](NewsApi.md#archiveNewsArticle) | **DELETE** /v2/news/{id} | Archive news article | +| [**createNewsArticle()**](NewsApi.md#createNewsArticle) | **POST** /v2/news | Create news article | +| [**fetchAllNewsArticles()**](NewsApi.md#fetchAllNewsArticles) | **GET** /v2/news/all | Fetch all news articles | +| [**restoreNewsArticle()**](NewsApi.md#restoreNewsArticle) | **PATCH** /v2/news/{id} | Restore news article | +| [**updateNewsArticle()**](NewsApi.md#updateNewsArticle) | **PUT** /v2/news/{id} | Update news article | ## `archiveNewsArticle()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_news_article_create_params** | [**\OpenAPI\Client\Model\WTNewsArticleCreateParams**](../Model/WTNewsArticleCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_news_article_create_params** | [**\OpenAPI\Client\Model\WTNewsArticleCreateParams**](../Model/WTNewsArticleCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_news_article_update_params** | [**\OpenAPI\Client\Model\WTNewsArticleUpdateParams**](../Model/WTNewsArticleUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_news_article_update_params** | [**\OpenAPI\Client\Model\WTNewsArticleUpdateParams**](../Model/WTNewsArticleUpdateParams.md)| | | ### Return type diff --git a/docs/Api/PaymentDesignsApi.md b/docs/Api/PaymentDesignsApi.md index 768732a..c5ac82f 100644 --- a/docs/Api/PaymentDesignsApi.md +++ b/docs/Api/PaymentDesignsApi.md @@ -1,15 +1,15 @@ # OpenAPI\Client\PaymentDesignsApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archivePaymentDesign()**](PaymentDesignsApi.md#archivePaymentDesign) | **DELETE** /v2/payment/design/{id} | Archive payment design -[**createPaymentDesign()**](PaymentDesignsApi.md#createPaymentDesign) | **POST** /v2/payment/design | Create payment design -[**fetchAllPaymentDesigns()**](PaymentDesignsApi.md#fetchAllPaymentDesigns) | **GET** /v2/payment/design/all | Fetch all active payment designs -[**fetchPaymentDesignById()**](PaymentDesignsApi.md#fetchPaymentDesignById) | **GET** /v2/payment/design/{id} | Fetch payment design -[**restorePaymentDesign()**](PaymentDesignsApi.md#restorePaymentDesign) | **PATCH** /v2/payment/design/{id} | Restore payment design -[**updatePaymentDesign()**](PaymentDesignsApi.md#updatePaymentDesign) | **PUT** /v2/payment/design/{id} | Update payment design +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archivePaymentDesign()**](PaymentDesignsApi.md#archivePaymentDesign) | **DELETE** /v2/payment/design/{id} | Archive payment design | +| [**createPaymentDesign()**](PaymentDesignsApi.md#createPaymentDesign) | **POST** /v2/payment/design | Create payment design | +| [**fetchAllPaymentDesigns()**](PaymentDesignsApi.md#fetchAllPaymentDesigns) | **GET** /v2/payment/design/all | Fetch all active payment designs | +| [**fetchPaymentDesignById()**](PaymentDesignsApi.md#fetchPaymentDesignById) | **GET** /v2/payment/design/{id} | Fetch payment design | +| [**restorePaymentDesign()**](PaymentDesignsApi.md#restorePaymentDesign) | **PATCH** /v2/payment/design/{id} | Restore payment design | +| [**updatePaymentDesign()**](PaymentDesignsApi.md#updatePaymentDesign) | **PUT** /v2/payment/design/{id} | Update payment design | ## `archivePaymentDesign()` @@ -45,9 +45,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -99,9 +99,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_payment_design_create_params** | [**\OpenAPI\Client\Model\WTPaymentDesignCreateParams**](../Model/WTPaymentDesignCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_payment_design_create_params** | [**\OpenAPI\Client\Model\WTPaymentDesignCreateParams**](../Model/WTPaymentDesignCreateParams.md)| | | ### Return type @@ -153,9 +153,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -207,9 +207,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,9 +261,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -316,10 +316,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_payment_design_update_params** | [**\OpenAPI\Client\Model\WTPaymentDesignUpdateParams**](../Model/WTPaymentDesignUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_payment_design_update_params** | [**\OpenAPI\Client\Model\WTPaymentDesignUpdateParams**](../Model/WTPaymentDesignUpdateParams.md)| | | ### Return type diff --git a/docs/Api/PerformancesApi.md b/docs/Api/PerformancesApi.md index 606fd7b..f40828e 100644 --- a/docs/Api/PerformancesApi.md +++ b/docs/Api/PerformancesApi.md @@ -1,22 +1,22 @@ # OpenAPI\Client\PerformancesApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archivePerformance()**](PerformancesApi.md#archivePerformance) | **DELETE** /v2/performances/{id} | Archive performance -[**countClaimedComps()**](PerformancesApi.md#countClaimedComps) | **GET** /v2/performances/{id}/claimed/count | Count number claimed -[**countRedeemedComps()**](PerformancesApi.md#countRedeemedComps) | **GET** /v2/performances/{id}/redeemed/count | Count number redeemed -[**createPerformance()**](PerformancesApi.md#createPerformance) | **POST** /v2/performances | Create performance -[**exportTickets()**](PerformancesApi.md#exportTickets) | **POST** /v2/performances/{id}/tickets/export | Update performance -[**fetchAllPerformanceTickets()**](PerformancesApi.md#fetchAllPerformanceTickets) | **GET** /v2/performances/tickets/all/{id} | Fetch all tickets -[**fetchAllPerformances()**](PerformancesApi.md#fetchAllPerformances) | **GET** /v2/performances/all | Fetch all performances -[**fetchPerformance()**](PerformancesApi.md#fetchPerformance) | **GET** /v2/performances/{id} | Fetch a single performance -[**fetchPerformanceTicketsPage()**](PerformancesApi.md#fetchPerformanceTicketsPage) | **GET** /v2/performances/tickets/page/{performanceID} | Fetch tickets by page -[**importTickets()**](PerformancesApi.md#importTickets) | **POST** /v2/performances/{id}/tickets/import | Update performance -[**restorePerformance()**](PerformancesApi.md#restorePerformance) | **PATCH** /v2/performances/{id} | Restore performance -[**saveTicketSettings()**](PerformancesApi.md#saveTicketSettings) | **POST** /v2/performances/{id} | Update performance -[**updatePerformance()**](PerformancesApi.md#updatePerformance) | **PUT** /v2/performances/{id} | Update performance +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archivePerformance()**](PerformancesApi.md#archivePerformance) | **DELETE** /v2/performances/{id} | Archive performance | +| [**countClaimedComps()**](PerformancesApi.md#countClaimedComps) | **GET** /v2/performances/{id}/claimed/count | Count number claimed | +| [**countRedeemedComps()**](PerformancesApi.md#countRedeemedComps) | **GET** /v2/performances/{id}/redeemed/count | Count number redeemed | +| [**createPerformance()**](PerformancesApi.md#createPerformance) | **POST** /v2/performances | Create performance | +| [**exportTickets()**](PerformancesApi.md#exportTickets) | **POST** /v2/performances/{id}/tickets/export | Update performance | +| [**fetchAllPerformanceTickets()**](PerformancesApi.md#fetchAllPerformanceTickets) | **GET** /v2/performances/tickets/all/{id} | Fetch all tickets | +| [**fetchAllPerformances()**](PerformancesApi.md#fetchAllPerformances) | **GET** /v2/performances/all | Fetch all performances | +| [**fetchPerformance()**](PerformancesApi.md#fetchPerformance) | **GET** /v2/performances/{id} | Fetch a single performance | +| [**fetchPerformanceTicketsPage()**](PerformancesApi.md#fetchPerformanceTicketsPage) | **GET** /v2/performances/tickets/page/{performanceID} | Fetch tickets by page | +| [**importTickets()**](PerformancesApi.md#importTickets) | **POST** /v2/performances/{id}/tickets/import | Update performance | +| [**restorePerformance()**](PerformancesApi.md#restorePerformance) | **PATCH** /v2/performances/{id} | Restore performance | +| [**saveTicketSettings()**](PerformancesApi.md#saveTicketSettings) | **POST** /v2/performances/{id} | Update performance | +| [**updatePerformance()**](PerformancesApi.md#updatePerformance) | **PUT** /v2/performances/{id} | Update performance | ## `archivePerformance()` @@ -52,9 +52,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -76,7 +76,7 @@ No authorization required ## `countClaimedComps()` ```php -countClaimedComps($id): \OpenAPI\Client\Model\InlineResponse2003 +countClaimedComps($id): \OpenAPI\Client\Model\CountClaimedComps200Response ``` Count number claimed @@ -106,13 +106,13 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2003**](../Model/InlineResponse2003.md) +[**\OpenAPI\Client\Model\CountClaimedComps200Response**](../Model/CountClaimedComps200Response.md) ### Authorization @@ -130,7 +130,7 @@ No authorization required ## `countRedeemedComps()` ```php -countRedeemedComps($id): \OpenAPI\Client\Model\InlineResponse2003 +countRedeemedComps($id): \OpenAPI\Client\Model\CountClaimedComps200Response ``` Count number redeemed @@ -160,13 +160,13 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2003**](../Model/InlineResponse2003.md) +[**\OpenAPI\Client\Model\CountClaimedComps200Response**](../Model/CountClaimedComps200Response.md) ### Authorization @@ -214,9 +214,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_performance_create_params** | [**\OpenAPI\Client\Model\WTPerformanceCreateParams**](../Model/WTPerformanceCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_performance_create_params** | [**\OpenAPI\Client\Model\WTPerformanceCreateParams**](../Model/WTPerformanceCreateParams.md)| | | ### Return type @@ -268,9 +268,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -323,10 +323,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -378,9 +378,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -432,9 +432,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -456,7 +456,7 @@ No authorization required ## `fetchPerformanceTicketsPage()` ```php -fetchPerformanceTicketsPage($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $is_archive_included): \OpenAPI\Client\Model\InlineResponse2004 +fetchPerformanceTicketsPage($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $sort_by, $sort_direction, $is_archive_included): \OpenAPI\Client\Model\FetchPerformanceTicketsPage200Response ``` Fetch tickets by page @@ -475,14 +475,16 @@ $apiInstance = new OpenAPI\Client\Api\PerformancesApi( new GuzzleHttp\Client() ); $performance_id = NULL; // mixed -$page_num = 3.4; // double -$page_size = 3.4; // double +$page_num = 3.4; // float +$page_size = 3.4; // float $filter_comps = True; // bool $filter_claimed = True; // bool +$sort_by = NULL; // mixed +$sort_direction = NULL; // mixed $is_archive_included = True; // bool try { - $result = $apiInstance->fetchPerformanceTicketsPage($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $is_archive_included); + $result = $apiInstance->fetchPerformanceTicketsPage($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $sort_by, $sort_direction, $is_archive_included); print_r($result); } catch (Exception $e) { echo 'Exception when calling PerformancesApi->fetchPerformanceTicketsPage: ', $e->getMessage(), PHP_EOL; @@ -491,18 +493,20 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **performance_id** | [**mixed**](../Model/.md)| | - **page_num** | **double**| | - **page_size** | **double**| | - **filter_comps** | **bool**| | [optional] - **filter_claimed** | **bool**| | [optional] - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **performance_id** | [**mixed**](../Model/.md)| | | +| **page_num** | **float**| | | +| **page_size** | **float**| | | +| **filter_comps** | **bool**| | [optional] | +| **filter_claimed** | **bool**| | [optional] | +| **sort_by** | [**mixed**](../Model/.md)| | [optional] | +| **sort_direction** | [**mixed**](../Model/.md)| | [optional] | +| **is_archive_included** | **bool**| | [optional] | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2004**](../Model/InlineResponse2004.md) +[**\OpenAPI\Client\Model\FetchPerformanceTicketsPage200Response**](../Model/FetchPerformanceTicketsPage200Response.md) ### Authorization @@ -520,7 +524,7 @@ No authorization required ## `importTickets()` ```php -importTickets($id, $inline_object2): string +importTickets($id, $import_tickets_request): string ``` Update performance @@ -539,10 +543,10 @@ $apiInstance = new OpenAPI\Client\Api\PerformancesApi( new GuzzleHttp\Client() ); $id = NULL; // mixed -$inline_object2 = new \OpenAPI\Client\Model\InlineObject2(); // \OpenAPI\Client\Model\InlineObject2 +$import_tickets_request = new \OpenAPI\Client\Model\ImportTicketsRequest(); // \OpenAPI\Client\Model\ImportTicketsRequest try { - $result = $apiInstance->importTickets($id, $inline_object2); + $result = $apiInstance->importTickets($id, $import_tickets_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling PerformancesApi->importTickets: ', $e->getMessage(), PHP_EOL; @@ -551,10 +555,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **inline_object2** | [**\OpenAPI\Client\Model\InlineObject2**](../Model/InlineObject2.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **import_tickets_request** | [**\OpenAPI\Client\Model\ImportTicketsRequest**](../Model/ImportTicketsRequest.md)| | | ### Return type @@ -606,9 +610,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -630,7 +634,7 @@ No authorization required ## `saveTicketSettings()` ```php -saveTicketSettings($id, $inline_object1): \OpenAPI\Client\Model\Performance +saveTicketSettings($id, $save_ticket_settings_request): \OpenAPI\Client\Model\Performance ``` Update performance @@ -649,10 +653,10 @@ $apiInstance = new OpenAPI\Client\Api\PerformancesApi( new GuzzleHttp\Client() ); $id = NULL; // mixed -$inline_object1 = new \OpenAPI\Client\Model\InlineObject1(); // \OpenAPI\Client\Model\InlineObject1 +$save_ticket_settings_request = new \OpenAPI\Client\Model\SaveTicketSettingsRequest(); // \OpenAPI\Client\Model\SaveTicketSettingsRequest try { - $result = $apiInstance->saveTicketSettings($id, $inline_object1); + $result = $apiInstance->saveTicketSettings($id, $save_ticket_settings_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling PerformancesApi->saveTicketSettings: ', $e->getMessage(), PHP_EOL; @@ -661,10 +665,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **inline_object1** | [**\OpenAPI\Client\Model\InlineObject1**](../Model/InlineObject1.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **save_ticket_settings_request** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequest**](../Model/SaveTicketSettingsRequest.md)| | | ### Return type @@ -717,10 +721,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_performance_update_params** | [**\OpenAPI\Client\Model\WTPerformanceUpdateParams**](../Model/WTPerformanceUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_performance_update_params** | [**\OpenAPI\Client\Model\WTPerformanceUpdateParams**](../Model/WTPerformanceUpdateParams.md)| | | ### Return type diff --git a/docs/Api/ProductsApi.md b/docs/Api/ProductsApi.md index 8cbc738..28a8ab2 100644 --- a/docs/Api/ProductsApi.md +++ b/docs/Api/ProductsApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\ProductsApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveProduct()**](ProductsApi.md#archiveProduct) | **DELETE** /v2/products/{id} | Archive product -[**createProduct()**](ProductsApi.md#createProduct) | **POST** /v2/products | Create product -[**fetchAllProducts()**](ProductsApi.md#fetchAllProducts) | **GET** /v2/products/all | Fetch all products -[**restoreProduct()**](ProductsApi.md#restoreProduct) | **PATCH** /v2/products/{id} | Restore product -[**updateProduct()**](ProductsApi.md#updateProduct) | **PUT** /v2/products/{id} | Update product +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveProduct()**](ProductsApi.md#archiveProduct) | **DELETE** /v2/products/{id} | Archive product | +| [**createProduct()**](ProductsApi.md#createProduct) | **POST** /v2/products | Create product | +| [**fetchAllProducts()**](ProductsApi.md#fetchAllProducts) | **GET** /v2/products/all | Fetch all products | +| [**restoreProduct()**](ProductsApi.md#restoreProduct) | **PATCH** /v2/products/{id} | Restore product | +| [**updateProduct()**](ProductsApi.md#updateProduct) | **PUT** /v2/products/{id} | Update product | ## `archiveProduct()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_product_create_params** | [**\OpenAPI\Client\Model\WTProductCreateParams**](../Model/WTProductCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_product_create_params** | [**\OpenAPI\Client\Model\WTProductCreateParams**](../Model/WTProductCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_product_update_params** | [**\OpenAPI\Client\Model\WTProductUpdateParams**](../Model/WTProductUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_product_update_params** | [**\OpenAPI\Client\Model\WTProductUpdateParams**](../Model/WTProductUpdateParams.md)| | | ### Return type diff --git a/docs/Api/PromotionCodesApi.md b/docs/Api/PromotionCodesApi.md index 947ef5d..418fceb 100644 --- a/docs/Api/PromotionCodesApi.md +++ b/docs/Api/PromotionCodesApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\PromotionCodesApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archivePromoCode()**](PromotionCodesApi.md#archivePromoCode) | **DELETE** /v2/promoCodes/{id} | Archive promo code -[**createPromoCode()**](PromotionCodesApi.md#createPromoCode) | **POST** /v2/promoCodes | Create promo code -[**fetchAllPromoCodes()**](PromotionCodesApi.md#fetchAllPromoCodes) | **GET** /v2/promoCodes/all | Fetch all promo codes -[**restorePromoCode()**](PromotionCodesApi.md#restorePromoCode) | **PATCH** /v2/promoCodes/{id} | Restore promo code -[**updatePromoCode()**](PromotionCodesApi.md#updatePromoCode) | **PUT** /v2/promoCodes/{id} | Update promo code +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archivePromoCode()**](PromotionCodesApi.md#archivePromoCode) | **DELETE** /v2/promoCodes/{id} | Archive promo code | +| [**createPromoCode()**](PromotionCodesApi.md#createPromoCode) | **POST** /v2/promoCodes | Create promo code | +| [**fetchAllPromoCodes()**](PromotionCodesApi.md#fetchAllPromoCodes) | **GET** /v2/promoCodes/all | Fetch all promo codes | +| [**restorePromoCode()**](PromotionCodesApi.md#restorePromoCode) | **PATCH** /v2/promoCodes/{id} | Restore promo code | +| [**updatePromoCode()**](PromotionCodesApi.md#updatePromoCode) | **PUT** /v2/promoCodes/{id} | Update promo code | ## `archivePromoCode()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_promo_code_create_params** | [**\OpenAPI\Client\Model\WTPromoCodeCreateParams**](../Model/WTPromoCodeCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_promo_code_create_params** | [**\OpenAPI\Client\Model\WTPromoCodeCreateParams**](../Model/WTPromoCodeCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_promo_code_update_params** | [**\OpenAPI\Client\Model\WTPromoCodeUpdateParams**](../Model/WTPromoCodeUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_promo_code_update_params** | [**\OpenAPI\Client\Model\WTPromoCodeUpdateParams**](../Model/WTPromoCodeUpdateParams.md)| | | ### Return type diff --git a/docs/Api/QRCodeDesignsApi.md b/docs/Api/QRCodeDesignsApi.md index 62d523e..3ccb08d 100644 --- a/docs/Api/QRCodeDesignsApi.md +++ b/docs/Api/QRCodeDesignsApi.md @@ -1,15 +1,15 @@ # OpenAPI\Client\QRCodeDesignsApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveQRCodeDesign()**](QRCodeDesignsApi.md#archiveQRCodeDesign) | **DELETE** /v2/qrcodedesign/{id} | Archive QR Code Design -[**createQRCodeDesign()**](QRCodeDesignsApi.md#createQRCodeDesign) | **POST** /v2/qrcodedesign | Create QR Code design -[**fetchAllQRCodeDesigns()**](QRCodeDesignsApi.md#fetchAllQRCodeDesigns) | **GET** /v2/qrcodedesign/all | Fetch all active QR Code Designs -[**fetchQRCodeDesignById()**](QRCodeDesignsApi.md#fetchQRCodeDesignById) | **GET** /v2/qrcodedesign/{id} | Fetch QR Code Design -[**restoreQRCodeDesign()**](QRCodeDesignsApi.md#restoreQRCodeDesign) | **PATCH** /v2/qrcodedesign/{id} | Restore payment design -[**updateQRCodeDesign()**](QRCodeDesignsApi.md#updateQRCodeDesign) | **PUT** /v2/qrcodedesign/{id} | Update QR Code Design +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveQRCodeDesign()**](QRCodeDesignsApi.md#archiveQRCodeDesign) | **DELETE** /v2/qrcodedesign/{id} | Archive QR Code Design | +| [**createQRCodeDesign()**](QRCodeDesignsApi.md#createQRCodeDesign) | **POST** /v2/qrcodedesign | Create QR Code design | +| [**fetchAllQRCodeDesigns()**](QRCodeDesignsApi.md#fetchAllQRCodeDesigns) | **GET** /v2/qrcodedesign/all | Fetch all active QR Code Designs | +| [**fetchQRCodeDesignById()**](QRCodeDesignsApi.md#fetchQRCodeDesignById) | **GET** /v2/qrcodedesign/{id} | Fetch QR Code Design | +| [**restoreQRCodeDesign()**](QRCodeDesignsApi.md#restoreQRCodeDesign) | **PATCH** /v2/qrcodedesign/{id} | Restore payment design | +| [**updateQRCodeDesign()**](QRCodeDesignsApi.md#updateQRCodeDesign) | **PUT** /v2/qrcodedesign/{id} | Update QR Code Design | ## `archiveQRCodeDesign()` @@ -45,9 +45,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -99,9 +99,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wtqr_code_design_create_params** | [**\OpenAPI\Client\Model\WTQRCodeDesignCreateParams**](../Model/WTQRCodeDesignCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wtqr_code_design_create_params** | [**\OpenAPI\Client\Model\WTQRCodeDesignCreateParams**](../Model/WTQRCodeDesignCreateParams.md)| | | ### Return type @@ -153,9 +153,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -207,9 +207,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,9 +261,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -316,10 +316,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wtqr_code_design_update_params** | [**\OpenAPI\Client\Model\WTQRCodeDesignUpdateParams**](../Model/WTQRCodeDesignUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wtqr_code_design_update_params** | [**\OpenAPI\Client\Model\WTQRCodeDesignUpdateParams**](../Model/WTQRCodeDesignUpdateParams.md)| | | ### Return type diff --git a/docs/Api/QuickLinksApi.md b/docs/Api/QuickLinksApi.md index 34c1d75..e893335 100644 --- a/docs/Api/QuickLinksApi.md +++ b/docs/Api/QuickLinksApi.md @@ -1,15 +1,15 @@ # OpenAPI\Client\QuickLinksApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveLinkBook()**](QuickLinksApi.md#archiveLinkBook) | **DELETE** /v2/linkBook/{id} | Archive link -[**createLinkBook()**](QuickLinksApi.md#createLinkBook) | **POST** /v2/linkBook | Create link -[**fetchAllLinkBook()**](QuickLinksApi.md#fetchAllLinkBook) | **GET** /v2/linkBook/all | Fetch all links -[**fetchLinkBookById()**](QuickLinksApi.md#fetchLinkBookById) | **GET** /v2/linkBook/{id} | Fetch link book by id -[**restoreLinkBook()**](QuickLinksApi.md#restoreLinkBook) | **PATCH** /v2/linkBook/{id} | Restore link -[**updateLinkBook()**](QuickLinksApi.md#updateLinkBook) | **PUT** /v2/linkBook/{id} | Update link +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveLinkBook()**](QuickLinksApi.md#archiveLinkBook) | **DELETE** /v2/linkBook/{id} | Archive link | +| [**createLinkBook()**](QuickLinksApi.md#createLinkBook) | **POST** /v2/linkBook | Create link | +| [**fetchAllLinkBook()**](QuickLinksApi.md#fetchAllLinkBook) | **GET** /v2/linkBook/all | Fetch all links | +| [**fetchLinkBookById()**](QuickLinksApi.md#fetchLinkBookById) | **GET** /v2/linkBook/{id} | Fetch link book by id | +| [**restoreLinkBook()**](QuickLinksApi.md#restoreLinkBook) | **PATCH** /v2/linkBook/{id} | Restore link | +| [**updateLinkBook()**](QuickLinksApi.md#updateLinkBook) | **PUT** /v2/linkBook/{id} | Update link | ## `archiveLinkBook()` @@ -45,9 +45,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -99,9 +99,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_link_book_create_params** | [**\OpenAPI\Client\Model\WTLinkBookCreateParams**](../Model/WTLinkBookCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_link_book_create_params** | [**\OpenAPI\Client\Model\WTLinkBookCreateParams**](../Model/WTLinkBookCreateParams.md)| | | ### Return type @@ -153,9 +153,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -207,9 +207,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,9 +261,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -316,10 +316,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_link_book_update_params** | [**\OpenAPI\Client\Model\WTLinkBookUpdateParams**](../Model/WTLinkBookUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_link_book_update_params** | [**\OpenAPI\Client\Model\WTLinkBookUpdateParams**](../Model/WTLinkBookUpdateParams.md)| | | ### Return type diff --git a/docs/Api/QuickLinksSectionApi.md b/docs/Api/QuickLinksSectionApi.md index 0a6854e..48f96f2 100644 --- a/docs/Api/QuickLinksSectionApi.md +++ b/docs/Api/QuickLinksSectionApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\QuickLinksSectionApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveLinkBookSection()**](QuickLinksSectionApi.md#archiveLinkBookSection) | **DELETE** /v2/linkBookSection/{id} | Archive link book section -[**createLinkBookSection()**](QuickLinksSectionApi.md#createLinkBookSection) | **POST** /v2/linkBookSection | Create link book section -[**fetchAllLinkBookSections()**](QuickLinksSectionApi.md#fetchAllLinkBookSections) | **GET** /v2/linkBookSection/all | Fetch all link book sections -[**restoreLinkBookSection()**](QuickLinksSectionApi.md#restoreLinkBookSection) | **PATCH** /v2/linkBookSection/{id} | Restore link book section -[**updateLinkBookSection()**](QuickLinksSectionApi.md#updateLinkBookSection) | **PUT** /v2/linkBookSection/{id} | Update link book section +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveLinkBookSection()**](QuickLinksSectionApi.md#archiveLinkBookSection) | **DELETE** /v2/linkBookSection/{id} | Archive link book section | +| [**createLinkBookSection()**](QuickLinksSectionApi.md#createLinkBookSection) | **POST** /v2/linkBookSection | Create link book section | +| [**fetchAllLinkBookSections()**](QuickLinksSectionApi.md#fetchAllLinkBookSections) | **GET** /v2/linkBookSection/all | Fetch all link book sections | +| [**restoreLinkBookSection()**](QuickLinksSectionApi.md#restoreLinkBookSection) | **PATCH** /v2/linkBookSection/{id} | Restore link book section | +| [**updateLinkBookSection()**](QuickLinksSectionApi.md#updateLinkBookSection) | **PUT** /v2/linkBookSection/{id} | Update link book section | ## `archiveLinkBookSection()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_link_book_section_create_params** | [**\OpenAPI\Client\Model\WTLinkBookSectionCreateParams**](../Model/WTLinkBookSectionCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_link_book_section_create_params** | [**\OpenAPI\Client\Model\WTLinkBookSectionCreateParams**](../Model/WTLinkBookSectionCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_link_book_section_update_params** | [**\OpenAPI\Client\Model\WTLinkBookSectionUpdateParams**](../Model/WTLinkBookSectionUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_link_book_section_update_params** | [**\OpenAPI\Client\Model\WTLinkBookSectionUpdateParams**](../Model/WTLinkBookSectionUpdateParams.md)| | | ### Return type diff --git a/docs/Api/RoomRatesApi.md b/docs/Api/RoomRatesApi.md index 1f9bd75..a4cb0c1 100644 --- a/docs/Api/RoomRatesApi.md +++ b/docs/Api/RoomRatesApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\RoomRatesApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveRoomRate()**](RoomRatesApi.md#archiveRoomRate) | **DELETE** /v2/roomRates/{id} | Archive room rate -[**createRoomRate()**](RoomRatesApi.md#createRoomRate) | **POST** /v2/roomRates | Create room rate -[**fetchAllRoomRates()**](RoomRatesApi.md#fetchAllRoomRates) | **GET** /v2/roomRates/all | Fetch all room rates -[**restoreRoomRate()**](RoomRatesApi.md#restoreRoomRate) | **PATCH** /v2/roomRates/{id} | Restore room rate -[**updateRoomRate()**](RoomRatesApi.md#updateRoomRate) | **PUT** /v2/roomRates/{id} | Update room rate +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveRoomRate()**](RoomRatesApi.md#archiveRoomRate) | **DELETE** /v2/roomRates/{id} | Archive room rate | +| [**createRoomRate()**](RoomRatesApi.md#createRoomRate) | **POST** /v2/roomRates | Create room rate | +| [**fetchAllRoomRates()**](RoomRatesApi.md#fetchAllRoomRates) | **GET** /v2/roomRates/all | Fetch all room rates | +| [**restoreRoomRate()**](RoomRatesApi.md#restoreRoomRate) | **PATCH** /v2/roomRates/{id} | Restore room rate | +| [**updateRoomRate()**](RoomRatesApi.md#updateRoomRate) | **PUT** /v2/roomRates/{id} | Update room rate | ## `archiveRoomRate()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_room_rate_create_params** | [**\OpenAPI\Client\Model\WTRoomRateCreateParams**](../Model/WTRoomRateCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_room_rate_create_params** | [**\OpenAPI\Client\Model\WTRoomRateCreateParams**](../Model/WTRoomRateCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_room_rate_update_params** | [**\OpenAPI\Client\Model\WTRoomRateUpdateParams**](../Model/WTRoomRateUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_room_rate_update_params** | [**\OpenAPI\Client\Model\WTRoomRateUpdateParams**](../Model/WTRoomRateUpdateParams.md)| | | ### Return type diff --git a/docs/Api/SMSApi.md b/docs/Api/SMSApi.md index 021a749..21f0de5 100644 --- a/docs/Api/SMSApi.md +++ b/docs/Api/SMSApi.md @@ -1,46 +1,46 @@ # OpenAPI\Client\SMSApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**acquirePhoneNumber()**](SMSApi.md#acquirePhoneNumber) | **POST** /v2/sms/phoneNumber/acquire | Acquire phone number -[**archivePhoneNumber()**](SMSApi.md#archivePhoneNumber) | **DELETE** /v2/sms/phoneNumber/{phoneNumberID} | Archive phone number -[**archiveRecipient()**](SMSApi.md#archiveRecipient) | **DELETE** /v2/sms/importedList/recipients/{id} | Archive recipient -[**countImportedListRecipients()**](SMSApi.md#countImportedListRecipients) | **GET** /v2/sms/importedList/recipients/count/{listID} | Count imported list recipients -[**countOptInListSubscribers()**](SMSApi.md#countOptInListSubscribers) | **GET** /v2/sms/optInList/subscribers/count/{listID} | Count opt in list subscribers -[**countOptInSourceSubscribers()**](SMSApi.md#countOptInSourceSubscribers) | **GET** /v2/sms/optInSource/subscribers/count/{sourceID} | Count opt in source subscribers -[**countOutboundSMS()**](SMSApi.md#countOutboundSMS) | **GET** /v2/sms/outbound/count/{phoneNumberID} | Count outbound SMS -[**createImportedList()**](SMSApi.md#createImportedList) | **POST** /v2/sms/importedList | Create imported list -[**createOptInList()**](SMSApi.md#createOptInList) | **POST** /v2/sms/optInList | Create opt in list -[**createOptInListSource()**](SMSApi.md#createOptInListSource) | **POST** /v2/sms/optInListSource | Send SMS to opt in list -[**createRecipientInImportedList()**](SMSApi.md#createRecipientInImportedList) | **POST** /v2/sms/importedList/recipients/create | Add new recipient in an imported list -[**exportImportedListRecipients()**](SMSApi.md#exportImportedListRecipients) | **POST** /v2/sms/importedList/recipients/export/{importedListID} | Export imported list recipients -[**exportOptInListSubscribers()**](SMSApi.md#exportOptInListSubscribers) | **POST** /v2/sms/optInList/subscribers/export/{listID} | Export opt in list subscribers -[**fetchBlockedTCPAEntries()**](SMSApi.md#fetchBlockedTCPAEntries) | **GET** /v2/sms/phoneNumber/blocked/{phoneNumberID} | Fetch blocked TCPA entries -[**fetchImportedListRecipients()**](SMSApi.md#fetchImportedListRecipients) | **GET** /v2/sms/importedList/recipients/{listID} | Fetch imported list recipients -[**fetchImportedListRecipientsByPage()**](SMSApi.md#fetchImportedListRecipientsByPage) | **GET** /v2/sms/importedList/recipients/page/{listID} | Fetch imported list recipients by page -[**fetchOptInListSources()**](SMSApi.md#fetchOptInListSources) | **GET** /v2/sms/optInListSources/all | Fetch all opt in list sources -[**fetchOptInListSubscribers()**](SMSApi.md#fetchOptInListSubscribers) | **GET** /v2/sms/optInList/subscribers/{listID} | Fetch opt in list subscribers -[**fetchOptInListSubscribersByPage()**](SMSApi.md#fetchOptInListSubscribersByPage) | **GET** /v2/sms/optInList/subscribers/page/{listID} | Fetch opt in list subscribers by page -[**fetchOptInListsAssociatedWithPhoneNumber()**](SMSApi.md#fetchOptInListsAssociatedWithPhoneNumber) | **GET** /v2/sms/phoneNumber/lists/{phoneNumberID} | Fetch opt in lists -[**fetchOptInSourceSubscribers()**](SMSApi.md#fetchOptInSourceSubscribers) | **GET** /v2/sms/optInSource/subscribers/{sourceID} | Fetch opt in source subscribers -[**fetchOptInSourcesAssociatedWithPhoneNumber()**](SMSApi.md#fetchOptInSourcesAssociatedWithPhoneNumber) | **GET** /v2/sms/phoneNumber/sources/{phoneNumberID} | Fetch opt in sources -[**fetchOutboundSMS()**](SMSApi.md#fetchOutboundSMS) | **GET** /v2/sms/outbound/{phoneNumberID} | Fetch outbound SMS -[**fetchOutboundSMSByPage()**](SMSApi.md#fetchOutboundSMSByPage) | **GET** /v2/sms/outbound/page/{phoneNumberID} | Fetch outbound SMSes by page -[**fetchPaymentObjectBroadcasts()**](SMSApi.md#fetchPaymentObjectBroadcasts) | **GET** /v2/sms/paymentObjectBroadcasts/{phoneNumberID} | Fetch payment object broadcasts -[**fetchSMSAgreement()**](SMSApi.md#fetchSMSAgreement) | **GET** /v2/sms/agreement | Accept SMS agreement (DEPRECATED) -[**importImportedListRecipients()**](SMSApi.md#importImportedListRecipients) | **POST** /v2/sms/importedList/recipients/import/{importedListID} | Import imported list recipients -[**importImportedListRecipientsFromMembershipTier()**](SMSApi.md#importImportedListRecipientsFromMembershipTier) | **POST** /v2/sms/importedList/recipients/import-from-tier | Import imported list recipients from a given membership tier -[**importOptInListSubscribers()**](SMSApi.md#importOptInListSubscribers) | **POST** /v2/sms/optInList/subscribers/import/{listID} | Import opt in list subscribers -[**restorePhoneNumber()**](SMSApi.md#restorePhoneNumber) | **PATCH** /v2/sms/phoneNumber/{phoneNumberID} | Restore phone number -[**restoreRecipient()**](SMSApi.md#restoreRecipient) | **PATCH** /v2/sms/importedList/recipients/{id} | Restore recipient -[**retrieveSentAndMaxCountOfMessages()**](SMSApi.md#retrieveSentAndMaxCountOfMessages) | **GET** /v2/sms/sent | Retrieve the number of messages sent by the merchant within the current billing cycle -[**saveImportedList()**](SMSApi.md#saveImportedList) | **PUT** /v2/sms/importedList/{listID} | Save imported list -[**saveOptInList()**](SMSApi.md#saveOptInList) | **PUT** /v2/sms/optInList/{listID} | Save opt in list -[**saveOptInListSource()**](SMSApi.md#saveOptInListSource) | **PUT** /v2/sms/optInListSource/{sourceID} | Save opt in list source -[**sendPhoneNumberForVerification()**](SMSApi.md#sendPhoneNumberForVerification) | **PUT** /v2/sms/phoneNumber/verification/{phoneNumberID} | Request phone number verification -[**updatePhoneNumber()**](SMSApi.md#updatePhoneNumber) | **PUT** /v2/sms/phoneNumber/{phoneNumberID} | Update phone number +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**acquirePhoneNumber()**](SMSApi.md#acquirePhoneNumber) | **POST** /v2/sms/phoneNumber/acquire | Acquire phone number | +| [**archivePhoneNumber()**](SMSApi.md#archivePhoneNumber) | **DELETE** /v2/sms/phoneNumber/{phoneNumberID} | Archive phone number | +| [**archiveRecipient()**](SMSApi.md#archiveRecipient) | **DELETE** /v2/sms/importedList/recipients/{id} | Archive recipient | +| [**countImportedListRecipients()**](SMSApi.md#countImportedListRecipients) | **GET** /v2/sms/importedList/recipients/count/{listID} | Count imported list recipients | +| [**countOptInListSubscribers()**](SMSApi.md#countOptInListSubscribers) | **GET** /v2/sms/optInList/subscribers/count/{listID} | Count opt in list subscribers | +| [**countOptInSourceSubscribers()**](SMSApi.md#countOptInSourceSubscribers) | **GET** /v2/sms/optInSource/subscribers/count/{sourceID} | Count opt in source subscribers | +| [**countOutboundSMS()**](SMSApi.md#countOutboundSMS) | **GET** /v2/sms/outbound/count/{phoneNumberID} | Count outbound SMS | +| [**createImportedList()**](SMSApi.md#createImportedList) | **POST** /v2/sms/importedList | Create imported list | +| [**createOptInList()**](SMSApi.md#createOptInList) | **POST** /v2/sms/optInList | Create opt in list | +| [**createOptInListSource()**](SMSApi.md#createOptInListSource) | **POST** /v2/sms/optInListSource | Send SMS to opt in list | +| [**createRecipientInImportedList()**](SMSApi.md#createRecipientInImportedList) | **POST** /v2/sms/importedList/recipients/create | Add new recipient in an imported list | +| [**exportImportedListRecipients()**](SMSApi.md#exportImportedListRecipients) | **POST** /v2/sms/importedList/recipients/export/{importedListID} | Export imported list recipients | +| [**exportOptInListSubscribers()**](SMSApi.md#exportOptInListSubscribers) | **POST** /v2/sms/optInList/subscribers/export/{listID} | Export opt in list subscribers | +| [**fetchBlockedTCPAEntries()**](SMSApi.md#fetchBlockedTCPAEntries) | **GET** /v2/sms/phoneNumber/blocked/{phoneNumberID} | Fetch blocked TCPA entries | +| [**fetchImportedListRecipients()**](SMSApi.md#fetchImportedListRecipients) | **GET** /v2/sms/importedList/recipients/{listID} | Fetch imported list recipients | +| [**fetchImportedListRecipientsByPage()**](SMSApi.md#fetchImportedListRecipientsByPage) | **GET** /v2/sms/importedList/recipients/page/{listID} | Fetch imported list recipients by page | +| [**fetchOptInListSources()**](SMSApi.md#fetchOptInListSources) | **GET** /v2/sms/optInListSources/all | Fetch all opt in list sources | +| [**fetchOptInListSubscribers()**](SMSApi.md#fetchOptInListSubscribers) | **GET** /v2/sms/optInList/subscribers/{listID} | Fetch opt in list subscribers | +| [**fetchOptInListSubscribersByPage()**](SMSApi.md#fetchOptInListSubscribersByPage) | **GET** /v2/sms/optInList/subscribers/page/{listID} | Fetch opt in list subscribers by page | +| [**fetchOptInListsAssociatedWithPhoneNumber()**](SMSApi.md#fetchOptInListsAssociatedWithPhoneNumber) | **GET** /v2/sms/phoneNumber/lists/{phoneNumberID} | Fetch opt in lists | +| [**fetchOptInSourceSubscribers()**](SMSApi.md#fetchOptInSourceSubscribers) | **GET** /v2/sms/optInSource/subscribers/{sourceID} | Fetch opt in source subscribers | +| [**fetchOptInSourcesAssociatedWithPhoneNumber()**](SMSApi.md#fetchOptInSourcesAssociatedWithPhoneNumber) | **GET** /v2/sms/phoneNumber/sources/{phoneNumberID} | Fetch opt in sources | +| [**fetchOutboundSMS()**](SMSApi.md#fetchOutboundSMS) | **GET** /v2/sms/outbound/{phoneNumberID} | Fetch outbound SMS | +| [**fetchOutboundSMSByPage()**](SMSApi.md#fetchOutboundSMSByPage) | **GET** /v2/sms/outbound/page/{phoneNumberID} | Fetch outbound SMSes by page | +| [**fetchPaymentObjectBroadcasts()**](SMSApi.md#fetchPaymentObjectBroadcasts) | **GET** /v2/sms/paymentObjectBroadcasts/{phoneNumberID} | Fetch payment object broadcasts | +| [**fetchSMSAgreement()**](SMSApi.md#fetchSMSAgreement) | **GET** /v2/sms/agreement | Accept SMS agreement (DEPRECATED) | +| [**importImportedListRecipients()**](SMSApi.md#importImportedListRecipients) | **POST** /v2/sms/importedList/recipients/import/{importedListID} | Import imported list recipients | +| [**importImportedListRecipientsFromMembershipTier()**](SMSApi.md#importImportedListRecipientsFromMembershipTier) | **POST** /v2/sms/importedList/recipients/import-from-tier | Import imported list recipients from a given membership tier | +| [**importOptInListSubscribers()**](SMSApi.md#importOptInListSubscribers) | **POST** /v2/sms/optInList/subscribers/import/{listID} | Import opt in list subscribers | +| [**restorePhoneNumber()**](SMSApi.md#restorePhoneNumber) | **PATCH** /v2/sms/phoneNumber/{phoneNumberID} | Restore phone number | +| [**restoreRecipient()**](SMSApi.md#restoreRecipient) | **PATCH** /v2/sms/importedList/recipients/{id} | Restore recipient | +| [**retrieveSentAndMaxCountOfMessages()**](SMSApi.md#retrieveSentAndMaxCountOfMessages) | **GET** /v2/sms/sent | Retrieve the number of messages sent by the merchant within the current billing cycle | +| [**saveImportedList()**](SMSApi.md#saveImportedList) | **PUT** /v2/sms/importedList/{listID} | Save imported list | +| [**saveOptInList()**](SMSApi.md#saveOptInList) | **PUT** /v2/sms/optInList/{listID} | Save opt in list | +| [**saveOptInListSource()**](SMSApi.md#saveOptInListSource) | **PUT** /v2/sms/optInListSource/{sourceID} | Save opt in list source | +| [**sendPhoneNumberForVerification()**](SMSApi.md#sendPhoneNumberForVerification) | **PUT** /v2/sms/phoneNumber/verification/{phoneNumberID} | Request phone number verification | +| [**updatePhoneNumber()**](SMSApi.md#updatePhoneNumber) | **PUT** /v2/sms/phoneNumber/{phoneNumberID} | Update phone number | ## `acquirePhoneNumber()` @@ -76,9 +76,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wtsms_acquire_phone_number** | [**\OpenAPI\Client\Model\WTSMSAcquirePhoneNumber**](../Model/WTSMSAcquirePhoneNumber.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wtsms_acquire_phone_number** | [**\OpenAPI\Client\Model\WTSMSAcquirePhoneNumber**](../Model/WTSMSAcquirePhoneNumber.md)| | | ### Return type @@ -130,9 +130,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | ### Return type @@ -184,9 +184,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | ### Return type @@ -241,12 +241,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **string**| | - **is_archive_included** | **bool**| | [optional] - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | **string**| | | +| **is_archive_included** | **bool**| | [optional] | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -303,14 +303,14 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **string**| | - **is_subscribed** | **bool**| | [optional] - **is_pending_age21_verification** | **bool**| | [optional] - **is_archive_included** | **bool**| | [optional] - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | **string**| | | +| **is_subscribed** | **bool**| | [optional] | +| **is_pending_age21_verification** | **bool**| | [optional] | +| **is_archive_included** | **bool**| | [optional] | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -367,14 +367,14 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **source_id** | **string**| | - **is_subscribed** | **bool**| | [optional] - **is_pending_age21_verification** | **bool**| | [optional] - **is_archive_included** | **bool**| | [optional] - **start_date** | **\DateTime**| | [optional] - **end_date** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **source_id** | **string**| | | +| **is_subscribed** | **bool**| | [optional] | +| **is_pending_age21_verification** | **bool**| | [optional] | +| **is_archive_included** | **bool**| | [optional] | +| **start_date** | **\DateTime**| | [optional] | +| **end_date** | **\DateTime**| | [optional] | ### Return type @@ -429,12 +429,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | - **to_phone_number** | **string**| | [optional] - **status** | **string**| | [optional] - **payment_object_broadcast_id** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | +| **to_phone_number** | **string**| | [optional] | +| **status** | **string**| | [optional] | +| **payment_object_broadcast_id** | **string**| | [optional] | ### Return type @@ -486,9 +486,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wtsms_imported_list_create** | [**\OpenAPI\Client\Model\WTSMSImportedListCreate**](../Model/WTSMSImportedListCreate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wtsms_imported_list_create** | [**\OpenAPI\Client\Model\WTSMSImportedListCreate**](../Model/WTSMSImportedListCreate.md)| | | ### Return type @@ -540,9 +540,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_opt_in_list_creation_params** | [**\OpenAPI\Client\Model\WTOptInListCreationParams**](../Model/WTOptInListCreationParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_opt_in_list_creation_params** | [**\OpenAPI\Client\Model\WTOptInListCreationParams**](../Model/WTOptInListCreationParams.md)| | | ### Return type @@ -594,9 +594,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wtsms_opt_in_list_source_create** | [**\OpenAPI\Client\Model\WTSMSOptInListSourceCreate**](../Model/WTSMSOptInListSourceCreate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wtsms_opt_in_list_source_create** | [**\OpenAPI\Client\Model\WTSMSOptInListSourceCreate**](../Model/WTSMSOptInListSourceCreate.md)| | | ### Return type @@ -648,9 +648,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ss_imported_list_recipient_create_params** | [**\OpenAPI\Client\Model\SSImportedListRecipientCreateParams**](../Model/SSImportedListRecipientCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ss_imported_list_recipient_create_params** | [**\OpenAPI\Client\Model\SSImportedListRecipientCreateParams**](../Model/SSImportedListRecipientCreateParams.md)| | | ### Return type @@ -702,9 +702,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **imported_list_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **imported_list_id** | **string**| | | ### Return type @@ -756,9 +756,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | **string**| | | ### Return type @@ -810,9 +810,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | ### Return type @@ -864,9 +864,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | **string**| | | ### Return type @@ -888,7 +888,7 @@ No authorization required ## `fetchImportedListRecipientsByPage()` ```php -fetchImportedListRecipientsByPage($list_id, $page_size, $page_num, $is_archive_included): \OpenAPI\Client\Model\InlineResponse2007 +fetchImportedListRecipientsByPage($list_id, $page_size, $page_num, $is_archive_included): \OpenAPI\Client\Model\FetchImportedListRecipientsByPage200Response ``` Fetch imported list recipients by page @@ -907,8 +907,8 @@ $apiInstance = new OpenAPI\Client\Api\SMSApi( new GuzzleHttp\Client() ); $list_id = 'list_id_example'; // string -$page_size = 3.4; // double -$page_num = 3.4; // double +$page_size = 3.4; // float +$page_num = 3.4; // float $is_archive_included = True; // bool try { @@ -921,16 +921,16 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **string**| | - **page_size** | **double**| | [optional] - **page_num** | **double**| | [optional] - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | **string**| | | +| **page_size** | **float**| | [optional] | +| **page_num** | **float**| | [optional] | +| **is_archive_included** | **bool**| | [optional] | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2007**](../Model/InlineResponse2007.md) +[**\OpenAPI\Client\Model\FetchImportedListRecipientsByPage200Response**](../Model/FetchImportedListRecipientsByPage200Response.md) ### Authorization @@ -978,9 +978,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -1035,12 +1035,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **string**| | - **is_subscribed** | **bool**| | [optional] - **is_pending_age21_verification** | **bool**| | [optional] - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | **string**| | | +| **is_subscribed** | **bool**| | [optional] | +| **is_pending_age21_verification** | **bool**| | [optional] | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -1062,7 +1062,7 @@ No authorization required ## `fetchOptInListSubscribersByPage()` ```php -fetchOptInListSubscribersByPage($list_id, $page_size, $page_num, $is_subscribed, $is_pending_age21_verification, $is_archive_included): \OpenAPI\Client\Model\InlineResponse2006 +fetchOptInListSubscribersByPage($list_id, $page_size, $page_num, $is_subscribed, $is_pending_age21_verification, $is_archive_included): \OpenAPI\Client\Model\FetchOptInListSubscribersByPage200Response ``` Fetch opt in list subscribers by page @@ -1081,8 +1081,8 @@ $apiInstance = new OpenAPI\Client\Api\SMSApi( new GuzzleHttp\Client() ); $list_id = 'list_id_example'; // string -$page_size = 3.4; // double -$page_num = 3.4; // double +$page_size = 3.4; // float +$page_num = 3.4; // float $is_subscribed = True; // bool $is_pending_age21_verification = True; // bool $is_archive_included = True; // bool @@ -1097,18 +1097,18 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **string**| | - **page_size** | **double**| | [optional] - **page_num** | **double**| | [optional] - **is_subscribed** | **bool**| | [optional] - **is_pending_age21_verification** | **bool**| | [optional] - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | **string**| | | +| **page_size** | **float**| | [optional] | +| **page_num** | **float**| | [optional] | +| **is_subscribed** | **bool**| | [optional] | +| **is_pending_age21_verification** | **bool**| | [optional] | +| **is_archive_included** | **bool**| | [optional] | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2006**](../Model/InlineResponse2006.md) +[**\OpenAPI\Client\Model\FetchOptInListSubscribersByPage200Response**](../Model/FetchOptInListSubscribersByPage200Response.md) ### Authorization @@ -1156,9 +1156,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | ### Return type @@ -1213,12 +1213,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **source_id** | **string**| | - **is_subscribed** | **bool**| | [optional] - **is_pending_age21_verification** | **bool**| | [optional] - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **source_id** | **string**| | | +| **is_subscribed** | **bool**| | [optional] | +| **is_pending_age21_verification** | **bool**| | [optional] | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -1270,9 +1270,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | ### Return type @@ -1327,12 +1327,12 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | - **to_phone_number** | **string**| | [optional] - **status** | **string**| | [optional] - **payment_object_broadcast_id** | **string**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | +| **to_phone_number** | **string**| | [optional] | +| **status** | **string**| | [optional] | +| **payment_object_broadcast_id** | **string**| | [optional] | ### Return type @@ -1354,7 +1354,7 @@ No authorization required ## `fetchOutboundSMSByPage()` ```php -fetchOutboundSMSByPage($phone_number_id, $to_phone_number, $payment_object_broadcast_id, $page_size, $page_num, $status): \OpenAPI\Client\Model\InlineResponse2005 +fetchOutboundSMSByPage($phone_number_id, $to_phone_number, $payment_object_broadcast_id, $page_size, $page_num, $status): \OpenAPI\Client\Model\FetchOutboundSMSByPage200Response ``` Fetch outbound SMSes by page @@ -1375,9 +1375,9 @@ $apiInstance = new OpenAPI\Client\Api\SMSApi( $phone_number_id = 'phone_number_id_example'; // string $to_phone_number = 'to_phone_number_example'; // string $payment_object_broadcast_id = 'payment_object_broadcast_id_example'; // string -$page_size = 3.4; // double -$page_num = 3.4; // double -$status = new \OpenAPI\Client\Model\\OpenAPI\Client\Model\SSOutboundStatuses(); // \OpenAPI\Client\Model\SSOutboundStatuses +$page_size = 3.4; // float +$page_num = 3.4; // float +$status = new \OpenAPI\Client\Model\SSOutboundStatuses(); // SSOutboundStatuses try { $result = $apiInstance->fetchOutboundSMSByPage($phone_number_id, $to_phone_number, $payment_object_broadcast_id, $page_size, $page_num, $status); @@ -1389,18 +1389,18 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | - **to_phone_number** | **string**| | [optional] - **payment_object_broadcast_id** | **string**| | [optional] - **page_size** | **double**| | [optional] - **page_num** | **double**| | [optional] - **status** | [**\OpenAPI\Client\Model\SSOutboundStatuses**](../Model/.md)| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | +| **to_phone_number** | **string**| | [optional] | +| **payment_object_broadcast_id** | **string**| | [optional] | +| **page_size** | **float**| | [optional] | +| **page_num** | **float**| | [optional] | +| **status** | [**SSOutboundStatuses**](../Model/.md)| | [optional] | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2005**](../Model/InlineResponse2005.md) +[**\OpenAPI\Client\Model\FetchOutboundSMSByPage200Response**](../Model/FetchOutboundSMSByPage200Response.md) ### Authorization @@ -1448,9 +1448,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | ### Return type @@ -1554,10 +1554,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **imported_list_id** | **string**| | - **wt_employee_import_records** | [**\OpenAPI\Client\Model\WTEmployeeImportRecords**](../Model/WTEmployeeImportRecords.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **imported_list_id** | **string**| | | +| **wt_employee_import_records** | [**\OpenAPI\Client\Model\WTEmployeeImportRecords**](../Model/WTEmployeeImportRecords.md)| | | ### Return type @@ -1609,9 +1609,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_imported_list_recipient_from_membership_tier_import** | [**\OpenAPI\Client\Model\WTImportedListRecipientFromMembershipTierImport**](../Model/WTImportedListRecipientFromMembershipTierImport.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_imported_list_recipient_from_membership_tier_import** | [**\OpenAPI\Client\Model\WTImportedListRecipientFromMembershipTierImport**](../Model/WTImportedListRecipientFromMembershipTierImport.md)| | | ### Return type @@ -1664,10 +1664,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **string**| | - **wtsms_import_opt_in_list_subscribers** | [**\OpenAPI\Client\Model\WTSMSImportOptInListSubscribers**](../Model/WTSMSImportOptInListSubscribers.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | **string**| | | +| **wtsms_import_opt_in_list_subscribers** | [**\OpenAPI\Client\Model\WTSMSImportOptInListSubscribers**](../Model/WTSMSImportOptInListSubscribers.md)| | | ### Return type @@ -1719,9 +1719,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | ### Return type @@ -1773,9 +1773,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | ### Return type @@ -1879,10 +1879,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **string**| | - **wtsms_imported_list_create** | [**\OpenAPI\Client\Model\WTSMSImportedListCreate**](../Model/WTSMSImportedListCreate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | **string**| | | +| **wtsms_imported_list_create** | [**\OpenAPI\Client\Model\WTSMSImportedListCreate**](../Model/WTSMSImportedListCreate.md)| | | ### Return type @@ -1935,10 +1935,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **string**| | - **wt_opt_in_list_creation_params** | [**\OpenAPI\Client\Model\WTOptInListCreationParams**](../Model/WTOptInListCreationParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **list_id** | **string**| | | +| **wt_opt_in_list_creation_params** | [**\OpenAPI\Client\Model\WTOptInListCreationParams**](../Model/WTOptInListCreationParams.md)| | | ### Return type @@ -1991,10 +1991,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **source_id** | **string**| | - **wtsms_opt_in_list_source_create** | [**\OpenAPI\Client\Model\WTSMSOptInListSourceCreate**](../Model/WTSMSOptInListSourceCreate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **source_id** | **string**| | | +| **wtsms_opt_in_list_source_create** | [**\OpenAPI\Client\Model\WTSMSOptInListSourceCreate**](../Model/WTSMSOptInListSourceCreate.md)| | | ### Return type @@ -2047,10 +2047,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | - **wtsms_update_phone_number_config** | [**\OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig**](../Model/WTSMSUpdatePhoneNumberConfig.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | +| **wtsms_update_phone_number_config** | [**\OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig**](../Model/WTSMSUpdatePhoneNumberConfig.md)| | | ### Return type @@ -2103,10 +2103,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **phone_number_id** | **string**| | - **wtsms_update_phone_number_config** | [**\OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig**](../Model/WTSMSUpdatePhoneNumberConfig.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **phone_number_id** | **string**| | | +| **wtsms_update_phone_number_config** | [**\OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig**](../Model/WTSMSUpdatePhoneNumberConfig.md)| | | ### Return type diff --git a/docs/Api/ServicesApi.md b/docs/Api/ServicesApi.md index 27af2e2..64311e4 100644 --- a/docs/Api/ServicesApi.md +++ b/docs/Api/ServicesApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\ServicesApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveService()**](ServicesApi.md#archiveService) | **DELETE** /v2/services/{id} | Archive service -[**createService()**](ServicesApi.md#createService) | **POST** /v2/services | Create service -[**fetchAllServices()**](ServicesApi.md#fetchAllServices) | **GET** /v2/services/all | Fetch all services -[**restoreService()**](ServicesApi.md#restoreService) | **PATCH** /v2/services/{id} | Restore service -[**updateService()**](ServicesApi.md#updateService) | **PUT** /v2/services/{id} | Update service +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveService()**](ServicesApi.md#archiveService) | **DELETE** /v2/services/{id} | Archive service | +| [**createService()**](ServicesApi.md#createService) | **POST** /v2/services | Create service | +| [**fetchAllServices()**](ServicesApi.md#fetchAllServices) | **GET** /v2/services/all | Fetch all services | +| [**restoreService()**](ServicesApi.md#restoreService) | **PATCH** /v2/services/{id} | Restore service | +| [**updateService()**](ServicesApi.md#updateService) | **PUT** /v2/services/{id} | Update service | ## `archiveService()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_service_create_params** | [**\OpenAPI\Client\Model\WTServiceCreateParams**](../Model/WTServiceCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_service_create_params** | [**\OpenAPI\Client\Model\WTServiceCreateParams**](../Model/WTServiceCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_service_update_params** | [**\OpenAPI\Client\Model\WTServiceUpdateParams**](../Model/WTServiceUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_service_update_params** | [**\OpenAPI\Client\Model\WTServiceUpdateParams**](../Model/WTServiceUpdateParams.md)| | | ### Return type diff --git a/docs/Api/SettingsApi.md b/docs/Api/SettingsApi.md index db0aeb7..11c383a 100644 --- a/docs/Api/SettingsApi.md +++ b/docs/Api/SettingsApi.md @@ -1,11 +1,11 @@ # OpenAPI\Client\SettingsApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getActiveCampaigns()**](SettingsApi.md#getActiveCampaigns) | **GET** /v2/settings/campaigns/active | Get active campaigns -[**getVouchersCount()**](SettingsApi.md#getVouchersCount) | **GET** /v2/settings/vouchers/count | Get vouchers count +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getActiveCampaigns()**](SettingsApi.md#getActiveCampaigns) | **GET** /v2/settings/campaigns/active | Get active campaigns | +| [**getVouchersCount()**](SettingsApi.md#getVouchersCount) | **GET** /v2/settings/vouchers/count | Get vouchers count | ## `getActiveCampaigns()` diff --git a/docs/Api/ShopifyTerminalApi.md b/docs/Api/ShopifyTerminalApi.md index d1806a9..e3fa3c1 100644 --- a/docs/Api/ShopifyTerminalApi.md +++ b/docs/Api/ShopifyTerminalApi.md @@ -1,12 +1,12 @@ # OpenAPI\Client\ShopifyTerminalApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchWalletItemFromShopifyTerminal()**](ShopifyTerminalApi.md#fetchWalletItemFromShopifyTerminal) | **GET** /v2/pos/shopify/item/{itemID} | Fetch item -[**redeemWalletItemFromShopifyTerminal()**](ShopifyTerminalApi.md#redeemWalletItemFromShopifyTerminal) | **POST** /v2/pos/shopify/item/redeem/{itemID} | Redeem item -[**refundWalletItemFromShopifyTerminal()**](ShopifyTerminalApi.md#refundWalletItemFromShopifyTerminal) | **POST** /v2/pos/shopify/item/refund/{ledgerEntryID} | Refund transaction +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchWalletItemFromShopifyTerminal()**](ShopifyTerminalApi.md#fetchWalletItemFromShopifyTerminal) | **GET** /v2/pos/shopify/item/{itemID} | Fetch item | +| [**redeemWalletItemFromShopifyTerminal()**](ShopifyTerminalApi.md#redeemWalletItemFromShopifyTerminal) | **POST** /v2/pos/shopify/item/redeem/{itemID} | Redeem item | +| [**refundWalletItemFromShopifyTerminal()**](ShopifyTerminalApi.md#refundWalletItemFromShopifyTerminal) | **POST** /v2/pos/shopify/item/refund/{ledgerEntryID} | Refund transaction | ## `fetchWalletItemFromShopifyTerminal()` @@ -42,9 +42,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | ### Return type @@ -97,10 +97,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | - **wt_wallet_item_redemption** | [**\OpenAPI\Client\Model\WTWalletItemRedemption**](../Model/WTWalletItemRedemption.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | +| **wt_wallet_item_redemption** | [**\OpenAPI\Client\Model\WTWalletItemRedemption**](../Model/WTWalletItemRedemption.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ledger_entry_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ledger_entry_id** | **string**| | | ### Return type diff --git a/docs/Api/SmsSubscriberApi.md b/docs/Api/SmsSubscriberApi.md new file mode 100644 index 0000000..b568d1a --- /dev/null +++ b/docs/Api/SmsSubscriberApi.md @@ -0,0 +1,288 @@ +# OpenAPI\Client\SmsSubscriberApi + +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveSmsSubscriber()**](SmsSubscriberApi.md#archiveSmsSubscriber) | **DELETE** /v2/SmsSubscriber/{id} | Archive email subscriber | +| [**createSmsSubscriber()**](SmsSubscriberApi.md#createSmsSubscriber) | **POST** /v2/SmsSubscriber | Create email subscriber | +| [**fetchAllSmsSubscribers()**](SmsSubscriberApi.md#fetchAllSmsSubscribers) | **GET** /v2/SmsSubscriber/all | Fetch all email subscribers | +| [**restoreSmsSubscriber()**](SmsSubscriberApi.md#restoreSmsSubscriber) | **PATCH** /v2/SmsSubscriber/{id} | Restore email subscriber | +| [**updateSmsSubscriber()**](SmsSubscriberApi.md#updateSmsSubscriber) | **PUT** /v2/SmsSubscriber/{id} | Update email subscriber | + + +## `archiveSmsSubscriber()` + +```php +archiveSmsSubscriber($id): \OpenAPI\Client\Model\SmsSubscriber +``` + +Archive email subscriber + +### Example + +```php +archiveSmsSubscriber($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SmsSubscriberApi->archiveSmsSubscriber: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | + +### Return type + +[**\OpenAPI\Client\Model\SmsSubscriber**](../Model/SmsSubscriber.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `createSmsSubscriber()` + +```php +createSmsSubscriber($wt_sms_subscriber_create_params): \OpenAPI\Client\Model\SmsSubscriber +``` + +Create email subscriber + +### Example + +```php +createSmsSubscriber($wt_sms_subscriber_create_params); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SmsSubscriberApi->createSmsSubscriber: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_sms_subscriber_create_params** | [**\OpenAPI\Client\Model\WTSmsSubscriberCreateParams**](../Model/WTSmsSubscriberCreateParams.md)| | | + +### Return type + +[**\OpenAPI\Client\Model\SmsSubscriber**](../Model/SmsSubscriber.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `fetchAllSmsSubscribers()` + +```php +fetchAllSmsSubscribers($start_date_time, $end_date_time, $is_archive_included): mixed +``` + +Fetch all email subscribers + +### Example + +```php +fetchAllSmsSubscribers($start_date_time, $end_date_time, $is_archive_included); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SmsSubscriberApi->fetchAllSmsSubscribers: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | [optional] | +| **end_date_time** | **\DateTime**| | [optional] | +| **is_archive_included** | **bool**| | [optional] | + +### Return type + +**mixed** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `restoreSmsSubscriber()` + +```php +restoreSmsSubscriber($id): \OpenAPI\Client\Model\SmsSubscriber +``` + +Restore email subscriber + +### Example + +```php +restoreSmsSubscriber($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SmsSubscriberApi->restoreSmsSubscriber: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | + +### Return type + +[**\OpenAPI\Client\Model\SmsSubscriber**](../Model/SmsSubscriber.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateSmsSubscriber()` + +```php +updateSmsSubscriber($id, $wt_sms_subscriber_update_params): \OpenAPI\Client\Model\SmsSubscriber +``` + +Update email subscriber + +### Example + +```php +updateSmsSubscriber($id, $wt_sms_subscriber_update_params); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SmsSubscriberApi->updateSmsSubscriber: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_sms_subscriber_update_params** | [**\OpenAPI\Client\Model\WTSmsSubscriberUpdateParams**](../Model/WTSmsSubscriberUpdateParams.md)| | | + +### Return type + +[**\OpenAPI\Client\Model\SmsSubscriber**](../Model/SmsSubscriber.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/docs/Api/StaticVoucherCampaignGroupsApi.md b/docs/Api/StaticVoucherCampaignGroupsApi.md index 757616f..9985a0a 100644 --- a/docs/Api/StaticVoucherCampaignGroupsApi.md +++ b/docs/Api/StaticVoucherCampaignGroupsApi.md @@ -1,10 +1,10 @@ # OpenAPI\Client\StaticVoucherCampaignGroupsApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchStaticVoucherCampaignGroups()**](StaticVoucherCampaignGroupsApi.md#fetchStaticVoucherCampaignGroups) | **GET** /v2/payment/staticVoucherCampaignGroups/campaigns/{campaignsGroupID} | Fetch all campaigns +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchStaticVoucherCampaignGroups()**](StaticVoucherCampaignGroupsApi.md#fetchStaticVoucherCampaignGroups) | **GET** /v2/payment/staticVoucherCampaignGroups/campaigns/{campaignsGroupID} | Fetch all campaigns | ## `fetchStaticVoucherCampaignGroups()` @@ -40,9 +40,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaigns_group_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaigns_group_id** | [**mixed**](../Model/.md)| | | ### Return type diff --git a/docs/Api/StaticVoucherCampaignsApi.md b/docs/Api/StaticVoucherCampaignsApi.md index 682b67b..69142a4 100644 --- a/docs/Api/StaticVoucherCampaignsApi.md +++ b/docs/Api/StaticVoucherCampaignsApi.md @@ -1,30 +1,30 @@ # OpenAPI\Client\StaticVoucherCampaignsApi -All URIs are relative to https://api.wall.et. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveStaticVoucherCampaign()**](StaticVoucherCampaignsApi.md#archiveStaticVoucherCampaign) | **DELETE** /v2/payment/staticVoucherCampaign/{campaignID} | Archive static voucher campaign -[**countVouchersLoaded()**](StaticVoucherCampaignsApi.md#countVouchersLoaded) | **GET** /v2/payment/staticVoucherCampaign/count/vouchers/loaded/{campaignID} | Count loaded vouchers -[**countVouchersRedeemed()**](StaticVoucherCampaignsApi.md#countVouchersRedeemed) | **GET** /v2/payment/staticVoucherCampaign/count/vouchers/redeemed/{campaignID} | Count redeemed vouchers -[**createStaticVoucherCampaign()**](StaticVoucherCampaignsApi.md#createStaticVoucherCampaign) | **POST** /v2/payment/staticVoucherCampaign | Create static voucher campaign -[**createStaticVoucherCampaignFromCSV()**](StaticVoucherCampaignsApi.md#createStaticVoucherCampaignFromCSV) | **POST** /v2/payment/staticVoucherCampaign/csv | Import static voucher campaign -[**createStaticVoucherCampaignWithVoucher()**](StaticVoucherCampaignsApi.md#createStaticVoucherCampaignWithVoucher) | **POST** /v2/payment/staticVoucherCampaign/voucher | Create static voucher campaign with voucher -[**duplicateStaticVoucherCampaignById()**](StaticVoucherCampaignsApi.md#duplicateStaticVoucherCampaignById) | **POST** /v2/payment/staticVoucherCampaign/duplicate/{campaignID} | Duplicate static voucher campaign -[**fetchPerformanceOverview()**](StaticVoucherCampaignsApi.md#fetchPerformanceOverview) | **GET** /v2/payment/staticVoucherCampaign/overview/performance/{campaignID} | Fetch performance overview -[**fetchReachStatsOfAllStaticVoucherCampaigns()**](StaticVoucherCampaignsApi.md#fetchReachStatsOfAllStaticVoucherCampaigns) | **GET** /v2/payment/staticVoucherCampaign/reach/all | Get the reach statistics of all the static voucher campaigns -[**fetchReachStatsOfIndividualStaticVoucherCampaign()**](StaticVoucherCampaignsApi.md#fetchReachStatsOfIndividualStaticVoucherCampaign) | **GET** /v2/payment/staticVoucherCampaign/reach/{staticVoucherCampaignID} | Get the reach statistics of an individual static voucher campaign -[**fetchStaticVoucherCampaignById()**](StaticVoucherCampaignsApi.md#fetchStaticVoucherCampaignById) | **GET** /v2/payment/staticVoucherCampaign/{id} | Fetch static voucher campaign -[**fetchStaticVoucherCampaigns()**](StaticVoucherCampaignsApi.md#fetchStaticVoucherCampaigns) | **GET** /v2/payment/staticVoucherCampaign/all | Fetches all static vouchers campaigns -[**fetchStaticVouchers()**](StaticVoucherCampaignsApi.md#fetchStaticVouchers) | **GET** /v2/payment/staticVoucherCampaign/staticVouchers/{campaignID} | Fetch static vouchers -[**fetchStaticVouchersPage()**](StaticVoucherCampaignsApi.md#fetchStaticVouchersPage) | **GET** /v2/payment/staticVoucherCampaign/staticVouchers/page/{campaignID} | Fetch static vouchers by page -[**fetchViews()**](StaticVoucherCampaignsApi.md#fetchViews) | **GET** /v2/payment/staticVoucherCampaign/views/{campaignID} | Fetch views -[**fetchVouchersRedeemed()**](StaticVoucherCampaignsApi.md#fetchVouchersRedeemed) | **GET** /v2/payment/staticVoucherCampaign/vouchers/redeemed/{campaignID} | Fetch redeemed vouchers -[**previewMessages()**](StaticVoucherCampaignsApi.md#previewMessages) | **PUT** /v2/payment/staticVoucherCampaign/preview/{campaignID} | Preview static vouchers. This method has been deprecated. Please use /preview/page/{campaignID} for better performance. -[**previewMessagesByPage()**](StaticVoucherCampaignsApi.md#previewMessagesByPage) | **PUT** /v2/payment/staticVoucherCampaign/preview/page/{campaignID} | Preview static vouchers by page -[**restoreStaticVoucherCampaign()**](StaticVoucherCampaignsApi.md#restoreStaticVoucherCampaign) | **PATCH** /v2/payment/staticVoucherCampaign/{campaignID} | Restore static voucher campaign -[**updateStaticVoucherCampaign()**](StaticVoucherCampaignsApi.md#updateStaticVoucherCampaign) | **PUT** /v2/payment/staticVoucherCampaign/{campaignID} | Update static voucher campaign -[**updateStaticVoucherCampaignWithVoucher()**](StaticVoucherCampaignsApi.md#updateStaticVoucherCampaignWithVoucher) | **PUT** /v2/payment/staticVoucherCampaign/voucher/{campaignID} | Update static voucher campaign with voucher +All URIs are relative to https://api.wall.et, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveStaticVoucherCampaign()**](StaticVoucherCampaignsApi.md#archiveStaticVoucherCampaign) | **DELETE** /v2/payment/staticVoucherCampaign/{campaignID} | Archive static voucher campaign | +| [**countVouchersLoaded()**](StaticVoucherCampaignsApi.md#countVouchersLoaded) | **GET** /v2/payment/staticVoucherCampaign/count/vouchers/loaded/{campaignID} | Count loaded vouchers | +| [**countVouchersRedeemed()**](StaticVoucherCampaignsApi.md#countVouchersRedeemed) | **GET** /v2/payment/staticVoucherCampaign/count/vouchers/redeemed/{campaignID} | Count redeemed vouchers | +| [**createStaticVoucherCampaign()**](StaticVoucherCampaignsApi.md#createStaticVoucherCampaign) | **POST** /v2/payment/staticVoucherCampaign | Create static voucher campaign | +| [**createStaticVoucherCampaignFromCSV()**](StaticVoucherCampaignsApi.md#createStaticVoucherCampaignFromCSV) | **POST** /v2/payment/staticVoucherCampaign/csv | Import static voucher campaign | +| [**createStaticVoucherCampaignWithVoucher()**](StaticVoucherCampaignsApi.md#createStaticVoucherCampaignWithVoucher) | **POST** /v2/payment/staticVoucherCampaign/voucher | Create static voucher campaign with voucher | +| [**duplicateStaticVoucherCampaignById()**](StaticVoucherCampaignsApi.md#duplicateStaticVoucherCampaignById) | **POST** /v2/payment/staticVoucherCampaign/duplicate/{campaignID} | Duplicate static voucher campaign | +| [**fetchPerformanceOverview()**](StaticVoucherCampaignsApi.md#fetchPerformanceOverview) | **GET** /v2/payment/staticVoucherCampaign/overview/performance/{campaignID} | Fetch performance overview | +| [**fetchReachStatsOfAllStaticVoucherCampaigns()**](StaticVoucherCampaignsApi.md#fetchReachStatsOfAllStaticVoucherCampaigns) | **GET** /v2/payment/staticVoucherCampaign/reach/all | Get the reach statistics of all the static voucher campaigns | +| [**fetchReachStatsOfIndividualStaticVoucherCampaign()**](StaticVoucherCampaignsApi.md#fetchReachStatsOfIndividualStaticVoucherCampaign) | **GET** /v2/payment/staticVoucherCampaign/reach/{staticVoucherCampaignID} | Get the reach statistics of an individual static voucher campaign | +| [**fetchStaticVoucherCampaignById()**](StaticVoucherCampaignsApi.md#fetchStaticVoucherCampaignById) | **GET** /v2/payment/staticVoucherCampaign/{id} | Fetch static voucher campaign | +| [**fetchStaticVoucherCampaigns()**](StaticVoucherCampaignsApi.md#fetchStaticVoucherCampaigns) | **GET** /v2/payment/staticVoucherCampaign/all | Fetches all static vouchers campaigns | +| [**fetchStaticVouchers()**](StaticVoucherCampaignsApi.md#fetchStaticVouchers) | **GET** /v2/payment/staticVoucherCampaign/staticVouchers/{campaignID} | Fetch static vouchers | +| [**fetchStaticVouchersPage()**](StaticVoucherCampaignsApi.md#fetchStaticVouchersPage) | **GET** /v2/payment/staticVoucherCampaign/staticVouchers/page/{campaignID} | Fetch static vouchers by page | +| [**fetchViews()**](StaticVoucherCampaignsApi.md#fetchViews) | **GET** /v2/payment/staticVoucherCampaign/views/{campaignID} | Fetch views | +| [**fetchVouchersRedeemed()**](StaticVoucherCampaignsApi.md#fetchVouchersRedeemed) | **GET** /v2/payment/staticVoucherCampaign/vouchers/redeemed/{campaignID} | Fetch redeemed vouchers | +| [**previewMessages()**](StaticVoucherCampaignsApi.md#previewMessages) | **PUT** /v2/payment/staticVoucherCampaign/preview/{campaignID} | Preview static vouchers. This method has been deprecated. Please use /preview/page/{campaignID} for better performance. | +| [**previewMessagesByPage()**](StaticVoucherCampaignsApi.md#previewMessagesByPage) | **PUT** /v2/payment/staticVoucherCampaign/preview/page/{campaignID} | Preview static vouchers by page | +| [**restoreStaticVoucherCampaign()**](StaticVoucherCampaignsApi.md#restoreStaticVoucherCampaign) | **PATCH** /v2/payment/staticVoucherCampaign/{campaignID} | Restore static voucher campaign | +| [**updateStaticVoucherCampaign()**](StaticVoucherCampaignsApi.md#updateStaticVoucherCampaign) | **PUT** /v2/payment/staticVoucherCampaign/{campaignID} | Update static voucher campaign | +| [**updateStaticVoucherCampaignWithVoucher()**](StaticVoucherCampaignsApi.md#updateStaticVoucherCampaignWithVoucher) | **PUT** /v2/payment/staticVoucherCampaign/voucher/{campaignID} | Update static voucher campaign with voucher | ## `archiveStaticVoucherCampaign()` @@ -60,9 +60,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -84,7 +84,7 @@ No authorization required ## `countVouchersLoaded()` ```php -countVouchersLoaded($campaign_id): \OpenAPI\Client\Model\InlineResponse2003 +countVouchersLoaded($campaign_id): \OpenAPI\Client\Model\FetchMembersCount200Response ``` Count loaded vouchers @@ -114,13 +114,13 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2003**](../Model/InlineResponse2003.md) +[**\OpenAPI\Client\Model\FetchMembersCount200Response**](../Model/FetchMembersCount200Response.md) ### Authorization @@ -138,7 +138,7 @@ No authorization required ## `countVouchersRedeemed()` ```php -countVouchersRedeemed($campaign_id): \OpenAPI\Client\Model\InlineResponse2003 +countVouchersRedeemed($campaign_id): \OpenAPI\Client\Model\FetchMembersCount200Response ``` Count redeemed vouchers @@ -168,13 +168,13 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2003**](../Model/InlineResponse2003.md) +[**\OpenAPI\Client\Model\FetchMembersCount200Response**](../Model/FetchMembersCount200Response.md) ### Authorization @@ -222,9 +222,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_static_voucher_campaign** | [**\OpenAPI\Client\Model\CreateStaticVoucherCampaign**](../Model/CreateStaticVoucherCampaign.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **create_static_voucher_campaign** | [**\OpenAPI\Client\Model\CreateStaticVoucherCampaign**](../Model/CreateStaticVoucherCampaign.md)| | | ### Return type @@ -276,9 +276,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_static_voucher_campaign_with_voucher_with_csv** | [**\OpenAPI\Client\Model\CreateStaticVoucherCampaignWithVoucherWithCSV**](../Model/CreateStaticVoucherCampaignWithVoucherWithCSV.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **create_static_voucher_campaign_with_voucher_with_csv** | [**\OpenAPI\Client\Model\CreateStaticVoucherCampaignWithVoucherWithCSV**](../Model/CreateStaticVoucherCampaignWithVoucherWithCSV.md)| | | ### Return type @@ -330,9 +330,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **\OpenAPI\Client\Model\PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **body** | **\OpenAPI\Client\Model\PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive**| | | ### Return type @@ -384,9 +384,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -438,9 +438,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -493,10 +493,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **broadcast_scheduled_start_at** | **\DateTime**| | [optional] - **broadcast_scheduled_end_at** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **broadcast_scheduled_start_at** | **\DateTime**| | [optional] | +| **broadcast_scheduled_end_at** | **\DateTime**| | [optional] | ### Return type @@ -550,11 +550,11 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **static_voucher_campaign_id** | [**mixed**](../Model/.md)| | - **broadcast_scheduled_start_at** | **\DateTime**| | [optional] - **broadcast_scheduled_end_at** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **static_voucher_campaign_id** | [**mixed**](../Model/.md)| | | +| **broadcast_scheduled_start_at** | **\DateTime**| | [optional] | +| **broadcast_scheduled_end_at** | **\DateTime**| | [optional] | ### Return type @@ -606,9 +606,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -649,7 +649,7 @@ $apiInstance = new OpenAPI\Client\Api\StaticVoucherCampaignsApi( new GuzzleHttp\Client() ); $is_archive_included = True; // bool -$source_id = 3.4; // double +$source_id = 3.4; // float try { $result = $apiInstance->fetchStaticVoucherCampaigns($is_archive_included, $source_id); @@ -661,10 +661,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] - **source_id** | **double**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | +| **source_id** | **float**| | [optional] | ### Return type @@ -716,9 +716,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -740,7 +740,7 @@ No authorization required ## `fetchStaticVouchersPage()` ```php -fetchStaticVouchersPage($campaign_id, $pagenum, $pagesize): \OpenAPI\Client\Model\InlineResponse2008 +fetchStaticVouchersPage($campaign_id, $pagenum, $pagesize): \OpenAPI\Client\Model\FetchStaticVouchersPage200Response ``` Fetch static vouchers by page @@ -759,8 +759,8 @@ $apiInstance = new OpenAPI\Client\Api\StaticVoucherCampaignsApi( new GuzzleHttp\Client() ); $campaign_id = NULL; // mixed -$pagenum = 3.4; // double -$pagesize = 3.4; // double +$pagenum = 3.4; // float +$pagesize = 3.4; // float try { $result = $apiInstance->fetchStaticVouchersPage($campaign_id, $pagenum, $pagesize); @@ -772,15 +772,15 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | - **pagenum** | **double**| | - **pagesize** | **double**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | +| **pagenum** | **float**| | | +| **pagesize** | **float**| | | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2008**](../Model/InlineResponse2008.md) +[**\OpenAPI\Client\Model\FetchStaticVouchersPage200Response**](../Model/FetchStaticVouchersPage200Response.md) ### Authorization @@ -828,9 +828,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -882,9 +882,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -937,10 +937,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | - **wt_static_voucher_campaign_preview_messages** | [**\OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessages**](../Model/WTStaticVoucherCampaignPreviewMessages.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | +| **wt_static_voucher_campaign_preview_messages** | [**\OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessages**](../Model/WTStaticVoucherCampaignPreviewMessages.md)| | | ### Return type @@ -993,10 +993,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | - **wt_static_voucher_campaign_preview_messages_by_page** | [**\OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessagesByPage**](../Model/WTStaticVoucherCampaignPreviewMessagesByPage.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | +| **wt_static_voucher_campaign_preview_messages_by_page** | [**\OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessagesByPage**](../Model/WTStaticVoucherCampaignPreviewMessagesByPage.md)| | | ### Return type @@ -1048,9 +1048,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | ### Return type @@ -1103,10 +1103,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | - **static_voucher_campaign_update** | [**\OpenAPI\Client\Model\StaticVoucherCampaignUpdate**](../Model/StaticVoucherCampaignUpdate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | +| **static_voucher_campaign_update** | [**\OpenAPI\Client\Model\StaticVoucherCampaignUpdate**](../Model/StaticVoucherCampaignUpdate.md)| | | ### Return type @@ -1159,10 +1159,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | [**mixed**](../Model/.md)| | - **update_static_voucher_campaign_with_voucher** | [**\OpenAPI\Client\Model\UpdateStaticVoucherCampaignWithVoucher**](../Model/UpdateStaticVoucherCampaignWithVoucher.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **campaign_id** | [**mixed**](../Model/.md)| | | +| **update_static_voucher_campaign_with_voucher** | [**\OpenAPI\Client\Model\UpdateStaticVoucherCampaignWithVoucher**](../Model/UpdateStaticVoucherCampaignWithVoucher.md)| | | ### Return type diff --git a/docs/Api/StaticVouchersApi.md b/docs/Api/StaticVouchersApi.md index 7c1fd78..f9af507 100644 --- a/docs/Api/StaticVouchersApi.md +++ b/docs/Api/StaticVouchersApi.md @@ -1,15 +1,15 @@ # OpenAPI\Client\StaticVouchersApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createStaticVoucher()**](StaticVouchersApi.md#createStaticVoucher) | **POST** /v2/payment/staticVoucher | Create static voucher -[**deleteStaticVoucher()**](StaticVouchersApi.md#deleteStaticVoucher) | **DELETE** /v2/payment/staticVoucher/{id} | Delete static voucher -[**fetchReachStatsOfAllStaticVouchers()**](StaticVouchersApi.md#fetchReachStatsOfAllStaticVouchers) | **GET** /v2/payment/staticVoucher/reach/all | Get the reach statistics of all the static vouchers -[**fetchReachStatsOfIndividualStaticVoucher()**](StaticVouchersApi.md#fetchReachStatsOfIndividualStaticVoucher) | **GET** /v2/payment/staticVoucher/reach/{staticVoucherID} | Get the reach statistics of an individual static voucher -[**fetchStaticVoucher()**](StaticVouchersApi.md#fetchStaticVoucher) | **GET** /v2/payment/staticVoucher/{id} | Fetch static voucher -[**updateStaticVoucher()**](StaticVouchersApi.md#updateStaticVoucher) | **PUT** /v2/payment/staticVoucher/{id} | Update static voucher +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createStaticVoucher()**](StaticVouchersApi.md#createStaticVoucher) | **POST** /v2/payment/staticVoucher | Create static voucher | +| [**deleteStaticVoucher()**](StaticVouchersApi.md#deleteStaticVoucher) | **DELETE** /v2/payment/staticVoucher/{id} | Delete static voucher | +| [**fetchReachStatsOfAllStaticVouchers()**](StaticVouchersApi.md#fetchReachStatsOfAllStaticVouchers) | **GET** /v2/payment/staticVoucher/reach/all | Get the reach statistics of all the static vouchers | +| [**fetchReachStatsOfIndividualStaticVoucher()**](StaticVouchersApi.md#fetchReachStatsOfIndividualStaticVoucher) | **GET** /v2/payment/staticVoucher/reach/{staticVoucherID} | Get the reach statistics of an individual static voucher | +| [**fetchStaticVoucher()**](StaticVouchersApi.md#fetchStaticVoucher) | **GET** /v2/payment/staticVoucher/{id} | Fetch static voucher | +| [**updateStaticVoucher()**](StaticVouchersApi.md#updateStaticVoucher) | **PUT** /v2/payment/staticVoucher/{id} | Update static voucher | ## `createStaticVoucher()` @@ -45,9 +45,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_static_voucher_create_params** | [**\OpenAPI\Client\Model\WTStaticVoucherCreateParams**](../Model/WTStaticVoucherCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_static_voucher_create_params** | [**\OpenAPI\Client\Model\WTStaticVoucherCreateParams**](../Model/WTStaticVoucherCreateParams.md)| | | ### Return type @@ -99,9 +99,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -154,10 +154,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **broadcast_scheduled_start_at** | **\DateTime**| | [optional] - **broadcast_scheduled_end_at** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **broadcast_scheduled_start_at** | **\DateTime**| | [optional] | +| **broadcast_scheduled_end_at** | **\DateTime**| | [optional] | ### Return type @@ -211,11 +211,11 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **static_voucher_id** | [**mixed**](../Model/.md)| | - **broadcast_scheduled_start_at** | **\DateTime**| | [optional] - **broadcast_scheduled_end_at** | **\DateTime**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **static_voucher_id** | [**mixed**](../Model/.md)| | | +| **broadcast_scheduled_start_at** | **\DateTime**| | [optional] | +| **broadcast_scheduled_end_at** | **\DateTime**| | [optional] | ### Return type @@ -267,9 +267,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -322,10 +322,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_static_voucher_update_params** | [**\OpenAPI\Client\Model\WTStaticVoucherUpdateParams**](../Model/WTStaticVoucherUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_static_voucher_update_params** | [**\OpenAPI\Client\Model\WTStaticVoucherUpdateParams**](../Model/WTStaticVoucherUpdateParams.md)| | | ### Return type diff --git a/docs/Api/SystemApi.md b/docs/Api/SystemApi.md index feb8177..726e400 100644 --- a/docs/Api/SystemApi.md +++ b/docs/Api/SystemApi.md @@ -1,17 +1,17 @@ # OpenAPI\Client\SystemApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createRole()**](SystemApi.md#createRole) | **POST** /v2/system/roles | Create role -[**deleteRole()**](SystemApi.md#deleteRole) | **DELETE** /v2/system/roles/{roleID} | Delete role -[**fetchAuditLogOfRoles()**](SystemApi.md#fetchAuditLogOfRoles) | **GET** /v2/system/roles/auditLog | Fetch role's audit log -[**fetchEmployeesWithRole()**](SystemApi.md#fetchEmployeesWithRole) | **GET** /v2/system/roles/employees/{roleID} | Fetch employees with role -[**fetchWebpagesForRole()**](SystemApi.md#fetchWebpagesForRole) | **GET** /v2/system/roles/webpages/{roleID} | Fetch webpages for role -[**getPaymentPrefixes()**](SystemApi.md#getPaymentPrefixes) | **GET** /v2/system/prefixes | Get payment prefixes -[**loadRole()**](SystemApi.md#loadRole) | **GET** /v2/system/roles/{roleID} | Fetch role -[**saveRole()**](SystemApi.md#saveRole) | **PUT** /v2/system/roles/{roleID} | Update role +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createRole()**](SystemApi.md#createRole) | **POST** /v2/system/roles | Create role | +| [**deleteRole()**](SystemApi.md#deleteRole) | **DELETE** /v2/system/roles/{roleID} | Delete role | +| [**fetchAuditLogOfRoles()**](SystemApi.md#fetchAuditLogOfRoles) | **GET** /v2/system/roles/auditLog | Fetch role's audit log | +| [**fetchEmployeesWithRole()**](SystemApi.md#fetchEmployeesWithRole) | **GET** /v2/system/roles/employees/{roleID} | Fetch employees with role | +| [**fetchWebpagesForRole()**](SystemApi.md#fetchWebpagesForRole) | **GET** /v2/system/roles/webpages/{roleID} | Fetch webpages for role | +| [**getPaymentPrefixes()**](SystemApi.md#getPaymentPrefixes) | **GET** /v2/system/prefixes | Get payment prefixes | +| [**loadRole()**](SystemApi.md#loadRole) | **GET** /v2/system/roles/{roleID} | Fetch role | +| [**saveRole()**](SystemApi.md#saveRole) | **PUT** /v2/system/roles/{roleID} | Update role | ## `createRole()` @@ -47,9 +47,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_system_role_create** | [**\OpenAPI\Client\Model\WTSystemRoleCreate**](../Model/WTSystemRoleCreate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_system_role_create** | [**\OpenAPI\Client\Model\WTSystemRoleCreate**](../Model/WTSystemRoleCreate.md)| | | ### Return type @@ -101,9 +101,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **role_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **role_id** | **string**| | | ### Return type @@ -156,10 +156,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | ### Return type @@ -211,9 +211,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **role_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **role_id** | **string**| | | ### Return type @@ -265,9 +265,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **role_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **role_id** | **string**| | | ### Return type @@ -370,9 +370,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **role_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **role_id** | **string**| | | ### Return type @@ -425,10 +425,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **role_id** | **string**| | - **wt_system_role_create** | [**\OpenAPI\Client\Model\WTSystemRoleCreate**](../Model/WTSystemRoleCreate.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **role_id** | **string**| | | +| **wt_system_role_create** | [**\OpenAPI\Client\Model\WTSystemRoleCreate**](../Model/WTSystemRoleCreate.md)| | | ### Return type diff --git a/docs/Api/TicketApi.md b/docs/Api/TicketApi.md index 8300b16..8cc7f95 100644 --- a/docs/Api/TicketApi.md +++ b/docs/Api/TicketApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\TicketApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveTicket()**](TicketApi.md#archiveTicket) | **DELETE** /v2/ticket/{id} | Archive ticket -[**createTicket()**](TicketApi.md#createTicket) | **POST** /v2/ticket | Create ticket -[**fetchTicket()**](TicketApi.md#fetchTicket) | **GET** /v2/ticket/{id} | Fetch ticket -[**restoreTicket()**](TicketApi.md#restoreTicket) | **PATCH** /v2/ticket/{id} | Restore ticket -[**updateTicket()**](TicketApi.md#updateTicket) | **PUT** /v2/ticket/{id} | Update ticket +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveTicket()**](TicketApi.md#archiveTicket) | **DELETE** /v2/ticket/{id} | Archive ticket | +| [**createTicket()**](TicketApi.md#createTicket) | **POST** /v2/ticket | Create ticket | +| [**fetchTicket()**](TicketApi.md#fetchTicket) | **GET** /v2/ticket/{id} | Fetch ticket | +| [**restoreTicket()**](TicketApi.md#restoreTicket) | **PATCH** /v2/ticket/{id} | Restore ticket | +| [**updateTicket()**](TicketApi.md#updateTicket) | **PUT** /v2/ticket/{id} | Update ticket | ## `archiveTicket()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_ticket_create_params** | [**\OpenAPI\Client\Model\WTTicketCreateParams**](../Model/WTTicketCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_ticket_create_params** | [**\OpenAPI\Client\Model\WTTicketCreateParams**](../Model/WTTicketCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_ticket_update_params** | [**\OpenAPI\Client\Model\WTTicketUpdateParams**](../Model/WTTicketUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_ticket_update_params** | [**\OpenAPI\Client\Model\WTTicketUpdateParams**](../Model/WTTicketUpdateParams.md)| | | ### Return type diff --git a/docs/Api/TransactionLedgerApi.md b/docs/Api/TransactionLedgerApi.md index 1aaf5a9..b995c69 100644 --- a/docs/Api/TransactionLedgerApi.md +++ b/docs/Api/TransactionLedgerApi.md @@ -1,16 +1,16 @@ # OpenAPI\Client\TransactionLedgerApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchAllLedgerTransactions()**](TransactionLedgerApi.md#fetchAllLedgerTransactions) | **GET** /v2/pos/ledger/transactions/all | Fetch ledger transactions by page +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchAllLedgerTransactions()**](TransactionLedgerApi.md#fetchAllLedgerTransactions) | **GET** /v2/pos/ledger/transactions/all | Fetch ledger transactions by page | ## `fetchAllLedgerTransactions()` ```php -fetchAllLedgerTransactions($start_date_time, $end_date_time, $page_num, $page_size, $register_type): \OpenAPI\Client\Model\InlineResponse2009 +fetchAllLedgerTransactions($start_date_time, $end_date_time, $page_num, $page_size, $register_type): \OpenAPI\Client\Model\FetchAllLedgerTransactions200Response ``` Fetch ledger transactions by page @@ -30,9 +30,9 @@ $apiInstance = new OpenAPI\Client\Api\TransactionLedgerApi( ); $start_date_time = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime $end_date_time = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime -$page_num = 3.4; // double -$page_size = 3.4; // double -$register_type = new \OpenAPI\Client\Model\\OpenAPI\Client\Model\ApplicableTerminals(); // \OpenAPI\Client\Model\ApplicableTerminals +$page_num = 3.4; // float +$page_size = 3.4; // float +$register_type = new \OpenAPI\Client\Model\ApplicableTerminals(); // ApplicableTerminals try { $result = $apiInstance->fetchAllLedgerTransactions($start_date_time, $end_date_time, $page_num, $page_size, $register_type); @@ -44,17 +44,17 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date_time** | **\DateTime**| | - **end_date_time** | **\DateTime**| | - **page_num** | **double**| | - **page_size** | **double**| | - **register_type** | [**\OpenAPI\Client\Model\ApplicableTerminals**](../Model/.md)| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **start_date_time** | **\DateTime**| | | +| **end_date_time** | **\DateTime**| | | +| **page_num** | **float**| | | +| **page_size** | **float**| | | +| **register_type** | [**ApplicableTerminals**](../Model/.md)| | [optional] | ### Return type -[**\OpenAPI\Client\Model\InlineResponse2009**](../Model/InlineResponse2009.md) +[**\OpenAPI\Client\Model\FetchAllLedgerTransactions200Response**](../Model/FetchAllLedgerTransactions200Response.md) ### Authorization diff --git a/docs/Api/VideosApi.md b/docs/Api/VideosApi.md index 4d97881..f484824 100644 --- a/docs/Api/VideosApi.md +++ b/docs/Api/VideosApi.md @@ -1,14 +1,14 @@ # OpenAPI\Client\VideosApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveVideo()**](VideosApi.md#archiveVideo) | **DELETE** /v2/video/{id} | Archive video -[**createVideo()**](VideosApi.md#createVideo) | **POST** /v2/video | Create video -[**fetchAllVideo()**](VideosApi.md#fetchAllVideo) | **GET** /v2/video/all | Fetch all video -[**restoreVideo()**](VideosApi.md#restoreVideo) | **PATCH** /v2/video/{id} | Restore video -[**updateVideo()**](VideosApi.md#updateVideo) | **PUT** /v2/video/{id} | Update video +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveVideo()**](VideosApi.md#archiveVideo) | **DELETE** /v2/video/{id} | Archive video | +| [**createVideo()**](VideosApi.md#createVideo) | **POST** /v2/video | Create video | +| [**fetchAllVideo()**](VideosApi.md#fetchAllVideo) | **GET** /v2/video/all | Fetch all video | +| [**restoreVideo()**](VideosApi.md#restoreVideo) | **PATCH** /v2/video/{id} | Restore video | +| [**updateVideo()**](VideosApi.md#updateVideo) | **PUT** /v2/video/{id} | Update video | ## `archiveVideo()` @@ -44,9 +44,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -98,9 +98,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_video_create_params** | [**\OpenAPI\Client\Model\WTVideoCreateParams**](../Model/WTVideoCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_video_create_params** | [**\OpenAPI\Client\Model\WTVideoCreateParams**](../Model/WTVideoCreateParams.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -206,9 +206,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -261,10 +261,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_video_update_params** | [**\OpenAPI\Client\Model\WTVideoUpdateParams**](../Model/WTVideoUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_video_update_params** | [**\OpenAPI\Client\Model\WTVideoUpdateParams**](../Model/WTVideoUpdateParams.md)| | | ### Return type diff --git a/docs/Api/VirtualBusinessCardApi.md b/docs/Api/VirtualBusinessCardApi.md index d0fbe25..6e76c9d 100644 --- a/docs/Api/VirtualBusinessCardApi.md +++ b/docs/Api/VirtualBusinessCardApi.md @@ -1,16 +1,16 @@ # OpenAPI\Client\VirtualBusinessCardApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**archiveVirtualBusinessCard()**](VirtualBusinessCardApi.md#archiveVirtualBusinessCard) | **DELETE** /v2/virtualBusinessCard/{id} | Archive VirtualBusinessCard -[**createVirtualBusinessCard()**](VirtualBusinessCardApi.md#createVirtualBusinessCard) | **POST** /v2/virtualBusinessCard | Create VirtualBusinessCard -[**fetchAllVirtualBusinessCards()**](VirtualBusinessCardApi.md#fetchAllVirtualBusinessCards) | **GET** /v2/virtualBusinessCard/all | Fetch all VirtualBusinessCards -[**fetchVirtualBusinessCard()**](VirtualBusinessCardApi.md#fetchVirtualBusinessCard) | **GET** /v2/virtualBusinessCard/{id} | Fetch virtual business card -[**fetchVirtualBusinessCardRequests()**](VirtualBusinessCardApi.md#fetchVirtualBusinessCardRequests) | **GET** /v2/virtualBusinessCard/requests/{id} | Fetch requests -[**restoreVirtualBusinessCard()**](VirtualBusinessCardApi.md#restoreVirtualBusinessCard) | **PATCH** /v2/virtualBusinessCard/{id} | Restore VirtualBusinessCard -[**updateVirtualBusinessCard()**](VirtualBusinessCardApi.md#updateVirtualBusinessCard) | **PUT** /v2/virtualBusinessCard/{id} | Update VirtualBusinessCard +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**archiveVirtualBusinessCard()**](VirtualBusinessCardApi.md#archiveVirtualBusinessCard) | **DELETE** /v2/virtualBusinessCard/{id} | Archive VirtualBusinessCard | +| [**createVirtualBusinessCard()**](VirtualBusinessCardApi.md#createVirtualBusinessCard) | **POST** /v2/virtualBusinessCard | Create VirtualBusinessCard | +| [**fetchAllVirtualBusinessCards()**](VirtualBusinessCardApi.md#fetchAllVirtualBusinessCards) | **GET** /v2/virtualBusinessCard/all | Fetch all VirtualBusinessCards | +| [**fetchVirtualBusinessCard()**](VirtualBusinessCardApi.md#fetchVirtualBusinessCard) | **GET** /v2/virtualBusinessCard/{id} | Fetch virtual business card | +| [**fetchVirtualBusinessCardRequests()**](VirtualBusinessCardApi.md#fetchVirtualBusinessCardRequests) | **GET** /v2/virtualBusinessCard/requests/{id} | Fetch requests | +| [**restoreVirtualBusinessCard()**](VirtualBusinessCardApi.md#restoreVirtualBusinessCard) | **PATCH** /v2/virtualBusinessCard/{id} | Restore VirtualBusinessCard | +| [**updateVirtualBusinessCard()**](VirtualBusinessCardApi.md#updateVirtualBusinessCard) | **PUT** /v2/virtualBusinessCard/{id} | Update VirtualBusinessCard | ## `archiveVirtualBusinessCard()` @@ -46,9 +46,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -100,9 +100,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **wt_virtual_business_card_create_params** | [**\OpenAPI\Client\Model\WTVirtualBusinessCardCreateParams**](../Model/WTVirtualBusinessCardCreateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **wt_virtual_business_card_create_params** | [**\OpenAPI\Client\Model\WTVirtualBusinessCardCreateParams**](../Model/WTVirtualBusinessCardCreateParams.md)| | | ### Return type @@ -154,9 +154,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **is_archive_included** | **bool**| | [optional] +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **is_archive_included** | **bool**| | [optional] | ### Return type @@ -208,9 +208,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -262,9 +262,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -316,9 +316,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | ### Return type @@ -371,10 +371,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**mixed**](../Model/.md)| | - **wt_virtual_business_card_update_params** | [**\OpenAPI\Client\Model\WTVirtualBusinessCardUpdateParams**](../Model/WTVirtualBusinessCardUpdateParams.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | [**mixed**](../Model/.md)| | | +| **wt_virtual_business_card_update_params** | [**\OpenAPI\Client\Model\WTVirtualBusinessCardUpdateParams**](../Model/WTVirtualBusinessCardUpdateParams.md)| | | ### Return type diff --git a/docs/Api/WebTerminalApi.md b/docs/Api/WebTerminalApi.md index 16c4bbf..f18b1e9 100644 --- a/docs/Api/WebTerminalApi.md +++ b/docs/Api/WebTerminalApi.md @@ -1,12 +1,12 @@ # OpenAPI\Client\WebTerminalApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchWalletItemFromWebTerminal()**](WebTerminalApi.md#fetchWalletItemFromWebTerminal) | **GET** /v2/pos/web/item/{itemID} | Fetch item -[**redeemWalletItemFromWebTerminal()**](WebTerminalApi.md#redeemWalletItemFromWebTerminal) | **POST** /v2/pos/web/item/redeem/{itemID} | Redeem item -[**refundWalletItemFromWebTerminal()**](WebTerminalApi.md#refundWalletItemFromWebTerminal) | **POST** /v2/pos/web/item/refund/{ledgerEntryID} | Refund transaction +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchWalletItemFromWebTerminal()**](WebTerminalApi.md#fetchWalletItemFromWebTerminal) | **GET** /v2/pos/web/item/{itemID} | Fetch item | +| [**redeemWalletItemFromWebTerminal()**](WebTerminalApi.md#redeemWalletItemFromWebTerminal) | **POST** /v2/pos/web/item/redeem/{itemID} | Redeem item | +| [**refundWalletItemFromWebTerminal()**](WebTerminalApi.md#refundWalletItemFromWebTerminal) | **POST** /v2/pos/web/item/refund/{ledgerEntryID} | Refund transaction | ## `fetchWalletItemFromWebTerminal()` @@ -42,9 +42,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | ### Return type @@ -97,10 +97,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | - **wt_wallet_item_redemption** | [**\OpenAPI\Client\Model\WTWalletItemRedemption**](../Model/WTWalletItemRedemption.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | +| **wt_wallet_item_redemption** | [**\OpenAPI\Client\Model\WTWalletItemRedemption**](../Model/WTWalletItemRedemption.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ledger_entry_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ledger_entry_id** | **string**| | | ### Return type diff --git a/docs/Api/WixTerminalApi.md b/docs/Api/WixTerminalApi.md index 32008cc..351c938 100644 --- a/docs/Api/WixTerminalApi.md +++ b/docs/Api/WixTerminalApi.md @@ -1,12 +1,12 @@ # OpenAPI\Client\WixTerminalApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchWalletItemFromWixTerminal()**](WixTerminalApi.md#fetchWalletItemFromWixTerminal) | **GET** /v2/pos/wix/item/{itemID} | Fetch item -[**redeemWalletItemFromWixTerminal()**](WixTerminalApi.md#redeemWalletItemFromWixTerminal) | **POST** /v2/pos/wix/item/redeem/{itemID} | Redeem item -[**refundWalletItemFromWixTerminal()**](WixTerminalApi.md#refundWalletItemFromWixTerminal) | **POST** /v2/pos/wix/item/refund/{ledgerEntryID} | Refund transaction +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchWalletItemFromWixTerminal()**](WixTerminalApi.md#fetchWalletItemFromWixTerminal) | **GET** /v2/pos/wix/item/{itemID} | Fetch item | +| [**redeemWalletItemFromWixTerminal()**](WixTerminalApi.md#redeemWalletItemFromWixTerminal) | **POST** /v2/pos/wix/item/redeem/{itemID} | Redeem item | +| [**refundWalletItemFromWixTerminal()**](WixTerminalApi.md#refundWalletItemFromWixTerminal) | **POST** /v2/pos/wix/item/refund/{ledgerEntryID} | Refund transaction | ## `fetchWalletItemFromWixTerminal()` @@ -42,9 +42,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | ### Return type @@ -97,10 +97,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | - **wt_wallet_item_redemption** | [**\OpenAPI\Client\Model\WTWalletItemRedemption**](../Model/WTWalletItemRedemption.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | +| **wt_wallet_item_redemption** | [**\OpenAPI\Client\Model\WTWalletItemRedemption**](../Model/WTWalletItemRedemption.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ledger_entry_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ledger_entry_id** | **string**| | | ### Return type diff --git a/docs/Api/WooCommerceTerminalApi.md b/docs/Api/WooCommerceTerminalApi.md index 3f3f0b2..755379c 100644 --- a/docs/Api/WooCommerceTerminalApi.md +++ b/docs/Api/WooCommerceTerminalApi.md @@ -1,12 +1,12 @@ # OpenAPI\Client\WooCommerceTerminalApi -All URIs are relative to https://api.wall.et. +All URIs are relative to https://api.wall.et, except if the operation defines another base path. -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fetchWalletItemFromWooCommerceTerminal()**](WooCommerceTerminalApi.md#fetchWalletItemFromWooCommerceTerminal) | **GET** /v2/pos/woocommerce/item/{itemID} | Fetch item -[**redeemWalletItemFromWooCommerceTerminal()**](WooCommerceTerminalApi.md#redeemWalletItemFromWooCommerceTerminal) | **POST** /v2/pos/woocommerce/item/redeem/{itemID} | Redeem item -[**refundWalletItemFromWooCommerceTerminal()**](WooCommerceTerminalApi.md#refundWalletItemFromWooCommerceTerminal) | **POST** /v2/pos/woocommerce/item/refund/{ledgerEntryID} | Refund transaction +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**fetchWalletItemFromWooCommerceTerminal()**](WooCommerceTerminalApi.md#fetchWalletItemFromWooCommerceTerminal) | **GET** /v2/pos/woocommerce/item/{itemID} | Fetch item | +| [**redeemWalletItemFromWooCommerceTerminal()**](WooCommerceTerminalApi.md#redeemWalletItemFromWooCommerceTerminal) | **POST** /v2/pos/woocommerce/item/redeem/{itemID} | Redeem item | +| [**refundWalletItemFromWooCommerceTerminal()**](WooCommerceTerminalApi.md#refundWalletItemFromWooCommerceTerminal) | **POST** /v2/pos/woocommerce/item/refund/{ledgerEntryID} | Refund transaction | ## `fetchWalletItemFromWooCommerceTerminal()` @@ -42,9 +42,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | ### Return type @@ -97,10 +97,10 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **item_id** | **string**| | - **wt_wallet_item_redemption** | [**\OpenAPI\Client\Model\WTWalletItemRedemption**](../Model/WTWalletItemRedemption.md)| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **item_id** | **string**| | | +| **wt_wallet_item_redemption** | [**\OpenAPI\Client\Model\WTWalletItemRedemption**](../Model/WTWalletItemRedemption.md)| | | ### Return type @@ -152,9 +152,9 @@ try { ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ledger_entry_id** | **string**| | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **ledger_entry_id** | **string**| | | ### Return type diff --git a/docs/Model/AdvertisementCredit.md b/docs/Model/AdvertisementCredit.md index 27cabf2..f0eb55b 100644 --- a/docs/Model/AdvertisementCredit.md +++ b/docs/Model/AdvertisementCredit.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **payment_design_id** | **string** | | **max_uses** | **int** | | **discount_value** | **int** | | **employee_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/AdvertisementCreditBroadcast.md b/docs/Model/AdvertisementCreditBroadcast.md index c510dc6..68f1917 100644 --- a/docs/Model/AdvertisementCreditBroadcast.md +++ b/docs/Model/AdvertisementCreditBroadcast.md @@ -5,22 +5,22 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **phone_number_id** | **string** | | -**payment_object_prefix** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**payment_object_prefix** | [**\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix**](PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.md) | | **payment_object_id** | **string** | | **message_template** | **string** | | **media_urls** | **string[]** | | **employee_id** | **string** | | **broadcast_scheduled_at** | **\DateTime** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | -**broadcast_status** | [**AnyOfStringStringStringStringString**](AnyOfStringStringStringStringString.md) | | +**broadcast_status** | [**\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus**](PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.md) | | **broadcast_queued_at** | **\DateTime** | | **broadcast_started_at** | **\DateTime** | | **broadcast_completed_at** | **\DateTime** | | -**list_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**list_type** | [**\OpenAPI\Client\Model\DynamicVoucherBroadcastListType**](DynamicVoucherBroadcastListType.md) | | **list_id** | **string** | | **opt_in_list** | [**\OpenAPI\Client\Model\WTOptInList**](WTOptInList.md) | | [optional] **imported_list** | [**\OpenAPI\Client\Model\WTImportedList**](WTImportedList.md) | | [optional] diff --git a/docs/Model/AdvertisementCreditScan.md b/docs/Model/AdvertisementCreditScan.md index 628d291..ddecbbf 100644 --- a/docs/Model/AdvertisementCreditScan.md +++ b/docs/Model/AdvertisementCreditScan.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | -**transaction_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | The type of the transaction - only redemption at the moment | -**register_id** | [**AnyOfStringDouble**](AnyOfStringDouble.md) | The ID of the register where the transaction occurred | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | +**transaction_type** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.md) | | +**register_id** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md) | | **redeemed_source** | **string** | | **redeemed_transaction_id** | **string** | | **redeemed_amount** | **int** | | diff --git a/docs/Model/Amenity.md b/docs/Model/Amenity.md index 93fa3dc..fbf5638 100644 --- a/docs/Model/Amenity.md +++ b/docs/Model/Amenity.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **order_number** | **int** | | **media_url** | **string** | | [optional] **additional_info_url** | **string** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/AuthError.md b/docs/Model/AuthError.md index c14f7a1..3dcbf9f 100644 --- a/docs/Model/AuthError.md +++ b/docs/Model/AuthError.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **string** | | **message** | **string** | | **stack** | **string** | | [optional] -**http_error_code** | **double** | | +**http_error_code** | **float** | | **tracking_code** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AvailablePhoneNumbersRequest.md b/docs/Model/AvailablePhoneNumbersRequest.md index c56c653..6cf9f13 100644 --- a/docs/Model/AvailablePhoneNumbersRequest.md +++ b/docs/Model/AvailablePhoneNumbersRequest.md @@ -5,6 +5,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **area_code** | **int** | The area code within which an available number needs to be queried | -**limit** | **double** | The number of available phone numbers to be returned in a single request | [optional] +**limit** | **float** | The number of available phone numbers to be returned in a single request | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ClaimTicketRequest.md b/docs/Model/ClaimTicketRequest.md new file mode 100644 index 0000000..24c548b --- /dev/null +++ b/docs/Model/ClaimTicketRequest.md @@ -0,0 +1,9 @@ +# # ClaimTicketRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**claimed_by_phone_number** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ClickFunnelAmount.md b/docs/Model/ClickFunnelAmount.md index faba94a..5dd4295 100644 --- a/docs/Model/ClickFunnelAmount.md +++ b/docs/Model/ClickFunnelAmount.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**cents** | **double** | | +**cents** | **float** | | **currency_iso** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ClickFunnelContact.md b/docs/Model/ClickFunnelContact.md index 2cf8174..7040ae6 100644 --- a/docs/Model/ClickFunnelContact.md +++ b/docs/Model/ClickFunnelContact.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **double** | | -**page_id** | **double** | | +**id** | **float** | | +**page_id** | **float** | | **first_name** | **string** | | **last_name** | **string** | | **name** | **string** | | @@ -22,8 +22,8 @@ Name | Type | Description | Notes **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **ip** | **string** | | -**funnel_id** | **double** | | -**funnel_step_id** | **double** | | +**funnel_id** | **float** | | +**funnel_step_id** | **float** | | **unsubscribed_at** | **mixed** | | [optional] **cf_uvid** | **string** | | **cart_affiliate_id** | **string** | | @@ -42,5 +42,7 @@ Name | Type | Description | Notes **company_name** | **string** | | **company_industry** | **string** | | **additional_info** | **mixed** | | [optional] +**ga_client_id** | **string** | | [optional] +**ga_measurement_id** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ClickFunnelContactProfile.md b/docs/Model/ClickFunnelContactProfile.md index 5884792..a9c2605 100644 --- a/docs/Model/ClickFunnelContactProfile.md +++ b/docs/Model/ClickFunnelContactProfile.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **double** | | +**id** | **float** | | **first_name** | **string** | | **last_name** | **string** | | **address** | **string** | | diff --git a/docs/Model/ClickFunnelOriginalAmount.md b/docs/Model/ClickFunnelOriginalAmount.md index a1ad9e1..a39ea31 100644 --- a/docs/Model/ClickFunnelOriginalAmount.md +++ b/docs/Model/ClickFunnelOriginalAmount.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**cents** | **double** | | +**cents** | **float** | | **currency_iso** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ClickFunnelProduct.md b/docs/Model/ClickFunnelProduct.md index 79fb572..224f051 100644 --- a/docs/Model/ClickFunnelProduct.md +++ b/docs/Model/ClickFunnelProduct.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **double** | | +**id** | **float** | | **name** | **string** | | **stripe_plan** | **string** | | **amount** | [**\OpenAPI\Client\Model\ClickFunnelAmount**](ClickFunnelAmount.md) | | @@ -13,7 +13,7 @@ Name | Type | Description | Notes **updated_at** | **\DateTime** | | **subject** | **string** | | **html_body** | **string** | | -**thank_you_page_id** | **double** | | +**thank_you_page_id** | **float** | | **stripe_cancel_after_payments** | **mixed** | | [optional] **bump** | **bool** | | **cart_product_id** | **mixed** | | [optional] diff --git a/docs/Model/ClickFunnelPurchase.md b/docs/Model/ClickFunnelPurchase.md index a8c5f1b..7a42e2d 100644 --- a/docs/Model/ClickFunnelPurchase.md +++ b/docs/Model/ClickFunnelPurchase.md @@ -4,11 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **double** | | +**id** | **float** | | **products** | [**\OpenAPI\Client\Model\ClickFunnelProduct[]**](ClickFunnelProduct.md) | | **member_id** | **mixed** | | [optional] **contact** | [**\OpenAPI\Client\Model\ClickFunnelContact**](ClickFunnelContact.md) | | -**funnel_id** | **double** | | +**funnel_id** | **float** | | **stripe_customer_token** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | @@ -23,7 +23,7 @@ Name | Type | Description | Notes **infusionsoft_ccid** | **mixed** | | [optional] **oap_customer_id** | **mixed** | | [optional] **payment_instrument_type** | **mixed** | | [optional] -**original_amount_cents** | **double** | | +**original_amount_cents** | **float** | | **original_amount** | [**\OpenAPI\Client\Model\ClickFunnelOriginalAmount**](ClickFunnelOriginalAmount.md) | | **original_amount_currency** | **string** | | **manual** | **bool** | | diff --git a/docs/Model/CountClaimedComps200Response.md b/docs/Model/CountClaimedComps200Response.md new file mode 100644 index 0000000..41f8a56 --- /dev/null +++ b/docs/Model/CountClaimedComps200Response.md @@ -0,0 +1,10 @@ +# # CountClaimedComps200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**seats** | **float** | | +**count** | **float** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateFile200Response.md b/docs/Model/CreateFile200Response.md new file mode 100644 index 0000000..2d41cc5 --- /dev/null +++ b/docs/Model/CreateFile200Response.md @@ -0,0 +1,11 @@ +# # CreateFile200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**size** | **float** | | +**name** | **string** | | +**url** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateStaticVoucherCampaign.md b/docs/Model/CreateStaticVoucherCampaign.md index 81ce7d4..7b2fb5d 100644 --- a/docs/Model/CreateStaticVoucherCampaign.md +++ b/docs/Model/CreateStaticVoucherCampaign.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **expiration_date_time** | **\DateTime** | | **title** | **string** | | **notes** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **display_value** | **string** | | [optional] **merchants_reference_id** | **string** | | [optional] **valid_only_at_pos_register_ids** | **string[]** | | [optional] @@ -16,6 +16,6 @@ Name | Type | Description | Notes **bucket** | **string** | | [optional] **file_name** | **string** | | [optional] **source_id** | **int** | | -**campaign_group_id** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] +**campaign_group_id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateStaticVoucherCampaignWithVoucherWithCSV.md b/docs/Model/CreateStaticVoucherCampaignWithVoucherWithCSV.md index 2349de3..5ace488 100644 --- a/docs/Model/CreateStaticVoucherCampaignWithVoucherWithCSV.md +++ b/docs/Model/CreateStaticVoucherCampaignWithVoucherWithCSV.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **expiration_date_time** | **\DateTime** | | **title** | **string** | | **notes** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **display_value** | **string** | | [optional] **merchants_reference_id** | **string** | | [optional] **valid_only_at_pos_register_ids** | **string[]** | | [optional] @@ -16,6 +16,6 @@ Name | Type | Description | Notes **bucket** | **string** | | **file_name** | **string** | | **source_id** | **int** | | -**campaign_group_id** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] +**campaign_group_id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DashboardWidget.md b/docs/Model/DashboardWidget.md index 09e7068..d77623f 100644 --- a/docs/Model/DashboardWidget.md +++ b/docs/Model/DashboardWidget.md @@ -14,11 +14,11 @@ Name | Type | Description | Notes **icon** | **string** | | **route** | **string** | | **type** | **string** | | -**order_number** | **double** | | +**order_number** | **float** | | **is_default** | **bool** | | **category** | **string** | | **category_icon** | **string** | | -**category_order_number** | **double** | | +**category_order_number** | **float** | | **page_name** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Dining.md b/docs/Model/Dining.md index ba85c7a..8c4724c 100644 --- a/docs/Model/Dining.md +++ b/docs/Model/Dining.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **order_number** | **int** | | **media_url** | **string** | | [optional] **additional_info_url** | **string** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/Document.md b/docs/Model/Document.md index 066d32c..66fc52f 100644 --- a/docs/Model/Document.md +++ b/docs/Model/Document.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **file_url** | **string** | The URL of the file | **file_type** | **string** | The type of the file | **file_name** | **string** | The name of the file | -**file_size** | **double** | The size of the file | +**file_size** | **float** | The size of the file | **folder** | **string** | The folder in which the file is stored | **employee_id** | **string** | | diff --git a/docs/Model/DuplicateRowFound.md b/docs/Model/DuplicateRowFound.md index b965c67..d8bc47d 100644 --- a/docs/Model/DuplicateRowFound.md +++ b/docs/Model/DuplicateRowFound.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **string** | | **message** | **string** | | **stack** | **string** | | [optional] -**http_error_code** | **double** | | +**http_error_code** | **float** | | **tracking_code** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DynamicVoucher.md b/docs/Model/DynamicVoucher.md index 5a49f47..b3dda73 100644 --- a/docs/Model/DynamicVoucher.md +++ b/docs/Model/DynamicVoucher.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **start_date** | **\DateTime** | | **expiration_date** | **\DateTime** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **title** | **string** | | **notes** | **string** | | **merchants_reference_id** | **string** | | [optional] @@ -31,11 +31,11 @@ Name | Type | Description | Notes **starting_value_string** | **string** | | **max_budget_decimal** | **string** | | **max_budget_string** | **string** | | -**current_value** | **double** | | +**current_value** | **float** | | **current_value_decimal** | **string** | | **current_value_string** | **string** | | -**status** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | -**temporal_decrease_frequency_type** | [**AnyOfStringStringStringStringString**](AnyOfStringStringStringStringString.md) | | +**status** | [**\OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus**](WTDynamicVoucherSummaryStatus.md) | | +**temporal_decrease_frequency_type** | [**\OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType**](DynamicVoucherTemporalDecreaseFrequencyType.md) | | **summary** | [**\OpenAPI\Client\Model\WTDynamicVoucherSummary**](WTDynamicVoucherSummary.md) | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DynamicVoucherBroadcast.md b/docs/Model/DynamicVoucherBroadcast.md index 67cc570..9733482 100644 --- a/docs/Model/DynamicVoucherBroadcast.md +++ b/docs/Model/DynamicVoucherBroadcast.md @@ -5,22 +5,22 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **phone_number_id** | **string** | | -**payment_object_prefix** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**payment_object_prefix** | [**\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix**](PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.md) | | **payment_object_id** | **string** | | **message_template** | **string** | | **media_urls** | **string[]** | | **employee_id** | **string** | | **broadcast_scheduled_at** | **\DateTime** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | -**broadcast_status** | [**AnyOfStringStringStringStringString**](AnyOfStringStringStringStringString.md) | | +**broadcast_status** | [**\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus**](PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.md) | | **broadcast_queued_at** | **\DateTime** | | **broadcast_started_at** | **\DateTime** | | **broadcast_completed_at** | **\DateTime** | | -**list_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**list_type** | [**\OpenAPI\Client\Model\DynamicVoucherBroadcastListType**](DynamicVoucherBroadcastListType.md) | | **list_id** | **string** | | **opt_in_list** | [**\OpenAPI\Client\Model\WTOptInList**](WTOptInList.md) | | [optional] **imported_list** | [**\OpenAPI\Client\Model\WTImportedList**](WTImportedList.md) | | [optional] diff --git a/docs/Model/DynamicVoucherBroadcastListType.md b/docs/Model/DynamicVoucherBroadcastListType.md new file mode 100644 index 0000000..9cf5d9c --- /dev/null +++ b/docs/Model/DynamicVoucherBroadcastListType.md @@ -0,0 +1,8 @@ +# # DynamicVoucherBroadcastListType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DynamicVoucherTemporalDecreaseFrequencyType.md b/docs/Model/DynamicVoucherTemporalDecreaseFrequencyType.md new file mode 100644 index 0000000..218e586 --- /dev/null +++ b/docs/Model/DynamicVoucherTemporalDecreaseFrequencyType.md @@ -0,0 +1,8 @@ +# # DynamicVoucherTemporalDecreaseFrequencyType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmailSubscriber.md b/docs/Model/EmailSubscriber.md index 64807f6..eecb452 100644 --- a/docs/Model/EmailSubscriber.md +++ b/docs/Model/EmailSubscriber.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **first_name** | **string** | | **last_name** | **string** | | **email_address** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/Employee.md b/docs/Model/Employee.md index 2f5abd3..ce093f5 100644 --- a/docs/Model/Employee.md +++ b/docs/Model/Employee.md @@ -13,14 +13,14 @@ Name | Type | Description | Notes **employee_id** | **string** | | **job_title** | **string** | | **department** | **string** | | -**schedule_start_day** | [**AnyOfStringStringStringStringStringStringString**](AnyOfStringStringStringStringStringStringString.md) | | [optional] -**schedule_start_hour** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_start_minute** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_start_meridiem** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] -**schedule_end_day** | [**AnyOfStringStringStringStringStringStringString**](AnyOfStringStringStringStringStringStringString.md) | | [optional] -**schedule_end_hour** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_end_minute** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_end_meridiem** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] +**schedule_start_day** | [**\OpenAPI\Client\Model\EmployeeScheduleStartDay**](EmployeeScheduleStartDay.md) | | [optional] +**schedule_start_hour** | [**\OpenAPI\Client\Model\EmployeeScheduleStartHour**](EmployeeScheduleStartHour.md) | | [optional] +**schedule_start_minute** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMinute**](EmployeeScheduleStartMinute.md) | | [optional] +**schedule_start_meridiem** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem**](EmployeeScheduleStartMeridiem.md) | | [optional] +**schedule_end_day** | [**\OpenAPI\Client\Model\EmployeeScheduleStartDay**](EmployeeScheduleStartDay.md) | | [optional] +**schedule_end_hour** | [**\OpenAPI\Client\Model\EmployeeScheduleStartHour**](EmployeeScheduleStartHour.md) | | [optional] +**schedule_end_minute** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMinute**](EmployeeScheduleStartMinute.md) | | [optional] +**schedule_end_meridiem** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem**](EmployeeScheduleStartMeridiem.md) | | [optional] **id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | @@ -29,7 +29,7 @@ Name | Type | Description | Notes **profile_picture_url** | **string** | | **merchant_id** | **string** | | **session_token** | **string** | | -**failed_login_attempts** | **double** | | [optional] +**failed_login_attempts** | **float** | | [optional] **last_login_date** | **\DateTime** | | [optional] **cfuvid** | **string** | | [optional] **schedule** | **object** | | [optional] diff --git a/docs/Model/EmployeeAPIKey.md b/docs/Model/EmployeeAPIKey.md index 811282b..bbb625c 100644 --- a/docs/Model/EmployeeAPIKey.md +++ b/docs/Model/EmployeeAPIKey.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **title** | **string** | | **description** | **string** | | **employee_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/EmployeeAlert.md b/docs/Model/EmployeeAlert.md index bc43609..fb45850 100644 --- a/docs/Model/EmployeeAlert.md +++ b/docs/Model/EmployeeAlert.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **message** | **string** | | **s3_bucket** | **string** | | **s3_key** | **string** | | -**file_size_bytes** | **double** | | +**file_size_bytes** | **float** | | **id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/EmployeeScheduleStartDay.md b/docs/Model/EmployeeScheduleStartDay.md new file mode 100644 index 0000000..d43a045 --- /dev/null +++ b/docs/Model/EmployeeScheduleStartDay.md @@ -0,0 +1,8 @@ +# # EmployeeScheduleStartDay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeScheduleStartHour.md b/docs/Model/EmployeeScheduleStartHour.md new file mode 100644 index 0000000..4fc0fda --- /dev/null +++ b/docs/Model/EmployeeScheduleStartHour.md @@ -0,0 +1,8 @@ +# # EmployeeScheduleStartHour + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeScheduleStartMeridiem.md b/docs/Model/EmployeeScheduleStartMeridiem.md new file mode 100644 index 0000000..9714af8 --- /dev/null +++ b/docs/Model/EmployeeScheduleStartMeridiem.md @@ -0,0 +1,8 @@ +# # EmployeeScheduleStartMeridiem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EmployeeScheduleStartMinute.md b/docs/Model/EmployeeScheduleStartMinute.md new file mode 100644 index 0000000..1a4ed9e --- /dev/null +++ b/docs/Model/EmployeeScheduleStartMinute.md @@ -0,0 +1,8 @@ +# # EmployeeScheduleStartMinute + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/EntityTooLarge.md b/docs/Model/EntityTooLarge.md index 0912726..d55160c 100644 --- a/docs/Model/EntityTooLarge.md +++ b/docs/Model/EntityTooLarge.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **string** | | **message** | **string** | | **stack** | **string** | | [optional] -**http_error_code** | **double** | | +**http_error_code** | **float** | | **tracking_code** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExportDataFile.md b/docs/Model/ExportDataFile.md index 3b0d5c3..79ccf53 100644 --- a/docs/Model/ExportDataFile.md +++ b/docs/Model/ExportDataFile.md @@ -13,6 +13,6 @@ Name | Type | Description | Notes **employee_id** | **string** | | **s3_bucket** | **string** | | **s3_key** | **string** | | -**file_size_bytes** | **double** | | +**file_size_bytes** | **float** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Feature.md b/docs/Model/Feature.md index b0a6f45..3e8b246 100644 --- a/docs/Model/Feature.md +++ b/docs/Model/Feature.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sort_num** | **double** | | +**sort_num** | **float** | | **name** | **string** | | **max_volume** | **string** | | [optional] **measurement** | **string** | | diff --git a/docs/Model/FetchAllCountries200ResponseInner.md b/docs/Model/FetchAllCountries200ResponseInner.md new file mode 100644 index 0000000..bc490ff --- /dev/null +++ b/docs/Model/FetchAllCountries200ResponseInner.md @@ -0,0 +1,12 @@ +# # FetchAllCountries200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency_abbreviation** | **string** | | +**phone_code** | **string** | | +**iso2** | **string** | | +**name** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchAllLedgerTransactions200Response.md b/docs/Model/FetchAllLedgerTransactions200Response.md new file mode 100644 index 0000000..1cd6606 --- /dev/null +++ b/docs/Model/FetchAllLedgerTransactions200Response.md @@ -0,0 +1,11 @@ +# # FetchAllLedgerTransactions200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entries** | [**\OpenAPI\Client\Model\LedgerEntry[]**](LedgerEntry.md) | | +**page_count** | **float** | | +**total_records** | **float** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner.md b/docs/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner.md new file mode 100644 index 0000000..53ffbd2 --- /dev/null +++ b/docs/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner.md @@ -0,0 +1,21 @@ +# # FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payment_design** | [**\OpenAPI\Client\Model\PaymentDesign**](PaymentDesign.md) | | +**value_type** | [**\OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType**](FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType.md) | | +**voucher_type** | **float** | | +**expiration_date** | **\DateTime** | | +**start_date** | **\DateTime** | | +**title** | **string** | | +**is_redeemed** | **bool** | | +**display_value** | **string** | | +**offer_amount_cents_decimal** | **string** | | +**offer_amount_cents** | **float** | | +**member_id** | **string** | | +**cell_phone_number** | **string** | | +**id** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType.md b/docs/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType.md new file mode 100644 index 0000000..7573649 --- /dev/null +++ b/docs/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType.md @@ -0,0 +1,8 @@ +# # FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchCustomerTicketsWithTokenRequest.md b/docs/Model/FetchCustomerTicketsWithTokenRequest.md new file mode 100644 index 0000000..48a986b --- /dev/null +++ b/docs/Model/FetchCustomerTicketsWithTokenRequest.md @@ -0,0 +1,10 @@ +# # FetchCustomerTicketsWithTokenRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**phone_verification_token** | **string** | | +**merchant_id** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchDomainsByIndustry200Response.md b/docs/Model/FetchDomainsByIndustry200Response.md new file mode 100644 index 0000000..b1a9d90 --- /dev/null +++ b/docs/Model/FetchDomainsByIndustry200Response.md @@ -0,0 +1,15 @@ +# # FetchDomainsByIndustry200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entertainment** | **mixed[]** | | +**grocery** | **mixed[]** | | +**service** | **mixed[]** | | +**casino** | **mixed[]** | | +**hospitality** | **mixed[]** | | +**food** | **mixed[]** | | +**retail** | **mixed[]** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchImportedListRecipientsByPage200Response.md b/docs/Model/FetchImportedListRecipientsByPage200Response.md new file mode 100644 index 0000000..8f24ee0 --- /dev/null +++ b/docs/Model/FetchImportedListRecipientsByPage200Response.md @@ -0,0 +1,11 @@ +# # FetchImportedListRecipientsByPage200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **float** | | +**length** | **float** | | +**results** | [**\OpenAPI\Client\Model\ImportedListRecipient[]**](ImportedListRecipient.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchInboundSMSByPage200Response.md b/docs/Model/FetchInboundSMSByPage200Response.md new file mode 100644 index 0000000..a123374 --- /dev/null +++ b/docs/Model/FetchInboundSMSByPage200Response.md @@ -0,0 +1,11 @@ +# # FetchInboundSMSByPage200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **float** | | +**length** | **float** | | +**results** | [**\OpenAPI\Client\Model\InboundSMS[]**](InboundSMS.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchIndustry200Response.md b/docs/Model/FetchIndustry200Response.md new file mode 100644 index 0000000..e84d4a3 --- /dev/null +++ b/docs/Model/FetchIndustry200Response.md @@ -0,0 +1,13 @@ +# # FetchIndustry200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**plans** | [**\OpenAPI\Client\Model\SubscriptionPlan[]**](SubscriptionPlan.md) | | +**title** | **string** | | +**icon** | **string** | | +**sort_number** | **string** | | +**id** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchMembersCount200Response.md b/docs/Model/FetchMembersCount200Response.md new file mode 100644 index 0000000..8562f95 --- /dev/null +++ b/docs/Model/FetchMembersCount200Response.md @@ -0,0 +1,9 @@ +# # FetchMembersCount200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **float** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchOptInListSubscribersByPage200Response.md b/docs/Model/FetchOptInListSubscribersByPage200Response.md new file mode 100644 index 0000000..2fa2a91 --- /dev/null +++ b/docs/Model/FetchOptInListSubscribersByPage200Response.md @@ -0,0 +1,11 @@ +# # FetchOptInListSubscribersByPage200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **float** | | +**length** | **float** | | +**results** | [**\OpenAPI\Client\Model\OptInListSubscriber[]**](OptInListSubscriber.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchOutboundSMSByPage200Response.md b/docs/Model/FetchOutboundSMSByPage200Response.md new file mode 100644 index 0000000..eff6f44 --- /dev/null +++ b/docs/Model/FetchOutboundSMSByPage200Response.md @@ -0,0 +1,11 @@ +# # FetchOutboundSMSByPage200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **float** | | +**length** | **float** | | +**results** | [**\OpenAPI\Client\Model\OutboundSMS[]**](OutboundSMS.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchPerformanceTicketsPage200Response.md b/docs/Model/FetchPerformanceTicketsPage200Response.md new file mode 100644 index 0000000..ceb5231 --- /dev/null +++ b/docs/Model/FetchPerformanceTicketsPage200Response.md @@ -0,0 +1,10 @@ +# # FetchPerformanceTicketsPage200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\OpenAPI\Client\Model\WTTicket[]**](WTTicket.md) | | +**total_rows** | **float** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FetchStaticVouchersPage200Response.md b/docs/Model/FetchStaticVouchersPage200Response.md new file mode 100644 index 0000000..0289520 --- /dev/null +++ b/docs/Model/FetchStaticVouchersPage200Response.md @@ -0,0 +1,10 @@ +# # FetchStaticVouchersPage200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\OpenAPI\Client\Model\WTStaticVoucher[]**](WTStaticVoucher.md) | | +**total_rows** | **float** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForbiddenRequest.md b/docs/Model/ForbiddenRequest.md index 6aac666..6f38855 100644 --- a/docs/Model/ForbiddenRequest.md +++ b/docs/Model/ForbiddenRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **string** | | **message** | **string** | | **stack** | **string** | | [optional] -**http_error_code** | **double** | | +**http_error_code** | **float** | | **tracking_code** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ForeignKeyDoesNotExist.md b/docs/Model/ForeignKeyDoesNotExist.md index db8c806..24d0866 100644 --- a/docs/Model/ForeignKeyDoesNotExist.md +++ b/docs/Model/ForeignKeyDoesNotExist.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **string** | | **message** | **string** | | **stack** | **string** | | [optional] -**http_error_code** | **double** | | +**http_error_code** | **float** | | **tracking_code** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Gaming.md b/docs/Model/Gaming.md index a41b939..5518d7f 100644 --- a/docs/Model/Gaming.md +++ b/docs/Model/Gaming.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **order_number** | **int** | | **media_url** | **string** | | [optional] **additional_info_url** | **string** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/HelpDeskRequest.md b/docs/Model/HelpDeskRequest.md index 3c487c4..fec56bb 100644 --- a/docs/Model/HelpDeskRequest.md +++ b/docs/Model/HelpDeskRequest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **merchant_phone_number_id** | **string** | | **cell_phone** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/ImageGrid.md b/docs/Model/ImageGrid.md index 9c90c81..22a5a60 100644 --- a/docs/Model/ImageGrid.md +++ b/docs/Model/ImageGrid.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **media_url** | **string** | | **sequence_number** | **int** | | **is_pinned** | **bool** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/ImportTicketsRequest.md b/docs/Model/ImportTicketsRequest.md new file mode 100644 index 0000000..72c4fed --- /dev/null +++ b/docs/Model/ImportTicketsRequest.md @@ -0,0 +1,9 @@ +# # ImportTicketsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tickets** | [**\OpenAPI\Client\Model\WTTicketUpdateParams[]**](WTTicketUpdateParams.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ImportedList.md b/docs/Model/ImportedList.md index 25c17b0..a90531e 100644 --- a/docs/Model/ImportedList.md +++ b/docs/Model/ImportedList.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **is_active** | **bool** | | **list_name** | **string** | | **phone_number_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/ImportedListRecipient.md b/docs/Model/ImportedListRecipient.md index 4e70774..886a9c0 100644 --- a/docs/Model/ImportedListRecipient.md +++ b/docs/Model/ImportedListRecipient.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **imported_list_id** | **string** | | **mobile_phone_number** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/InboundSMS.md b/docs/Model/InboundSMS.md index 59c1f5a..3111504 100644 --- a/docs/Model/InboundSMS.md +++ b/docs/Model/InboundSMS.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **automated_reply** | **string** | | **automated_reply_additional_info** | **string** | | **sms_sid** | **string** | | diff --git a/docs/Model/InternalServerError.md b/docs/Model/InternalServerError.md index e2f45ae..ec06ed7 100644 --- a/docs/Model/InternalServerError.md +++ b/docs/Model/InternalServerError.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **string** | | **message** | **string** | | **stack** | **string** | | [optional] -**http_error_code** | **double** | | +**http_error_code** | **float** | | **tracking_code** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LedgerEntry.md b/docs/Model/LedgerEntry.md index a9bdf91..7e005b0 100644 --- a/docs/Model/LedgerEntry.md +++ b/docs/Model/LedgerEntry.md @@ -7,17 +7,17 @@ Name | Type | Description | Notes **register_id** | **string** | | **register_type** | [**\OpenAPI\Client\Model\ApplicableTerminals**](ApplicableTerminals.md) | | **transaction_id** | **string** | | -**transaction_type** | [**AnyOfStringString**](AnyOfStringString.md) | | -**check_amount** | **double** | | -**transaction_amount** | **double** | | -**check_balance** | **double** | | +**transaction_type** | [**\OpenAPI\Client\Model\LedgerEntryTransactionType**](LedgerEntryTransactionType.md) | | +**check_amount** | **float** | | +**transaction_amount** | **float** | | +**check_balance** | **float** | | **discount_received** | **string** | | **payment_object_prefix** | **string** | | **payment_object_id** | **string** | | **parent_object_prefix** | **string** | | -**parent_object_id** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**parent_object_id** | [**\OpenAPI\Client\Model\LedgerEntryParentObjectID**](LedgerEntryParentObjectID.md) | | **meta_value** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/LedgerEntryParentObjectID.md b/docs/Model/LedgerEntryParentObjectID.md new file mode 100644 index 0000000..bd554c9 --- /dev/null +++ b/docs/Model/LedgerEntryParentObjectID.md @@ -0,0 +1,8 @@ +# # LedgerEntryParentObjectID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LedgerEntryTransactionType.md b/docs/Model/LedgerEntryTransactionType.md new file mode 100644 index 0000000..c2327bd --- /dev/null +++ b/docs/Model/LedgerEntryTransactionType.md @@ -0,0 +1,8 @@ +# # LedgerEntryTransactionType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LinkBook.md b/docs/Model/LinkBook.md index 48bb3fd..2e9d0f6 100644 --- a/docs/Model/LinkBook.md +++ b/docs/Model/LinkBook.md @@ -8,8 +8,8 @@ Name | Type | Description | Notes **url** | **string** | | **icon** | **string** | | **order_number** | **int** | | -**link_book_section_id** | [**AnyOfStringNumber**](AnyOfStringNumber.md) | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**link_book_section_id** | [**\OpenAPI\Client\Model\WTLinkBookLinkBookSectionID**](WTLinkBookLinkBookSectionID.md) | | [optional] +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/LinkBookSection.md b/docs/Model/LinkBookSection.md index d1dd7e6..a71e069 100644 --- a/docs/Model/LinkBookSection.md +++ b/docs/Model/LinkBookSection.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | | **order_number** | **int** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/LoginStatus200Response.md b/docs/Model/LoginStatus200Response.md new file mode 100644 index 0000000..9d67284 --- /dev/null +++ b/docs/Model/LoginStatus200Response.md @@ -0,0 +1,11 @@ +# # LoginStatus200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | | +**code** | **string** | | +**status** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LoginStatus200ResponseAnyOf.md b/docs/Model/LoginStatus200ResponseAnyOf.md new file mode 100644 index 0000000..ab8dc6a --- /dev/null +++ b/docs/Model/LoginStatus200ResponseAnyOf.md @@ -0,0 +1,10 @@ +# # LoginStatus200ResponseAnyOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | | +**code** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Lounge.md b/docs/Model/Lounge.md index f3b9c0d..c4fe736 100644 --- a/docs/Model/Lounge.md +++ b/docs/Model/Lounge.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **order_number** | **int** | | **media_url** | **string** | | [optional] **additional_info_url** | **string** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/MSMemberHistory.md b/docs/Model/MSMemberHistory.md index 70165f0..8618689 100644 --- a/docs/Model/MSMemberHistory.md +++ b/docs/Model/MSMemberHistory.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **last_name** | **string** | An optional last name of the member | [optional] **membership_tier_id** | **string** | | **mobile_number** | **string** | | +**email** | **string** | | +**birthday** | **string** | Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured | **points_accrued** | **int** | The number of points that the member has accrued | **id** | **string** | The UUID of this record | **member_id** | **string** | | diff --git a/docs/Model/MSMemberRedemption.md b/docs/Model/MSMemberRedemption.md index cf7c4b9..1d2cfb4 100644 --- a/docs/Model/MSMemberRedemption.md +++ b/docs/Model/MSMemberRedemption.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **transaction_id** | **string** | The transaction ID at the POS | -**transaction_type** | [**AnyOfStringString**](AnyOfStringString.md) | The type of the transaction - either redemption or refund | +**transaction_type** | [**\OpenAPI\Client\Model\MSMemberRedemptionTransactionType**](MSMemberRedemptionTransactionType.md) | | **points** | **int** | The number of points involved in this transaction | -**register_id** | [**AnyOfStringDouble**](AnyOfStringDouble.md) | The ID of the register where the transaction occurred | [optional] +**register_id** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md) | | [optional] **terminal_type** | **string** | The type of the terminal | **id** | **string** | The UUID of this record | **member_id** | **string** | | diff --git a/docs/Model/MSMemberRedemptionTransactionType.md b/docs/Model/MSMemberRedemptionTransactionType.md new file mode 100644 index 0000000..d2f4b99 --- /dev/null +++ b/docs/Model/MSMemberRedemptionTransactionType.md @@ -0,0 +1,8 @@ +# # MSMemberRedemptionTransactionType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MSMembershipTierRedemption.md b/docs/Model/MSMembershipTierRedemption.md index d07912e..3832bf1 100644 --- a/docs/Model/MSMembershipTierRedemption.md +++ b/docs/Model/MSMembershipTierRedemption.md @@ -6,9 +6,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **member_id** | **string** | A 10 character alphanumeric unique value that represents each member | **transaction_id** | **string** | The transaction ID at the POS | -**transaction_type** | [**AnyOfStringString**](AnyOfStringString.md) | The type of the transaction - either redemption or refund | +**transaction_type** | [**\OpenAPI\Client\Model\MSMemberRedemptionTransactionType**](MSMemberRedemptionTransactionType.md) | | **amount** | **int** | The amount that has been redeemed, in cents | -**register_id** | [**AnyOfStringDouble**](AnyOfStringDouble.md) | The ID of the register where the transaction occurred | [optional] +**register_id** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md) | | [optional] **terminal_type** | **string** | The type of the terminal | **id** | **string** | The UUID of this record | **tier_id** | **string** | A 10 character alphanumeric unique value that represents each membership tier | diff --git a/docs/Model/MSMerchantCreditRedemption.md b/docs/Model/MSMerchantCreditRedemption.md index 858692a..8cd78b3 100644 --- a/docs/Model/MSMerchantCreditRedemption.md +++ b/docs/Model/MSMerchantCreditRedemption.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **transaction_id** | **string** | The transaction ID at the POS | -**transaction_type** | [**AnyOfStringString**](AnyOfStringString.md) | The type of the transaction - either redemption or refund | +**transaction_type** | [**\OpenAPI\Client\Model\MSMemberRedemptionTransactionType**](MSMemberRedemptionTransactionType.md) | | **amount** | **int** | The number of amount involved in this transaction | -**register_id** | [**AnyOfStringDouble**](AnyOfStringDouble.md) | The ID of the register where the transaction occurred | [optional] +**register_id** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md) | | [optional] **terminal_type** | **string** | The type of the terminal | **id** | **string** | The UUID of this record | **merchant_credit_id** | **string** | | diff --git a/docs/Model/MediaFile.md b/docs/Model/MediaFile.md index b5356c6..5cf176e 100644 --- a/docs/Model/MediaFile.md +++ b/docs/Model/MediaFile.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **file_url** | **string** | The URL of the file | **file_type** | **string** | The type of the file | **file_name** | **string** | The name of the file | -**file_size** | **double** | The size of the file | +**file_size** | **float** | The size of the file | **folder** | **string** | The folder in which the file is stored | **employee_id** | **string** | | diff --git a/docs/Model/Member.md b/docs/Model/Member.md index 8974990..df06edf 100644 --- a/docs/Model/Member.md +++ b/docs/Model/Member.md @@ -13,6 +13,8 @@ Name | Type | Description | Notes **last_name** | **string** | An optional last name of the member | [optional] **membership_tier_id** | **string** | | **mobile_number** | **string** | | +**email** | **string** | | +**birthday** | **string** | Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured | **points_accrued** | **int** | The number of points that the member has accrued | **member_id** | **string** | Member ID as represented by the merchant | **membership_tier_redeemable_id** | **string** | | diff --git a/docs/Model/MemberSearch.md b/docs/Model/MemberSearch.md index ff6e982..c1ec781 100644 --- a/docs/Model/MemberSearch.md +++ b/docs/Model/MemberSearch.md @@ -7,9 +7,9 @@ Name | Type | Description | Notes **is_archive_included** | **bool** | Denotes if archived records should be included in the response payload | [optional] **page_size** | **int** | Denotes the number of records per page | [optional] **page_num** | **int** | Denotes the page number | [optional] -**sort_order** | [**AnyOfStringString**](AnyOfStringString.md) | Denotes the sort order | [optional] -**sort_key** | [**AnyOfStringStringStringStringString**](AnyOfStringStringStringStringString.md) | Denotes the key using which the records need to be sorted | [optional] -**search_key** | [**AnyOfStringStringStringString**](AnyOfStringStringStringString.md) | The search key to be used | +**sort_order** | [**\OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder**](PaginationRequestWithSortOptionsSortOrder.md) | | [optional] +**sort_key** | [**\OpenAPI\Client\Model\MemberSearchSortKey**](MemberSearchSortKey.md) | | [optional] +**search_key** | [**\OpenAPI\Client\Model\MemberSearchSearchKey**](MemberSearchSearchKey.md) | | **search_value** | **string** | The search value to be queried | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MemberSearchSearchKey.md b/docs/Model/MemberSearchSearchKey.md new file mode 100644 index 0000000..ad0ca0d --- /dev/null +++ b/docs/Model/MemberSearchSearchKey.md @@ -0,0 +1,8 @@ +# # MemberSearchSearchKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MemberSearchSortKey.md b/docs/Model/MemberSearchSortKey.md new file mode 100644 index 0000000..0dc00ed --- /dev/null +++ b/docs/Model/MemberSearchSortKey.md @@ -0,0 +1,8 @@ +# # MemberSearchSortKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Merchant.md b/docs/Model/Merchant.md index a8c0b21..4dd0f16 100644 --- a/docs/Model/Merchant.md +++ b/docs/Model/Merchant.md @@ -27,7 +27,7 @@ Name | Type | Description | Notes **stripe_customer_id** | **string** | | **is_payment_method_provided** | **bool** | | **plan_nickname** | **string** | | -**max_sms_count** | **double** | | +**max_sms_count** | **float** | | **is_sms_agreement** | **bool** | | [optional] **is_white_labeled** | **bool** | | [optional] **is_featured** | **bool** | | [optional] diff --git a/docs/Model/MerchantNotInitialized.md b/docs/Model/MerchantNotInitialized.md index e225dd1..764a4c4 100644 --- a/docs/Model/MerchantNotInitialized.md +++ b/docs/Model/MerchantNotInitialized.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **name** | **string** | | **message** | **string** | | **stack** | **string** | | [optional] -**http_error_code** | **double** | | +**http_error_code** | **float** | | **tracking_code** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MerchantURL.md b/docs/Model/MerchantURL.md index c36725f..6d5c0d6 100644 --- a/docs/Model/MerchantURL.md +++ b/docs/Model/MerchantURL.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **nickname** | **string** | | **destination_url** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **merchant_id** | **string** | | diff --git a/docs/Model/ModuleError.md b/docs/Model/ModuleError.md index 2ef7d6d..fbb7ea7 100644 --- a/docs/Model/ModuleError.md +++ b/docs/Model/ModuleError.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **method_type** | **string** | | **stack_trace** | **mixed** | | **exception** | **mixed** | | -**severity** | **double** | | +**severity** | **float** | | **microservice_url** | **string** | | **microservice_data** | **mixed** | | **microservice_method** | **string** | | diff --git a/docs/Model/NewsArticle.md b/docs/Model/NewsArticle.md index 8704a85..82a7c27 100644 --- a/docs/Model/NewsArticle.md +++ b/docs/Model/NewsArticle.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **url** | **string** | | **media_url** | **string** | | [optional] **published_date** | **\DateTime** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/OptInList.md b/docs/Model/OptInList.md index 4a8c3f5..0b3f8fc 100644 --- a/docs/Model/OptInList.md +++ b/docs/Model/OptInList.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **opt_in_confirmed_media_urls** | **string[]** | | **opt_out_confirmed_media_urls** | **string[]** | | **is_over21_required** | **bool** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/OptInListSource.md b/docs/Model/OptInListSource.md index ee95eff..0ccfc23 100644 --- a/docs/Model/OptInListSource.md +++ b/docs/Model/OptInListSource.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **list_id** | **string** | | **source_name** | **string** | | **employee_id** | **string** | | diff --git a/docs/Model/OptInListSubscriber.md b/docs/Model/OptInListSubscriber.md index f45437e..ffa03e3 100644 --- a/docs/Model/OptInListSubscriber.md +++ b/docs/Model/OptInListSubscriber.md @@ -7,12 +7,12 @@ Name | Type | Description | Notes **caller_name** | **string** | | [optional] **caller_type** | **string** | | [optional] **opt_in_list_id** | **string** | | -**opt_in_source_id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**opt_in_source_id** | [**\OpenAPI\Client\Model\PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID**](PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID.md) | | **is_subscribed** | **bool** | | **is_pending_age21_verification** | **bool** | | **mobile_phone_number** | **string** | | **referring_url** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/OutboundSMS.md b/docs/Model/OutboundSMS.md index 56c68d7..99c6273 100644 --- a/docs/Model/OutboundSMS.md +++ b/docs/Model/OutboundSMS.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **employee_id** | **string** | | -**status** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**status** | [**\OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus**](PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | @@ -14,7 +14,7 @@ Name | Type | Description | Notes **body** | **string** | | **phone_number_id** | **string** | | **media_urls** | **string[]** | | -**payment_object_broadcast_id** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] +**payment_object_broadcast_id** | [**\OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID**](PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID.md) | | [optional] **body_template** | **string** | | **status_callback** | **string** | | **is_sent** | **bool** | | diff --git a/docs/Model/PaginationRequestWithSortOptions.md b/docs/Model/PaginationRequestWithSortOptions.md index 7fe93c1..7e34fe4 100644 --- a/docs/Model/PaginationRequestWithSortOptions.md +++ b/docs/Model/PaginationRequestWithSortOptions.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **page_size** | **int** | Denotes the number of records per page | [optional] **page_num** | **int** | Denotes the page number | [optional] **sort_key** | **string** | Denotes the key using which the records need to be sorted | [optional] -**sort_order** | [**AnyOfStringString**](AnyOfStringString.md) | Denotes the sort order | [optional] +**sort_order** | [**\OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder**](PaginationRequestWithSortOptionsSortOrder.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaginationRequestWithSortOptionsSortOrder.md b/docs/Model/PaginationRequestWithSortOptionsSortOrder.md new file mode 100644 index 0000000..a2d35a2 --- /dev/null +++ b/docs/Model/PaginationRequestWithSortOptionsSortOrder.md @@ -0,0 +1,8 @@ +# # PaginationRequestWithSortOptionsSortOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentDesign.md b/docs/Model/PaymentDesign.md index a8fe2c6..f34cd84 100644 --- a/docs/Model/PaymentDesign.md +++ b/docs/Model/PaymentDesign.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **border_color** | **string** | | -**border_style_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**border_style_type** | [**\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType**](PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.md) | | **border_size** | **string** | | **border_radius** | **int** | | **font_color** | **string** | | @@ -18,7 +18,7 @@ Name | Type | Description | Notes **background_image_url** | **string** | | [optional] **company_logo_url** | **string** | | [optional] **employee_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/Performance.md b/docs/Model/Performance.md index bbcc2ed..c83a0cf 100644 --- a/docs/Model/Performance.md +++ b/docs/Model/Performance.md @@ -13,10 +13,10 @@ Name | Type | Description | Notes **is_sold_out** | **bool** | Denotes if the event has been sold out | **media_url** | **string** | | [optional] **payment_design_id** | **string** | | [optional] -**max_comp_tickets** | **double** | | [optional] +**max_comp_tickets** | **float** | | [optional] **ticket_expiration_date_time** | **\DateTime** | | [optional] **redemption_instructions** | **string** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/PhoneNumber.md b/docs/Model/PhoneNumber.md index 47c54f9..c299f5d 100644 --- a/docs/Model/PhoneNumber.md +++ b/docs/Model/PhoneNumber.md @@ -20,7 +20,7 @@ Name | Type | Description | Notes **is_short_code** | **bool** | | **twilio_sid** | **string** | | **twilio_account_sid** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive.md b/docs/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive.md index 317b8e2..8734a93 100644 --- a/docs/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive.md +++ b/docs/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | | **notes** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **display_value** | **string** | | [optional] **merchants_reference_id** | **string** | | [optional] **valid_only_at_pos_register_ids** | **string[]** | | [optional] diff --git a/docs/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.md b/docs/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.md index 9f3f36a..fc02698 100644 --- a/docs/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.md +++ b/docs/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | | **notes** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **display_value** | **string** | | [optional] **merchants_reference_id** | **string** | | [optional] **valid_only_at_pos_register_ids** | **string[]** | | [optional] diff --git a/docs/Model/PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.md b/docs/Model/PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.md index 16f0225..a139fbb 100644 --- a/docs/Model/PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.md +++ b/docs/Model/PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.md @@ -8,6 +8,8 @@ Name | Type | Description | Notes **last_name** | **string** | An optional last name of the member | [optional] **membership_tier_id** | **string** | | **mobile_number** | **string** | | +**email** | **string** | | +**birthday** | **string** | Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured | **points_accrued** | **int** | The number of points that the member has accrued | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickMSMemberExcludeKeyofMSMemberMemberIdentifier.md b/docs/Model/PickMSMemberExcludeKeyofMSMemberMemberIdentifier.md index 3e06e89..7e9e27a 100644 --- a/docs/Model/PickMSMemberExcludeKeyofMSMemberMemberIdentifier.md +++ b/docs/Model/PickMSMemberExcludeKeyofMSMemberMemberIdentifier.md @@ -13,6 +13,8 @@ Name | Type | Description | Notes **last_name** | **string** | An optional last name of the member | [optional] **membership_tier_id** | **string** | | **mobile_number** | **string** | | +**email** | **string** | | +**birthday** | **string** | Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured | **points_accrued** | **int** | The number of points that the member has accrued | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortOptionsSortKey.md b/docs/Model/PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortOptionsSortKey.md index 898875e..58de70a 100644 --- a/docs/Model/PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortOptionsSortKey.md +++ b/docs/Model/PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortOptionsSortKey.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes **is_archive_included** | **bool** | Denotes if archived records should be included in the response payload | [optional] **page_size** | **int** | Denotes the number of records per page | [optional] **page_num** | **int** | Denotes the page number | [optional] -**sort_order** | [**AnyOfStringString**](AnyOfStringString.md) | Denotes the sort order | [optional] +**sort_order** | [**\OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder**](PaginationRequestWithSortOptionsSortOrder.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount.md b/docs/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount.md index 6d3b821..206799f 100644 --- a/docs/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount.md +++ b/docs/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **caller_name** | **string** | | [optional] **caller_type** | **string** | | [optional] **opt_in_list_id** | **string** | | -**opt_in_source_id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**opt_in_source_id** | [**\OpenAPI\Client\Model\PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID**](PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID.md) | | **is_subscribed** | **bool** | | **is_pending_age21_verification** | **bool** | | **mobile_phone_number** | **string** | | diff --git a/docs/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID.md b/docs/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID.md new file mode 100644 index 0000000..284d8c9 --- /dev/null +++ b/docs/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID.md @@ -0,0 +1,8 @@ +# # PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.md b/docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.md index f49e6ed..7394975 100644 --- a/docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.md +++ b/docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | | **employee_id** | **string** | | -**status** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**status** | [**\OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus**](PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | @@ -14,7 +14,7 @@ Name | Type | Description | Notes **body** | **string** | | **phone_number_id** | **string** | | **media_urls** | **string[]** | | -**payment_object_broadcast_id** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] +**payment_object_broadcast_id** | [**\OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID**](PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID.md) | | [optional] **body_template** | **string** | | **status_callback** | **string** | | **is_sent** | **bool** | | diff --git a/docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID.md b/docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID.md new file mode 100644 index 0000000..7f67922 --- /dev/null +++ b/docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID.md @@ -0,0 +1,8 @@ +# # PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus.md b/docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus.md new file mode 100644 index 0000000..78d8a55 --- /dev/null +++ b/docs/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus.md @@ -0,0 +1,8 @@ +# # PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID.md b/docs/Model/PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID.md index 0bc0c90..574b7e4 100644 --- a/docs/Model/PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID.md +++ b/docs/Model/PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **payment_design_id** | **string** | | **max_uses** | **int** | | **discount_value** | **int** | | diff --git a/docs/Model/PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.md b/docs/Model/PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.md index 4b5b34c..91360e3 100644 --- a/docs/Model/PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.md +++ b/docs/Model/PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | | -**transaction_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | The type of the transaction - only redemption at the moment | -**register_id** | [**AnyOfStringDouble**](AnyOfStringDouble.md) | The ID of the register where the transaction occurred | +**transaction_type** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.md) | | +**register_id** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md) | | **redeemed_source** | **string** | | **redeemed_transaction_id** | **string** | | **redeemed_amount** | **int** | | diff --git a/docs/Model/PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.md b/docs/Model/PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.md index bd08291..f3d896d 100644 --- a/docs/Model/PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.md +++ b/docs/Model/PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **payment_design_id** | **string** | | **max_uses** | **int** | | **discount_value** | **int** | | diff --git a/docs/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.md b/docs/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.md index 3fe60f6..a35ad6a 100644 --- a/docs/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.md +++ b/docs/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **id** | **string** | | **title** | **string** | | **notes** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **is_loaded** | **bool** | | **display_value** | **string** | | [optional] **merchants_reference_id** | **string** | | [optional] diff --git a/docs/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md b/docs/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md new file mode 100644 index 0000000..8540aef --- /dev/null +++ b/docs/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md @@ -0,0 +1,8 @@ +# # PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID.md b/docs/Model/PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID.md index 6df4264..b678341 100644 --- a/docs/Model/PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID.md +++ b/docs/Model/PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **border_color** | **string** | | -**border_style_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**border_style_type** | [**\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType**](PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.md) | | **border_size** | **string** | | **border_radius** | **int** | | **font_color** | **string** | | diff --git a/docs/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.md b/docs/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.md index 2602509..dc598d9 100644 --- a/docs/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.md +++ b/docs/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **border_color** | **string** | | -**border_style_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**border_style_type** | [**\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType**](PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.md) | | **border_size** | **string** | | **border_radius** | **int** | | **font_color** | **string** | | diff --git a/docs/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.md b/docs/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.md new file mode 100644 index 0000000..4361a8f --- /dev/null +++ b/docs/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.md @@ -0,0 +1,8 @@ +# # PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.md b/docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.md index b0f3830..eb84559 100644 --- a/docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.md +++ b/docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.md @@ -10,8 +10,8 @@ Name | Type | Description | Notes **cell_phone_number** | **string** | | [optional] **offer_amount_cents** | **int** | | **order_number** | **int** | | -**transaction_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | The type of the transaction - only redemption at the moment | -**register_id** | [**AnyOfStringDouble**](AnyOfStringDouble.md) | The ID of the register where the transaction occurred | +**transaction_type** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.md) | | +**register_id** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md) | | **redeemed_source** | **string** | | **redeemed_transaction_id** | **string** | | **redeemed_amount** | **int** | | diff --git a/docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md b/docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md new file mode 100644 index 0000000..8fcc16e --- /dev/null +++ b/docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md @@ -0,0 +1,8 @@ +# # PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.md b/docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.md new file mode 100644 index 0000000..c0ade14 --- /dev/null +++ b/docs/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.md @@ -0,0 +1,8 @@ +# # PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.md b/docs/Model/PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.md index 004f9c4..fc56611 100644 --- a/docs/Model/PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.md +++ b/docs/Model/PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.md @@ -12,13 +12,13 @@ Name | Type | Description | Notes **wallet_sequence_number** | **int** | | **job_title** | **string** | | **department** | **string** | | -**schedule_start_day** | [**AnyOfStringStringStringStringStringStringString**](AnyOfStringStringStringStringStringStringString.md) | | [optional] -**schedule_start_hour** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_start_minute** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_start_meridiem** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] -**schedule_end_day** | [**AnyOfStringStringStringStringStringStringString**](AnyOfStringStringStringStringStringStringString.md) | | [optional] -**schedule_end_hour** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_end_minute** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_end_meridiem** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] +**schedule_start_day** | [**\OpenAPI\Client\Model\EmployeeScheduleStartDay**](EmployeeScheduleStartDay.md) | | [optional] +**schedule_start_hour** | [**\OpenAPI\Client\Model\EmployeeScheduleStartHour**](EmployeeScheduleStartHour.md) | | [optional] +**schedule_start_minute** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMinute**](EmployeeScheduleStartMinute.md) | | [optional] +**schedule_start_meridiem** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem**](EmployeeScheduleStartMeridiem.md) | | [optional] +**schedule_end_day** | [**\OpenAPI\Client\Model\EmployeeScheduleStartDay**](EmployeeScheduleStartDay.md) | | [optional] +**schedule_end_hour** | [**\OpenAPI\Client\Model\EmployeeScheduleStartHour**](EmployeeScheduleStartHour.md) | | [optional] +**schedule_end_minute** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMinute**](EmployeeScheduleStartMinute.md) | | [optional] +**schedule_end_meridiem** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem**](EmployeeScheduleStartMeridiem.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday.md b/docs/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday.md new file mode 100644 index 0000000..2120784 --- /dev/null +++ b/docs/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday.md @@ -0,0 +1,16 @@ +# # PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**member_id** | **string** | Member ID as represented by the merchant | +**first_name** | **string** | An optional first name of the member | [optional] +**last_name** | **string** | An optional last name of the member | [optional] +**membership_tier_id** | **string** | | +**mobile_number** | **string** | | +**email** | **string** | | +**birthday** | **string** | Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured | +**points_accrued** | **int** | The number of points that the member has accrued | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.md b/docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.md index 6883fd0..b243e47 100644 --- a/docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.md +++ b/docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **employee_id** | **string** | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | @@ -14,11 +14,11 @@ Name | Type | Description | Notes **media_urls** | **string[]** | | **opt_in_list** | [**\OpenAPI\Client\Model\WTOptInList**](WTOptInList.md) | | [optional] **imported_list** | [**\OpenAPI\Client\Model\WTImportedList**](WTImportedList.md) | | [optional] -**broadcast_status** | [**AnyOfStringStringStringStringString**](AnyOfStringStringStringStringString.md) | | +**broadcast_status** | [**\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus**](PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.md) | | **broadcast_queued_at** | **\DateTime** | | **broadcast_started_at** | **\DateTime** | | **broadcast_completed_at** | **\DateTime** | | -**payment_object_prefix** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**payment_object_prefix** | [**\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix**](PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.md) | | **payment_object_id** | **string** | | **message_template** | **string** | | **broadcast_scheduled_at** | **\DateTime** | | diff --git a/docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.md b/docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.md new file mode 100644 index 0000000..d6b6a0b --- /dev/null +++ b/docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.md @@ -0,0 +1,8 @@ +# # PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.md b/docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.md new file mode 100644 index 0000000..21e0e7e --- /dev/null +++ b/docs/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.md @@ -0,0 +1,8 @@ +# # PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId.md b/docs/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId.md new file mode 100644 index 0000000..145e493 --- /dev/null +++ b/docs/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId.md @@ -0,0 +1,9 @@ +# # PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mobile_number** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.md b/docs/Model/PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.md index 7494fe6..85a69d6 100644 --- a/docs/Model/PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.md +++ b/docs/Model/PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | | **notes** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **is_loaded** | **bool** | | **display_value** | **string** | | [optional] **merchants_reference_id** | **string** | | [optional] diff --git a/docs/Model/PromoCode.md b/docs/Model/PromoCode.md index e4317b3..a7e386b 100644 --- a/docs/Model/PromoCode.md +++ b/docs/Model/PromoCode.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **media_url** | **string** | | [optional] **start_date** | **\DateTime** | | **expiration_date** | **\DateTime** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/QRCodeDesign.md b/docs/Model/QRCodeDesign.md index ca0989c..70bed8e 100644 --- a/docs/Model/QRCodeDesign.md +++ b/docs/Model/QRCodeDesign.md @@ -7,14 +7,15 @@ Name | Type | Description | Notes **name** | **string** | | **size** | **int** | | **margin** | **int** | | +**is_margin_white** | **bool** | | **corner_radius** | **int** | | **color_dark_hex** | **string** | | **color_light_hex** | **string** | | **background_dimming_hex** | **string** | | -**logo_image_url** | **string** | | -**background_image_url** | **string** | | -**animated_gif_background_url** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**logo_image_url** | **string** | | [optional] +**background_image_url** | **string** | | [optional] +**animated_gif_background_url** | **string** | | [optional] +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/Request.md b/docs/Model/Request.md index 072bb82..b53fd86 100644 --- a/docs/Model/Request.md +++ b/docs/Model/Request.md @@ -7,20 +7,20 @@ Name | Type | Description | Notes **id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | -**auth_amount** | **double** | | +**auth_amount** | **float** | | **server_emp_id** | **string** | | **module_invoked** | **mixed** | | **cashier_emp_id** | **string** | | **routing_id** | **string** | | -**auth_account_num** | **double** | | -**more_records_count** | **double** | | +**auth_account_num** | **float** | | +**more_records_count** | **float** | | **payment_method_id** | **string** | | **tag_data** | **mixed** | | -**total_auth_amount** | **double** | | +**total_auth_amount** | **float** | | **refund_flag** | **mixed** | | **close_time** | **\DateTime** | | **client_id** | **string** | | -**change_amount** | **double** | | +**change_amount** | **float** | | **employee_id** | **string** | | **training_mode_flag** | **mixed** | | **source_property_id** | **string** | | @@ -32,29 +32,29 @@ Name | Type | Description | Notes **payment_slip_id** | **string** | | **financial_bin_detail** | **mixed** | | **cvv2** | **string** | | -**employee_grat_tip** | **double** | | +**employee_grat_tip** | **float** | | **card_swipe_track1** | **mixed** | | **card_swipe_track2** | **mixed** | | **check_number** | **string** | | **more_records_key** | **mixed** | | -**tip_amount** | **double** | | +**tip_amount** | **float** | | **input_data** | **mixed** | | **profit_center_id** | **string** | | **invoice_number** | **string** | | **receipt_text_image** | **mixed** | | -**brokerage_amount** | **double** | | -**amount** | **double** | | -**cover_count** | **double** | | +**brokerage_amount** | **float** | | +**amount** | **float** | | +**cover_count** | **float** | | **more_records_flag** | **mixed** | | **account_num** | **string** | | -**max_record_count** | **double** | | -**incremental_auth_amount** | **double** | | +**max_record_count** | **float** | | +**incremental_auth_amount** | **float** | | **extra_data** | **mixed** | | **check_type_id** | **string** | | **posting_id** | **string** | | **destination_property_id** | **string** | | **account_detail** | **mixed** | | -**payment_amount** | **double** | | +**payment_amount** | **float** | | **register_id** | **string** | | **tndr_account_object** | **mixed** | | **meal_period_id** | **string** | | diff --git a/docs/Model/Role.md b/docs/Model/Role.md index 5cb3c7d..4ca0487 100644 --- a/docs/Model/Role.md +++ b/docs/Model/Role.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **name** | **string** | | **display_name** | **string** | | **is_public** | **bool** | | -**order_number** | **double** | | +**order_number** | **float** | | **is_system** | **bool** | | **icons** | **string[]** | | **category** | **string** | | diff --git a/docs/Model/RoomRate.md b/docs/Model/RoomRate.md index 9916128..a5e33c9 100644 --- a/docs/Model/RoomRate.md +++ b/docs/Model/RoomRate.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **order_number** | **int** | | **media_url** | **string** | | [optional] **additional_info_url** | **string** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/SaveMerchantCreditPaymentDesignRequest.md b/docs/Model/SaveMerchantCreditPaymentDesignRequest.md new file mode 100644 index 0000000..0e04f10 --- /dev/null +++ b/docs/Model/SaveMerchantCreditPaymentDesignRequest.md @@ -0,0 +1,9 @@ +# # SaveMerchantCreditPaymentDesignRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payment_design_id** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SaveTicketSettingsRequest.md b/docs/Model/SaveTicketSettingsRequest.md new file mode 100644 index 0000000..e7da3a7 --- /dev/null +++ b/docs/Model/SaveTicketSettingsRequest.md @@ -0,0 +1,12 @@ +# # SaveTicketSettingsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**redemption_instructions** | **string** | | [optional] +**ticket_expiration_date_time** | **\DateTime** | | +**max_comp_tickets** | **float** | | +**payment_design_id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SaveTicketSettingsRequestPaymentDesignID.md b/docs/Model/SaveTicketSettingsRequestPaymentDesignID.md new file mode 100644 index 0000000..09c5262 --- /dev/null +++ b/docs/Model/SaveTicketSettingsRequestPaymentDesignID.md @@ -0,0 +1,8 @@ +# # SaveTicketSettingsRequestPaymentDesignID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Service.md b/docs/Model/Service.md index 6e79b3a..a11689a 100644 --- a/docs/Model/Service.md +++ b/docs/Model/Service.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **order_number** | **int** | | **media_url** | **string** | | [optional] **additional_info_url** | **string** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/SimpleSMSBroadcast.md b/docs/Model/SimpleSMSBroadcast.md index ac34912..129c362 100644 --- a/docs/Model/SimpleSMSBroadcast.md +++ b/docs/Model/SimpleSMSBroadcast.md @@ -5,22 +5,22 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **phone_number_id** | **string** | | -**payment_object_prefix** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**payment_object_prefix** | [**\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix**](PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.md) | | **payment_object_id** | **string** | | **message_template** | **string** | | **media_urls** | **string[]** | | **employee_id** | **string** | | **broadcast_scheduled_at** | **\DateTime** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | -**broadcast_status** | [**AnyOfStringStringStringStringString**](AnyOfStringStringStringStringString.md) | | +**broadcast_status** | [**\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus**](PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.md) | | **broadcast_queued_at** | **\DateTime** | | **broadcast_started_at** | **\DateTime** | | **broadcast_completed_at** | **\DateTime** | | -**list_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**list_type** | [**\OpenAPI\Client\Model\DynamicVoucherBroadcastListType**](DynamicVoucherBroadcastListType.md) | | **list_id** | **string** | | **opt_in_list** | [**\OpenAPI\Client\Model\WTOptInList**](WTOptInList.md) | | [optional] **imported_list** | [**\OpenAPI\Client\Model\WTImportedList**](WTImportedList.md) | | [optional] diff --git a/docs/Model/SmsSubscriber.md b/docs/Model/SmsSubscriber.md new file mode 100644 index 0000000..9d2eed8 --- /dev/null +++ b/docs/Model/SmsSubscriber.md @@ -0,0 +1,14 @@ +# # SmsSubscriber + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mobile_number** | **string** | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | +**created_at** | **\DateTime** | | +**updated_at** | **\DateTime** | | +**is_active** | **bool** | | +**merchant_id** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/StaticVoucher.md b/docs/Model/StaticVoucher.md index 24d6ec0..a919926 100644 --- a/docs/Model/StaticVoucher.md +++ b/docs/Model/StaticVoucher.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **campaign_id** | **string** | | **member_id** | **string** | | [optional] **cell_phone_number** | **string** | | [optional] **offer_amount_cents** | **int** | | **order_number** | **int** | | -**transaction_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | The type of the transaction - only redemption at the moment | -**register_id** | [**AnyOfStringDouble**](AnyOfStringDouble.md) | The ID of the register where the transaction occurred | +**transaction_type** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.md) | | +**register_id** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md) | | **redeemed_source** | **string** | | **redeemed_transaction_id** | **string** | | **redeemed_amount** | **int** | | diff --git a/docs/Model/StaticVoucherCampaign.md b/docs/Model/StaticVoucherCampaign.md index e7d1245..b46f235 100644 --- a/docs/Model/StaticVoucherCampaign.md +++ b/docs/Model/StaticVoucherCampaign.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **title** | **string** | | **notes** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **is_loaded** | **bool** | | **display_value** | **string** | | [optional] **merchants_reference_id** | **string** | | [optional] @@ -24,7 +24,7 @@ Name | Type | Description | Notes **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | -**voucher_type** | **double** | | +**voucher_type** | **float** | | **reinvestment_sum_decimal** | **string** | | **reinvestment_sum_string** | **string** | | **start_date** | **\DateTime** | | diff --git a/docs/Model/StaticVoucherCampaignBroadcast.md b/docs/Model/StaticVoucherCampaignBroadcast.md index df25824..85313db 100644 --- a/docs/Model/StaticVoucherCampaignBroadcast.md +++ b/docs/Model/StaticVoucherCampaignBroadcast.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **employee_id** | **string** | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | @@ -14,11 +14,11 @@ Name | Type | Description | Notes **media_urls** | **string[]** | | **opt_in_list** | [**\OpenAPI\Client\Model\WTOptInList**](WTOptInList.md) | | [optional] **imported_list** | [**\OpenAPI\Client\Model\WTImportedList**](WTImportedList.md) | | [optional] -**broadcast_status** | [**AnyOfStringStringStringStringString**](AnyOfStringStringStringStringString.md) | | +**broadcast_status** | [**\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus**](PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.md) | | **broadcast_queued_at** | **\DateTime** | | **broadcast_started_at** | **\DateTime** | | **broadcast_completed_at** | **\DateTime** | | -**payment_object_prefix** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**payment_object_prefix** | [**\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix**](PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.md) | | **payment_object_id** | **string** | | **message_template** | **string** | | **broadcast_scheduled_at** | **\DateTime** | | diff --git a/docs/Model/StaticVoucherCampaignGroup.md b/docs/Model/StaticVoucherCampaignGroup.md index 869df3f..e9171fa 100644 --- a/docs/Model/StaticVoucherCampaignGroup.md +++ b/docs/Model/StaticVoucherCampaignGroup.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **voucher_type** | **int** | | **created_by_source_id** | **int** | | **employee_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/StaticVoucherCampaignUpdate.md b/docs/Model/StaticVoucherCampaignUpdate.md index 634bd30..f23a640 100644 --- a/docs/Model/StaticVoucherCampaignUpdate.md +++ b/docs/Model/StaticVoucherCampaignUpdate.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **expiration_date_time** | **\DateTime** | | **title** | **string** | | **notes** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **display_value** | **string** | | [optional] **merchants_reference_id** | **string** | | [optional] **valid_only_at_pos_register_ids** | **string[]** | | [optional] diff --git a/docs/Model/SubscriptionFeature.md b/docs/Model/SubscriptionFeature.md index de63f19..53987f2 100644 --- a/docs/Model/SubscriptionFeature.md +++ b/docs/Model/SubscriptionFeature.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sort_num** | **double** | | +**sort_num** | **float** | | **name** | **string** | | **max_volume** | **string** | | [optional] **measurement** | **string** | | diff --git a/docs/Model/SubscriptionPlan.md b/docs/Model/SubscriptionPlan.md index 9376b64..86f8597 100644 --- a/docs/Model/SubscriptionPlan.md +++ b/docs/Model/SubscriptionPlan.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | | **name** | **string** | | -**price** | **double** | | +**price** | **float** | | **nickname** | **string** | | **examples** | **string** | | **products** | [**\OpenAPI\Client\Model\SubscriptionProduct[]**](SubscriptionProduct.md) | | diff --git a/docs/Model/SubscriptionProduct.md b/docs/Model/SubscriptionProduct.md index 308c992..2dae049 100644 --- a/docs/Model/SubscriptionProduct.md +++ b/docs/Model/SubscriptionProduct.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **title** | **string** | | **title_full** | **string** | | **category** | **string** | | -**volume** | **double** | | [optional] +**volume** | **float** | | [optional] **features** | [**\OpenAPI\Client\Model\SubscriptionFeature[]**](SubscriptionFeature.md) | | **pages** | [**\OpenAPI\Client\Model\PortalPage[]**](PortalPage.md) | | **icon_name** | **string** | | diff --git a/docs/Model/Tcpa.md b/docs/Model/Tcpa.md index 48ea0d3..fc3648f 100644 --- a/docs/Model/Tcpa.md +++ b/docs/Model/Tcpa.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cell_phone** | **string** | | **phone_number_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/Ticket.md b/docs/Model/Ticket.md index bf4d069..3be196a 100644 --- a/docs/Model/Ticket.md +++ b/docs/Model/Ticket.md @@ -8,9 +8,9 @@ Name | Type | Description | Notes **recipient_email_address** | **string** | | [optional] **recipient_member_id** | **string** | | [optional] **is_comp** | **bool** | | [optional] -**quantity** | **double** | The number of tickets allocated to the recipient. | [optional] +**quantity** | **float** | The number of tickets allocated to the recipient. | [optional] **performance_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/UpdateEmailNotificationPreferenceRequest.md b/docs/Model/UpdateEmailNotificationPreferenceRequest.md new file mode 100644 index 0000000..8bee983 --- /dev/null +++ b/docs/Model/UpdateEmailNotificationPreferenceRequest.md @@ -0,0 +1,9 @@ +# # UpdateEmailNotificationPreferenceRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_email_notification_disabled** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateStaticVoucherCampaignWithVoucher.md b/docs/Model/UpdateStaticVoucherCampaignWithVoucher.md index e36ee51..ae220e7 100644 --- a/docs/Model/UpdateStaticVoucherCampaignWithVoucher.md +++ b/docs/Model/UpdateStaticVoucherCampaignWithVoucher.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | | **notes** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **display_value** | **string** | | [optional] **merchants_reference_id** | **string** | | [optional] **valid_only_at_pos_register_ids** | **string[]** | | [optional] @@ -16,6 +16,6 @@ Name | Type | Description | Notes **member_id** | **string** | | [optional] **offer_amount_cents** | **int** | | **cell_phone** | **string** | | [optional] -**voucher_id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**voucher_id** | [**\OpenAPI\Client\Model\UpdateStaticVoucherCampaignWithVoucherVoucherID**](UpdateStaticVoucherCampaignWithVoucherVoucherID.md) | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateStaticVoucherCampaignWithVoucherVoucherID.md b/docs/Model/UpdateStaticVoucherCampaignWithVoucherVoucherID.md new file mode 100644 index 0000000..1118e8c --- /dev/null +++ b/docs/Model/UpdateStaticVoucherCampaignWithVoucherVoucherID.md @@ -0,0 +1,8 @@ +# # UpdateStaticVoucherCampaignWithVoucherVoucherID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/VSCampaignGeneratedMessagePagination.md b/docs/Model/VSCampaignGeneratedMessagePagination.md index d3ed00e..76fcade 100644 --- a/docs/Model/VSCampaignGeneratedMessagePagination.md +++ b/docs/Model/VSCampaignGeneratedMessagePagination.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**\OpenAPI\Client\Model\VSCampaignGeneratedMessage[]**](VSCampaignGeneratedMessage.md) | Stores the results as an array | -**length** | **double** | Denotes the length of the results array | -**total** | **double** | Denotes the total number of records present in the database | +**length** | **float** | Denotes the length of the results array | +**total** | **float** | Denotes the total number of records present in the database | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Video.md b/docs/Model/Video.md index 9c2b012..83a799d 100644 --- a/docs/Model/Video.md +++ b/docs/Model/Video.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **order_number** | **int** | | **media_url** | **string** | | **additional_info_url** | **string** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/VirtualBusinessCard.md b/docs/Model/VirtualBusinessCard.md index ff964ab..d3a4b37 100644 --- a/docs/Model/VirtualBusinessCard.md +++ b/docs/Model/VirtualBusinessCard.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **linked_in** | **string** | | [optional] **whats_app** | **string** | | [optional] **avatar_url** | **string** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/WTAdvertisementCredit.md b/docs/Model/WTAdvertisementCredit.md index ea87c0f..3df8d6d 100644 --- a/docs/Model/WTAdvertisementCredit.md +++ b/docs/Model/WTAdvertisementCredit.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **payment_design_id** | **string** | | **max_uses** | **int** | | **discount_value** | **int** | | **employee_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/WTAdvertisementCreditCreateParams.md b/docs/Model/WTAdvertisementCreditCreateParams.md index eda450c..522af5f 100644 --- a/docs/Model/WTAdvertisementCreditCreateParams.md +++ b/docs/Model/WTAdvertisementCreditCreateParams.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **payment_design_id** | **string** | | **max_uses** | **int** | | **discount_value** | **int** | | diff --git a/docs/Model/WTAdvertisementCreditScan.md b/docs/Model/WTAdvertisementCreditScan.md index 417337e..145f3a2 100644 --- a/docs/Model/WTAdvertisementCreditScan.md +++ b/docs/Model/WTAdvertisementCreditScan.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | -**transaction_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | The type of the transaction - only redemption at the moment | -**register_id** | [**AnyOfStringDouble**](AnyOfStringDouble.md) | The ID of the register where the transaction occurred | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | +**transaction_type** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.md) | | +**register_id** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md) | | **redeemed_source** | **string** | | **redeemed_transaction_id** | **string** | | **redeemed_amount** | **int** | | diff --git a/docs/Model/WTAdvertisementCreditUpdateParams.md b/docs/Model/WTAdvertisementCreditUpdateParams.md index 6c2569f..1ea3df8 100644 --- a/docs/Model/WTAdvertisementCreditUpdateParams.md +++ b/docs/Model/WTAdvertisementCreditUpdateParams.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **payment_design_id** | **string** | | **max_uses** | **int** | | **discount_value** | **int** | | diff --git a/docs/Model/WTAuthenticationRegister.md b/docs/Model/WTAuthenticationRegister.md index a666f07..1fb7646 100644 --- a/docs/Model/WTAuthenticationRegister.md +++ b/docs/Model/WTAuthenticationRegister.md @@ -20,5 +20,7 @@ Name | Type | Description | Notes **country** | **string** | | **phone_number** | **string** | | **ein** | **string** | | [optional] +**ga_client_id** | **string** | | [optional] +**ga_measurement_id** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTCountResult.md b/docs/Model/WTCountResult.md index e9123a7..adde723 100644 --- a/docs/Model/WTCountResult.md +++ b/docs/Model/WTCountResult.md @@ -4,6 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**count** | **double** | | +**count** | **float** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTDynamicVoucher.md b/docs/Model/WTDynamicVoucher.md index b21f3bf..a649911 100644 --- a/docs/Model/WTDynamicVoucher.md +++ b/docs/Model/WTDynamicVoucher.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **start_date** | **\DateTime** | | **expiration_date** | **\DateTime** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **title** | **string** | | **notes** | **string** | | **merchants_reference_id** | **string** | | [optional] @@ -31,11 +31,11 @@ Name | Type | Description | Notes **starting_value_string** | **string** | | **max_budget_decimal** | **string** | | **max_budget_string** | **string** | | -**current_value** | **double** | | +**current_value** | **float** | | **current_value_decimal** | **string** | | **current_value_string** | **string** | | -**status** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | -**temporal_decrease_frequency_type** | [**AnyOfStringStringStringStringString**](AnyOfStringStringStringStringString.md) | | +**status** | [**\OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus**](WTDynamicVoucherSummaryStatus.md) | | +**temporal_decrease_frequency_type** | [**\OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType**](DynamicVoucherTemporalDecreaseFrequencyType.md) | | **summary** | [**\OpenAPI\Client\Model\WTDynamicVoucherSummary**](WTDynamicVoucherSummary.md) | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTDynamicVoucherCreateParams.md b/docs/Model/WTDynamicVoucherCreateParams.md index 866eaf5..04bdd07 100644 --- a/docs/Model/WTDynamicVoucherCreateParams.md +++ b/docs/Model/WTDynamicVoucherCreateParams.md @@ -13,8 +13,8 @@ Name | Type | Description | Notes **max_budget** | **int** | | **decrease_amount** | **int** | | **frequency** | **int** | | -**frequency_type** | [**AnyOfStringStringStringStringString**](AnyOfStringStringStringStringString.md) | | -**decrease_by** | **double** | | [optional] -**decrease_every** | **double** | | [optional] +**frequency_type** | [**\OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType**](DynamicVoucherTemporalDecreaseFrequencyType.md) | | +**decrease_by** | **float** | | [optional] +**decrease_every** | **float** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTDynamicVoucherRedemption.md b/docs/Model/WTDynamicVoucherRedemption.md index 5cf8c37..4a79b9a 100644 --- a/docs/Model/WTDynamicVoucherRedemption.md +++ b/docs/Model/WTDynamicVoucherRedemption.md @@ -9,9 +9,9 @@ Name | Type | Description | Notes **dynamic_voucher_id** | **string** | | **redeemed_source** | **string** | | **redeemed_transaction_id** | **string** | | -**transaction_type** | [**AnyOfStringString**](AnyOfStringString.md) | The type of the transaction - only redemption at the moment | -**register_id** | [**AnyOfStringDouble**](AnyOfStringDouble.md) | The ID of the register where the transaction occurred | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**transaction_type** | [**\OpenAPI\Client\Model\WTDynamicVoucherRedemptionTransactionType**](WTDynamicVoucherRedemptionTransactionType.md) | | +**register_id** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/WTDynamicVoucherRedemptionTransactionType.md b/docs/Model/WTDynamicVoucherRedemptionTransactionType.md new file mode 100644 index 0000000..57ac623 --- /dev/null +++ b/docs/Model/WTDynamicVoucherRedemptionTransactionType.md @@ -0,0 +1,8 @@ +# # WTDynamicVoucherRedemptionTransactionType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTDynamicVoucherSummary.md b/docs/Model/WTDynamicVoucherSummary.md index 8dd9ad7..3d47914 100644 --- a/docs/Model/WTDynamicVoucherSummary.md +++ b/docs/Model/WTDynamicVoucherSummary.md @@ -6,27 +6,27 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **calc_error** | **bool** | | **calc_error_details** | **string** | | -**current_value** | **double** | | +**current_value** | **float** | | **current_value_decimal** | **string** | | **current_value_string** | **string** | | **time_value_zero** | **bool** | | -**time_value_zero_subtracted_amount** | **double** | | -**total_number_redeemed** | **double** | | -**total_value_redeemed** | **double** | | -**total_budget_remaining** | **double** | | +**time_value_zero_subtracted_amount** | **float** | | +**total_number_redeemed** | **float** | | +**total_value_redeemed** | **float** | | +**total_budget_remaining** | **float** | | **maximum_budget_exhausted** | **bool** | | -**maximum_budget_exhausted_by** | **double** | | +**maximum_budget_exhausted_by** | **float** | | **maximum_budget_exhausted_by_decimal** | **string** | | **maximum_budget_exhausted_by_string** | **string** | | -**maximum_budget_exhausted_total_value_redeemed** | **double** | | +**maximum_budget_exhausted_total_value_redeemed** | **float** | | **maximum_budget_exhausted_total_value_redeemed_decimal** | **string** | | **maximum_budget_exhausted_total_value_redeemed_string** | **string** | | -**total_amount_subtracted** | **double** | | +**total_amount_subtracted** | **float** | | **total_amount_subtracted_decimal** | **string** | | **total_amount_subtracted_string** | **string** | | -**total_decremented_multiple** | **double** | | +**total_decremented_multiple** | **float** | | **redeemed_keys** | **string[]** | | -**status** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**status** | [**\OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus**](WTDynamicVoucherSummaryStatus.md) | | **expired** | **bool** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTDynamicVoucherSummaryStatus.md b/docs/Model/WTDynamicVoucherSummaryStatus.md new file mode 100644 index 0000000..8b048a8 --- /dev/null +++ b/docs/Model/WTDynamicVoucherSummaryStatus.md @@ -0,0 +1,8 @@ +# # WTDynamicVoucherSummaryStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTDynamicVoucherUpdateParams.md b/docs/Model/WTDynamicVoucherUpdateParams.md index c128088..134d88d 100644 --- a/docs/Model/WTDynamicVoucherUpdateParams.md +++ b/docs/Model/WTDynamicVoucherUpdateParams.md @@ -13,8 +13,8 @@ Name | Type | Description | Notes **max_budget** | **int** | | **decrease_amount** | **int** | | **frequency** | **int** | | -**frequency_type** | [**AnyOfStringStringStringStringString**](AnyOfStringStringStringStringString.md) | | -**decrease_by** | **double** | | [optional] -**decrease_every** | **double** | | [optional] +**frequency_type** | [**\OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType**](DynamicVoucherTemporalDecreaseFrequencyType.md) | | +**decrease_by** | **float** | | [optional] +**decrease_every** | **float** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTEmployee.md b/docs/Model/WTEmployee.md index ccbd81b..930debb 100644 --- a/docs/Model/WTEmployee.md +++ b/docs/Model/WTEmployee.md @@ -13,14 +13,14 @@ Name | Type | Description | Notes **employee_id** | **string** | | **job_title** | **string** | | **department** | **string** | | -**schedule_start_day** | [**AnyOfStringStringStringStringStringStringString**](AnyOfStringStringStringStringStringStringString.md) | | [optional] -**schedule_start_hour** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_start_minute** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_start_meridiem** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] -**schedule_end_day** | [**AnyOfStringStringStringStringStringStringString**](AnyOfStringStringStringStringStringStringString.md) | | [optional] -**schedule_end_hour** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_end_minute** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_end_meridiem** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] +**schedule_start_day** | [**\OpenAPI\Client\Model\EmployeeScheduleStartDay**](EmployeeScheduleStartDay.md) | | [optional] +**schedule_start_hour** | [**\OpenAPI\Client\Model\EmployeeScheduleStartHour**](EmployeeScheduleStartHour.md) | | [optional] +**schedule_start_minute** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMinute**](EmployeeScheduleStartMinute.md) | | [optional] +**schedule_start_meridiem** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem**](EmployeeScheduleStartMeridiem.md) | | [optional] +**schedule_end_day** | [**\OpenAPI\Client\Model\EmployeeScheduleStartDay**](EmployeeScheduleStartDay.md) | | [optional] +**schedule_end_hour** | [**\OpenAPI\Client\Model\EmployeeScheduleStartHour**](EmployeeScheduleStartHour.md) | | [optional] +**schedule_end_minute** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMinute**](EmployeeScheduleStartMinute.md) | | [optional] +**schedule_end_meridiem** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem**](EmployeeScheduleStartMeridiem.md) | | [optional] **id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | @@ -29,7 +29,7 @@ Name | Type | Description | Notes **profile_picture_url** | **string** | | **merchant_id** | **string** | | **session_token** | **string** | | -**failed_login_attempts** | **double** | | [optional] +**failed_login_attempts** | **float** | | [optional] **last_login_date** | **\DateTime** | | [optional] **cfuvid** | **string** | | [optional] **schedule** | **object** | | [optional] diff --git a/docs/Model/WTEmployeeAPIKey.md b/docs/Model/WTEmployeeAPIKey.md index 1093cbe..d74b4fd 100644 --- a/docs/Model/WTEmployeeAPIKey.md +++ b/docs/Model/WTEmployeeAPIKey.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **title** | **string** | | **description** | **string** | | **employee_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/WTEmployeeCreate.md b/docs/Model/WTEmployeeCreate.md index 430afc6..7d23c64 100644 --- a/docs/Model/WTEmployeeCreate.md +++ b/docs/Model/WTEmployeeCreate.md @@ -13,13 +13,13 @@ Name | Type | Description | Notes **employee_id** | **string** | | **job_title** | **string** | | **department** | **string** | | -**schedule_start_day** | [**AnyOfStringStringStringStringStringStringString**](AnyOfStringStringStringStringStringStringString.md) | | [optional] -**schedule_start_hour** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_start_minute** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_start_meridiem** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] -**schedule_end_day** | [**AnyOfStringStringStringStringStringStringString**](AnyOfStringStringStringStringStringStringString.md) | | [optional] -**schedule_end_hour** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_end_minute** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_end_meridiem** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] +**schedule_start_day** | [**\OpenAPI\Client\Model\EmployeeScheduleStartDay**](EmployeeScheduleStartDay.md) | | [optional] +**schedule_start_hour** | [**\OpenAPI\Client\Model\EmployeeScheduleStartHour**](EmployeeScheduleStartHour.md) | | [optional] +**schedule_start_minute** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMinute**](EmployeeScheduleStartMinute.md) | | [optional] +**schedule_start_meridiem** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem**](EmployeeScheduleStartMeridiem.md) | | [optional] +**schedule_end_day** | [**\OpenAPI\Client\Model\EmployeeScheduleStartDay**](EmployeeScheduleStartDay.md) | | [optional] +**schedule_end_hour** | [**\OpenAPI\Client\Model\EmployeeScheduleStartHour**](EmployeeScheduleStartHour.md) | | [optional] +**schedule_end_minute** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMinute**](EmployeeScheduleStartMinute.md) | | [optional] +**schedule_end_meridiem** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem**](EmployeeScheduleStartMeridiem.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTEmployeeNotification.md b/docs/Model/WTEmployeeNotification.md index 94f3d7b..1311967 100644 --- a/docs/Model/WTEmployeeNotification.md +++ b/docs/Model/WTEmployeeNotification.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**type** | [**\OpenAPI\Client\Model\WTEmployeeNotificationType**](WTEmployeeNotificationType.md) | | **title** | **string** | | **content** | **string** | | **payload** | **mixed** | | [optional] diff --git a/docs/Model/WTEmployeeNotificationType.md b/docs/Model/WTEmployeeNotificationType.md new file mode 100644 index 0000000..5f09936 --- /dev/null +++ b/docs/Model/WTEmployeeNotificationType.md @@ -0,0 +1,8 @@ +# # WTEmployeeNotificationType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTEmployeeS3FilePresign.md b/docs/Model/WTEmployeeS3FilePresign.md index 179fe03..70b3655 100644 --- a/docs/Model/WTEmployeeS3FilePresign.md +++ b/docs/Model/WTEmployeeS3FilePresign.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **file_name** | **string** | | **file_type** | **string** | | -**context** | [**AnyOfStringStringStringStringString**](AnyOfStringStringStringStringString.md) | | +**context** | [**\OpenAPI\Client\Model\WTEmployeeS3FilePresignContext**](WTEmployeeS3FilePresignContext.md) | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTEmployeeS3FilePresignContext.md b/docs/Model/WTEmployeeS3FilePresignContext.md new file mode 100644 index 0000000..8c26ead --- /dev/null +++ b/docs/Model/WTEmployeeS3FilePresignContext.md @@ -0,0 +1,8 @@ +# # WTEmployeeS3FilePresignContext + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTEmployeeScheduleSimpleSMS.md b/docs/Model/WTEmployeeScheduleSimpleSMS.md index 8af7708..afaef8c 100644 --- a/docs/Model/WTEmployeeScheduleSimpleSMS.md +++ b/docs/Model/WTEmployeeScheduleSimpleSMS.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **message_template** | **string** | | **media_urls** | **string[]** | | [optional] **broadcast_scheduled_at** | **\DateTime** | | -**list_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**list_type** | [**\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSListType**](WTEmployeeScheduleSimpleSMSListType.md) | | **list_id** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTEmployeeScheduleSimpleSMSListType.md b/docs/Model/WTEmployeeScheduleSimpleSMSListType.md new file mode 100644 index 0000000..ed0f3b7 --- /dev/null +++ b/docs/Model/WTEmployeeScheduleSimpleSMSListType.md @@ -0,0 +1,8 @@ +# # WTEmployeeScheduleSimpleSMSListType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTEmployeeUpdate.md b/docs/Model/WTEmployeeUpdate.md index 9ede2c7..dd195ca 100644 --- a/docs/Model/WTEmployeeUpdate.md +++ b/docs/Model/WTEmployeeUpdate.md @@ -12,13 +12,13 @@ Name | Type | Description | Notes **wallet_sequence_number** | **int** | | **job_title** | **string** | | **department** | **string** | | -**schedule_start_day** | [**AnyOfStringStringStringStringStringStringString**](AnyOfStringStringStringStringStringStringString.md) | | [optional] -**schedule_start_hour** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_start_minute** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_start_meridiem** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] -**schedule_end_day** | [**AnyOfStringStringStringStringStringStringString**](AnyOfStringStringStringStringStringStringString.md) | | [optional] -**schedule_end_hour** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_end_minute** | [**AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber**](AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber.md) | | [optional] -**schedule_end_meridiem** | [**AnyOfStringString**](AnyOfStringString.md) | | [optional] +**schedule_start_day** | [**\OpenAPI\Client\Model\EmployeeScheduleStartDay**](EmployeeScheduleStartDay.md) | | [optional] +**schedule_start_hour** | [**\OpenAPI\Client\Model\EmployeeScheduleStartHour**](EmployeeScheduleStartHour.md) | | [optional] +**schedule_start_minute** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMinute**](EmployeeScheduleStartMinute.md) | | [optional] +**schedule_start_meridiem** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem**](EmployeeScheduleStartMeridiem.md) | | [optional] +**schedule_end_day** | [**\OpenAPI\Client\Model\EmployeeScheduleStartDay**](EmployeeScheduleStartDay.md) | | [optional] +**schedule_end_hour** | [**\OpenAPI\Client\Model\EmployeeScheduleStartHour**](EmployeeScheduleStartHour.md) | | [optional] +**schedule_end_minute** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMinute**](EmployeeScheduleStartMinute.md) | | [optional] +**schedule_end_meridiem** | [**\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem**](EmployeeScheduleStartMeridiem.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTImportedList.md b/docs/Model/WTImportedList.md index 1f0bd06..a361fd8 100644 --- a/docs/Model/WTImportedList.md +++ b/docs/Model/WTImportedList.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **is_active** | **bool** | | **list_name** | **string** | | **phone_number_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/WTImportedListRecipientFromMembershipTierImport.md b/docs/Model/WTImportedListRecipientFromMembershipTierImport.md index 61f4f4b..4cead3a 100644 --- a/docs/Model/WTImportedListRecipientFromMembershipTierImport.md +++ b/docs/Model/WTImportedListRecipientFromMembershipTierImport.md @@ -6,6 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **list_name** | **string** | | **phone_number_id** | **string** | | -**tier_id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**tier_id** | [**\OpenAPI\Client\Model\WTImportedListRecipientFromMembershipTierImportTierID**](WTImportedListRecipientFromMembershipTierImportTierID.md) | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTImportedListRecipientFromMembershipTierImportTierID.md b/docs/Model/WTImportedListRecipientFromMembershipTierImportTierID.md new file mode 100644 index 0000000..e431a2e --- /dev/null +++ b/docs/Model/WTImportedListRecipientFromMembershipTierImportTierID.md @@ -0,0 +1,8 @@ +# # WTImportedListRecipientFromMembershipTierImportTierID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTLinkBook.md b/docs/Model/WTLinkBook.md index acc8d1f..c4b69f3 100644 --- a/docs/Model/WTLinkBook.md +++ b/docs/Model/WTLinkBook.md @@ -8,8 +8,8 @@ Name | Type | Description | Notes **url** | **string** | | **icon** | **string** | | **order_number** | **int** | | -**link_book_section_id** | [**AnyOfStringNumber**](AnyOfStringNumber.md) | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**link_book_section_id** | [**\OpenAPI\Client\Model\WTLinkBookLinkBookSectionID**](WTLinkBookLinkBookSectionID.md) | | [optional] +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/WTLinkBookCreateParams.md b/docs/Model/WTLinkBookCreateParams.md index c8f57a8..05c67a8 100644 --- a/docs/Model/WTLinkBookCreateParams.md +++ b/docs/Model/WTLinkBookCreateParams.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **url** | **string** | | **icon** | **string** | | **order_number** | **int** | | -**link_book_section_id** | [**AnyOfStringNumber**](AnyOfStringNumber.md) | | [optional] +**link_book_section_id** | [**\OpenAPI\Client\Model\WTLinkBookLinkBookSectionID**](WTLinkBookLinkBookSectionID.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTLinkBookLinkBookSectionID.md b/docs/Model/WTLinkBookLinkBookSectionID.md new file mode 100644 index 0000000..9b2e94d --- /dev/null +++ b/docs/Model/WTLinkBookLinkBookSectionID.md @@ -0,0 +1,8 @@ +# # WTLinkBookLinkBookSectionID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTLinkBookUpdateParams.md b/docs/Model/WTLinkBookUpdateParams.md index b880588..dd52dff 100644 --- a/docs/Model/WTLinkBookUpdateParams.md +++ b/docs/Model/WTLinkBookUpdateParams.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **url** | **string** | | **icon** | **string** | | **order_number** | **int** | | -**link_book_section_id** | [**AnyOfStringNumber**](AnyOfStringNumber.md) | | [optional] +**link_book_section_id** | [**\OpenAPI\Client\Model\WTLinkBookLinkBookSectionID**](WTLinkBookLinkBookSectionID.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTLocalInstance.md b/docs/Model/WTLocalInstance.md index 1b78125..a2d3a14 100644 --- a/docs/Model/WTLocalInstance.md +++ b/docs/Model/WTLocalInstance.md @@ -10,8 +10,8 @@ Name | Type | Description | Notes **iso_country** | **string** | | **postal_code** | **string** | | **region** | **string** | | -**longitude** | **double** | | -**latitude** | **double** | | +**longitude** | **float** | | +**latitude** | **float** | | **rate_center** | **string** | | **locality** | **string** | | **lata** | **string** | | diff --git a/docs/Model/WTMember.md b/docs/Model/WTMember.md index 883b722..f263cc1 100644 --- a/docs/Model/WTMember.md +++ b/docs/Model/WTMember.md @@ -13,6 +13,8 @@ Name | Type | Description | Notes **last_name** | **string** | An optional last name of the member | [optional] **membership_tier_id** | **string** | | **mobile_number** | **string** | | +**email** | **string** | | +**birthday** | **string** | Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured | **points_accrued** | **int** | The number of points that the member has accrued | **member_id** | **string** | Member ID as represented by the merchant | **membership_tier_redeemable_id** | **string** | | diff --git a/docs/Model/WTMemberCreationParams.md b/docs/Model/WTMemberCreationParams.md index ffa3f4a..3a783ca 100644 --- a/docs/Model/WTMemberCreationParams.md +++ b/docs/Model/WTMemberCreationParams.md @@ -8,6 +8,8 @@ Name | Type | Description | Notes **last_name** | **string** | An optional last name of the member | [optional] **membership_tier_id** | **string** | | **mobile_number** | **string** | | +**email** | **string** | | +**birthday** | **string** | Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured | **points_accrued** | **int** | The number of points that the member has accrued | **member_id** | **string** | Member ID as represented by the merchant | diff --git a/docs/Model/WTMembershipTier.md b/docs/Model/WTMembershipTier.md index 6e60340..5837c5a 100644 --- a/docs/Model/WTMembershipTier.md +++ b/docs/Model/WTMembershipTier.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **tier_discount** | **float** | The provided discount as percentage | **tier_design_id** | **string** | | **points_design_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | The id of the membership tier - autopopulated by the service | +**id** | [**\OpenAPI\Client\Model\WTMembershipTierId**](WTMembershipTierId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | The timestamp of when this resource was created | **updated_at** | **\DateTime** | The timestamp of when this resource was updated | diff --git a/docs/Model/WTMembershipTierId.md b/docs/Model/WTMembershipTierId.md new file mode 100644 index 0000000..41acc46 --- /dev/null +++ b/docs/Model/WTMembershipTierId.md @@ -0,0 +1,8 @@ +# # WTMembershipTierId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTMembershipTierWithMemberCount.md b/docs/Model/WTMembershipTierWithMemberCount.md index c670900..3f759bf 100644 --- a/docs/Model/WTMembershipTierWithMemberCount.md +++ b/docs/Model/WTMembershipTierWithMemberCount.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **tier_discount** | **float** | The provided discount as percentage | **tier_design_id** | **string** | | **points_design_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | The id of the membership tier - autopopulated by the service | +**id** | [**\OpenAPI\Client\Model\WTMembershipTierId**](WTMembershipTierId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | The timestamp of when this resource was created | **updated_at** | **\DateTime** | The timestamp of when this resource was updated | diff --git a/docs/Model/WTMessageInstance.md b/docs/Model/WTMessageInstance.md index fc0f468..e4528f5 100644 --- a/docs/Model/WTMessageInstance.md +++ b/docs/Model/WTMessageInstance.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **subresource_uris** | **object** | Construct a type with a set of properties K of type T | **api_version** | **string** | | **price_unit** | **string** | | -**error_code** | **double** | | +**error_code** | **float** | | **date_created** | **\DateTime** | | **date_sent** | **\DateTime** | | **sid** | **string** | | diff --git a/docs/Model/WTOptInList.md b/docs/Model/WTOptInList.md index 588eb05..037be1c 100644 --- a/docs/Model/WTOptInList.md +++ b/docs/Model/WTOptInList.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **opt_in_confirmed_media_urls** | **string[]** | | **opt_out_confirmed_media_urls** | **string[]** | | **is_over21_required** | **bool** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/WTPaymentDesign.md b/docs/Model/WTPaymentDesign.md index 7ba89ac..fbe1c29 100644 --- a/docs/Model/WTPaymentDesign.md +++ b/docs/Model/WTPaymentDesign.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **border_color** | **string** | | -**border_style_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**border_style_type** | [**\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType**](PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.md) | | **border_size** | **string** | | **border_radius** | **int** | | **font_color** | **string** | | @@ -18,7 +18,7 @@ Name | Type | Description | Notes **background_image_url** | **string** | | [optional] **company_logo_url** | **string** | | [optional] **employee_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **merchant_id** | **string** | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | diff --git a/docs/Model/WTPaymentDesignCreateParams.md b/docs/Model/WTPaymentDesignCreateParams.md index 978f1a7..a45c580 100644 --- a/docs/Model/WTPaymentDesignCreateParams.md +++ b/docs/Model/WTPaymentDesignCreateParams.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **border_color** | **string** | | -**border_style_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**border_style_type** | [**\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType**](PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.md) | | **border_size** | **string** | | **border_radius** | **int** | | **font_color** | **string** | | diff --git a/docs/Model/WTPaymentDesignUpdateParams.md b/docs/Model/WTPaymentDesignUpdateParams.md index 7816531..0cea719 100644 --- a/docs/Model/WTPaymentDesignUpdateParams.md +++ b/docs/Model/WTPaymentDesignUpdateParams.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **border_color** | **string** | | -**border_style_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | | +**border_style_type** | [**\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType**](PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.md) | | **border_size** | **string** | | **border_radius** | **int** | | **font_color** | **string** | | diff --git a/docs/Model/WTPerformanceCreateParams.md b/docs/Model/WTPerformanceCreateParams.md index d7b8f66..07f76d4 100644 --- a/docs/Model/WTPerformanceCreateParams.md +++ b/docs/Model/WTPerformanceCreateParams.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **is_sold_out** | **bool** | Denotes if the event has been sold out | **media_url** | **string** | | [optional] **payment_design_id** | **string** | | [optional] -**max_comp_tickets** | **double** | | [optional] +**max_comp_tickets** | **float** | | [optional] **ticket_expiration_date_time** | **\DateTime** | | [optional] **redemption_instructions** | **string** | | [optional] diff --git a/docs/Model/WTPerformanceUpdateParams.md b/docs/Model/WTPerformanceUpdateParams.md index 3e8f678..f19f96f 100644 --- a/docs/Model/WTPerformanceUpdateParams.md +++ b/docs/Model/WTPerformanceUpdateParams.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **is_sold_out** | **bool** | Denotes if the event has been sold out | **media_url** | **string** | | [optional] **payment_design_id** | **string** | | [optional] -**max_comp_tickets** | **double** | | [optional] +**max_comp_tickets** | **float** | | [optional] **ticket_expiration_date_time** | **\DateTime** | | [optional] **redemption_instructions** | **string** | | [optional] diff --git a/docs/Model/WTQRCodeDesign.md b/docs/Model/WTQRCodeDesign.md index 5503ed7..dd3175b 100644 --- a/docs/Model/WTQRCodeDesign.md +++ b/docs/Model/WTQRCodeDesign.md @@ -7,14 +7,15 @@ Name | Type | Description | Notes **name** | **string** | | **size** | **int** | | **margin** | **int** | | +**is_margin_white** | **bool** | | **corner_radius** | **int** | | **color_dark_hex** | **string** | | **color_light_hex** | **string** | | **background_dimming_hex** | **string** | | -**logo_image_url** | **string** | | -**background_image_url** | **string** | | -**animated_gif_background_url** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**logo_image_url** | **string** | | [optional] +**background_image_url** | **string** | | [optional] +**animated_gif_background_url** | **string** | | [optional] +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/WTQRCodeDesignCreateParams.md b/docs/Model/WTQRCodeDesignCreateParams.md index 6dabc34..f767fb0 100644 --- a/docs/Model/WTQRCodeDesignCreateParams.md +++ b/docs/Model/WTQRCodeDesignCreateParams.md @@ -7,12 +7,13 @@ Name | Type | Description | Notes **name** | **string** | | **size** | **int** | | **margin** | **int** | | +**is_margin_white** | **bool** | | **corner_radius** | **int** | | **color_dark_hex** | **string** | | **color_light_hex** | **string** | | **background_dimming_hex** | **string** | | -**logo_image_url** | **string** | | -**background_image_url** | **string** | | -**animated_gif_background_url** | **string** | | +**logo_image_url** | **string** | | [optional] +**background_image_url** | **string** | | [optional] +**animated_gif_background_url** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTQRCodeDesignUpdateParams.md b/docs/Model/WTQRCodeDesignUpdateParams.md index 0889990..b08e10f 100644 --- a/docs/Model/WTQRCodeDesignUpdateParams.md +++ b/docs/Model/WTQRCodeDesignUpdateParams.md @@ -7,12 +7,13 @@ Name | Type | Description | Notes **name** | **string** | | **size** | **int** | | **margin** | **int** | | +**is_margin_white** | **bool** | | **corner_radius** | **int** | | **color_dark_hex** | **string** | | **color_light_hex** | **string** | | **background_dimming_hex** | **string** | | -**logo_image_url** | **string** | | -**background_image_url** | **string** | | -**animated_gif_background_url** | **string** | | +**logo_image_url** | **string** | | [optional] +**background_image_url** | **string** | | [optional] +**animated_gif_background_url** | **string** | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTRole.md b/docs/Model/WTRole.md index 29b15a3..c068200 100644 --- a/docs/Model/WTRole.md +++ b/docs/Model/WTRole.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **name** | **string** | | **display_name** | **string** | | **is_public** | **bool** | | -**order_number** | **double** | | +**order_number** | **float** | | **is_system** | **bool** | | **icons** | **string[]** | | **category** | **string** | | diff --git a/docs/Model/WTSmsSubscriberCreateParams.md b/docs/Model/WTSmsSubscriberCreateParams.md new file mode 100644 index 0000000..b0661f8 --- /dev/null +++ b/docs/Model/WTSmsSubscriberCreateParams.md @@ -0,0 +1,9 @@ +# # WTSmsSubscriberCreateParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mobile_number** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTSmsSubscriberCreateParamsWalletUI.md b/docs/Model/WTSmsSubscriberCreateParamsWalletUI.md new file mode 100644 index 0000000..5f611e6 --- /dev/null +++ b/docs/Model/WTSmsSubscriberCreateParamsWalletUI.md @@ -0,0 +1,10 @@ +# # WTSmsSubscriberCreateParamsWalletUI + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mobile_number** | **string** | | +**merchant_id** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTSmsSubscriberUpdateParams.md b/docs/Model/WTSmsSubscriberUpdateParams.md new file mode 100644 index 0000000..88b5de3 --- /dev/null +++ b/docs/Model/WTSmsSubscriberUpdateParams.md @@ -0,0 +1,9 @@ +# # WTSmsSubscriberUpdateParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mobile_number** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTStaticVoucher.md b/docs/Model/WTStaticVoucher.md index ecd7ca0..e8d3daa 100644 --- a/docs/Model/WTStaticVoucher.md +++ b/docs/Model/WTStaticVoucher.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **campaign_id** | **string** | | **member_id** | **string** | | [optional] **cell_phone_number** | **string** | | [optional] **offer_amount_cents** | **int** | | **order_number** | **int** | | -**transaction_type** | [**AnyOfStringStringString**](AnyOfStringStringString.md) | The type of the transaction - only redemption at the moment | -**register_id** | [**AnyOfStringDouble**](AnyOfStringDouble.md) | The ID of the register where the transaction occurred | +**transaction_type** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.md) | | +**register_id** | [**\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID**](PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.md) | | **redeemed_source** | **string** | | **redeemed_transaction_id** | **string** | | **redeemed_amount** | **int** | | diff --git a/docs/Model/WTStaticVoucherCampaign.md b/docs/Model/WTStaticVoucherCampaign.md index 6015ecd..e09f2a0 100644 --- a/docs/Model/WTStaticVoucherCampaign.md +++ b/docs/Model/WTStaticVoucherCampaign.md @@ -4,10 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **title** | **string** | | **notes** | **string** | | -**value_type** | [**AnyOfStringString**](AnyOfStringString.md) | | +**value_type** | [**\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType**](PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.md) | | **is_loaded** | **bool** | | **display_value** | **string** | | [optional] **merchants_reference_id** | **string** | | [optional] @@ -24,7 +24,7 @@ Name | Type | Description | Notes **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | -**voucher_type** | **double** | | +**voucher_type** | **float** | | **reinvestment_sum_decimal** | **string** | | **reinvestment_sum_string** | **string** | | **start_date** | **\DateTime** | | diff --git a/docs/Model/WTStaticVoucherCampaignPreviewMessagesByPage.md b/docs/Model/WTStaticVoucherCampaignPreviewMessagesByPage.md index 05eea0b..8fc14d9 100644 --- a/docs/Model/WTStaticVoucherCampaignPreviewMessagesByPage.md +++ b/docs/Model/WTStaticVoucherCampaignPreviewMessagesByPage.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **message** | **string** | | **locale** | **string** | | **timezone** | **string** | | -**page_num** | **double** | | -**page_size** | **double** | | +**page_num** | **float** | | +**page_size** | **float** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTStaticVoucherCreateParams.md b/docs/Model/WTStaticVoucherCreateParams.md index 3ef104f..1a80570 100644 --- a/docs/Model/WTStaticVoucherCreateParams.md +++ b/docs/Model/WTStaticVoucherCreateParams.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes **offer_amount_cents** | **int** | | **member_id** | **string** | | [optional] **cell_phone** | **string** | | -**campaign_id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**campaign_id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTTCPAOpt.md b/docs/Model/WTTCPAOpt.md index 055134c..005346e 100644 --- a/docs/Model/WTTCPAOpt.md +++ b/docs/Model/WTTCPAOpt.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**list_id** | [**AnyOfStringString**](AnyOfStringString.md) | | -**source_id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**list_id** | [**\OpenAPI\Client\Model\WTTCPAOptListID**](WTTCPAOptListID.md) | | +**source_id** | [**\OpenAPI\Client\Model\WTTCPAOptSourceID**](WTTCPAOptSourceID.md) | | **phone_number** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTTCPAOptListID.md b/docs/Model/WTTCPAOptListID.md new file mode 100644 index 0000000..018c0bf --- /dev/null +++ b/docs/Model/WTTCPAOptListID.md @@ -0,0 +1,8 @@ +# # WTTCPAOptListID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTTCPAOptSourceID.md b/docs/Model/WTTCPAOptSourceID.md new file mode 100644 index 0000000..3bf88c3 --- /dev/null +++ b/docs/Model/WTTCPAOptSourceID.md @@ -0,0 +1,8 @@ +# # WTTCPAOptSourceID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTTicket.md b/docs/Model/WTTicket.md index e27ac63..e2e3520 100644 --- a/docs/Model/WTTicket.md +++ b/docs/Model/WTTicket.md @@ -8,9 +8,9 @@ Name | Type | Description | Notes **recipient_email_address** | **string** | | [optional] **recipient_member_id** | **string** | | [optional] **is_comp** | **bool** | | [optional] -**quantity** | **double** | The number of tickets allocated to the recipient. | [optional] +**quantity** | **float** | The number of tickets allocated to the recipient. | [optional] **performance_id** | **string** | | -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID**](SaveTicketSettingsRequestPaymentDesignID.md) | | **created_at** | **\DateTime** | | **updated_at** | **\DateTime** | | **is_active** | **bool** | | diff --git a/docs/Model/WTTicketCreateParams.md b/docs/Model/WTTicketCreateParams.md index d8e02bf..874dcc7 100644 --- a/docs/Model/WTTicketCreateParams.md +++ b/docs/Model/WTTicketCreateParams.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **recipient_email_address** | **string** | | [optional] **recipient_member_id** | **string** | | [optional] **is_comp** | **bool** | | [optional] -**quantity** | **double** | The number of tickets allocated to the recipient. | [optional] +**quantity** | **float** | The number of tickets allocated to the recipient. | [optional] **performance_id** | **string** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTTicketUpdateParams.md b/docs/Model/WTTicketUpdateParams.md index 4b4380e..eeb4add 100644 --- a/docs/Model/WTTicketUpdateParams.md +++ b/docs/Model/WTTicketUpdateParams.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **recipient_email_address** | **string** | | [optional] **recipient_member_id** | **string** | | [optional] **is_comp** | **bool** | | [optional] -**quantity** | **double** | The number of tickets allocated to the recipient. | [optional] +**quantity** | **float** | The number of tickets allocated to the recipient. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTWalletConfigurationSaveWalletRecord.md b/docs/Model/WTWalletConfigurationSaveWalletRecord.md index 0650470..bf5936d 100644 --- a/docs/Model/WTWalletConfigurationSaveWalletRecord.md +++ b/docs/Model/WTWalletConfigurationSaveWalletRecord.md @@ -49,11 +49,11 @@ Name | Type | Description | Notes **is_settings** | **bool** | | **is_chat_room** | **bool** | | **is_sms_opt_in** | **bool** | | -**sms_opt_in_source_id** | **string** | | [optional] +**sms_opt_in_source_id** | [**\OpenAPI\Client\Model\WalletConfigurationSmsOptInSourceID**](WalletConfigurationSmsOptInSourceID.md) | | [optional] **is_email_subscriber** | **bool** | | **google_analytics_id** | **string** | | [optional] **facebook_pixel_id** | **string** | | [optional] -**public_chat_room_channel_id** | **double** | | [optional] +**public_chat_room_channel_id** | **float** | | [optional] **vanity_handle** | **string** | | [optional] **vanity_page_wallet_prefix** | **string** | | [optional] **merchant_credit_payment_design_id** | **string** | | [optional] @@ -61,7 +61,7 @@ Name | Type | Description | Notes **is_claimed** | **bool** | | [optional] **mobile_app_icon_url** | **string** | | [optional] **is_age_gate** | **bool** | | [optional] -**age_gate_minimum** | **double** | | [optional] +**age_gate_minimum** | **float** | | [optional] **social_instagram_url** | **string** | | [optional] **social_facebook_url** | **string** | | [optional] **social_you_tube_url** | **string** | | [optional] diff --git a/docs/Model/WTWalletItemRedemption.md b/docs/Model/WTWalletItemRedemption.md index 67bc353..092b4f6 100644 --- a/docs/Model/WTWalletItemRedemption.md +++ b/docs/Model/WTWalletItemRedemption.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**check_amount** | **double** | | +**check_amount** | **float** | | **transaction_number** | **string** | | **meta_value** | **string** | | [optional] diff --git a/docs/Model/WTWalletPageView.md b/docs/Model/WTWalletPageView.md index 9c62d39..77844c5 100644 --- a/docs/Model/WTWalletPageView.md +++ b/docs/Model/WTWalletPageView.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **phone_verification_token** | **string** | | **referring_domain** | **string** | | [optional] **referrer** | **string** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **status** | **string** | | **country** | **string** | | **country_code** | **string** | | @@ -32,8 +32,8 @@ Name | Type | Description | Notes **region_name** | **string** | | **city** | **string** | | **zip** | **string** | | -**latitude** | **double** | | -**longitude** | **double** | | +**latitude** | **float** | | +**longitude** | **float** | | **timezone** | **string** | | **isp** | **string** | | **org** | **string** | | diff --git a/docs/Model/WTWalletPageViewCount.md b/docs/Model/WTWalletPageViewCount.md index 4f0367a..6bbb185 100644 --- a/docs/Model/WTWalletPageViewCount.md +++ b/docs/Model/WTWalletPageViewCount.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **wallet_object_id** | **string** | | -**count** | **double** | | +**count** | **float** | | **date_occurred** | **\DateTime** | | **wallet_object_name** | **string** | | diff --git a/docs/Model/WTWalletPageViewGeoPoint.md b/docs/Model/WTWalletPageViewGeoPoint.md index 6dd5530..dfccfa2 100644 --- a/docs/Model/WTWalletPageViewGeoPoint.md +++ b/docs/Model/WTWalletPageViewGeoPoint.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**longitude** | **double** | | -**latitude** | **double** | | +**longitude** | **float** | | +**latitude** | **float** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WTWalletPageViewId.md b/docs/Model/WTWalletPageViewId.md new file mode 100644 index 0000000..e8404a9 --- /dev/null +++ b/docs/Model/WTWalletPageViewId.md @@ -0,0 +1,8 @@ +# # WTWalletPageViewId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WalletConfiguration.md b/docs/Model/WalletConfiguration.md index 9f749ca..5cc0e0e 100644 --- a/docs/Model/WalletConfiguration.md +++ b/docs/Model/WalletConfiguration.md @@ -49,11 +49,11 @@ Name | Type | Description | Notes **is_settings** | **bool** | | **is_chat_room** | **bool** | | **is_sms_opt_in** | **bool** | | -**sms_opt_in_source_id** | **string** | | [optional] +**sms_opt_in_source_id** | [**\OpenAPI\Client\Model\WalletConfigurationSmsOptInSourceID**](WalletConfigurationSmsOptInSourceID.md) | | [optional] **is_email_subscriber** | **bool** | | **google_analytics_id** | **string** | | [optional] **facebook_pixel_id** | **string** | | [optional] -**public_chat_room_channel_id** | **double** | | [optional] +**public_chat_room_channel_id** | **float** | | [optional] **vanity_handle** | **string** | | [optional] **vanity_page_wallet_prefix** | **string** | | [optional] **merchant_credit_payment_design_id** | **string** | | [optional] @@ -61,7 +61,7 @@ Name | Type | Description | Notes **is_claimed** | **bool** | | [optional] **mobile_app_icon_url** | **string** | | [optional] **is_age_gate** | **bool** | | [optional] -**age_gate_minimum** | **double** | | [optional] +**age_gate_minimum** | **float** | | [optional] **social_instagram_url** | **string** | | [optional] **social_facebook_url** | **string** | | [optional] **social_you_tube_url** | **string** | | [optional] diff --git a/docs/Model/WalletConfigurationSmsOptInSourceID.md b/docs/Model/WalletConfigurationSmsOptInSourceID.md new file mode 100644 index 0000000..e4a9c54 --- /dev/null +++ b/docs/Model/WalletConfigurationSmsOptInSourceID.md @@ -0,0 +1,8 @@ +# # WalletConfigurationSmsOptInSourceID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/WalletPageView.md b/docs/Model/WalletPageView.md index 23c2036..9a39a68 100644 --- a/docs/Model/WalletPageView.md +++ b/docs/Model/WalletPageView.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **phone_verification_token** | **string** | | **referring_domain** | **string** | | [optional] **referrer** | **string** | | [optional] -**id** | [**AnyOfStringString**](AnyOfStringString.md) | | +**id** | [**\OpenAPI\Client\Model\WTWalletPageViewId**](WTWalletPageViewId.md) | | **status** | **string** | | **country** | **string** | | **country_code** | **string** | | @@ -32,8 +32,8 @@ Name | Type | Description | Notes **region_name** | **string** | | **city** | **string** | | **zip** | **string** | | -**latitude** | **double** | | -**longitude** | **double** | | +**latitude** | **float** | | +**longitude** | **float** | | **timezone** | **string** | | **isp** | **string** | | **org** | **string** | | diff --git a/docs/Model/Webpage.md b/docs/Model/Webpage.md index fc02841..788bd7a 100644 --- a/docs/Model/Webpage.md +++ b/docs/Model/Webpage.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **display_name** | **string** | | **system_name** | **string** | | **is_public** | **bool** | | -**order_number** | **double** | | +**order_number** | **float** | | **icons** | **string[]** | | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/A2PApi.php b/lib/Api/A2PApi.php index 9675ae8..c0e6b12 100644 --- a/lib/Api/A2PApi.php +++ b/lib/Api/A2PApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'fetchA2PApplication' => [ + 'application/json', + ], + 'fetchA2PRegistration' => [ + 'application/json', + ], + 'updateA2PApplication' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +138,15 @@ public function getConfig() * Create A2P Application * * @param \OpenAPI\Client\Model\A2PApplicationSubmission $a2_p_application_submission a2_p_application_submission (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['beginA2PApplication'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function beginA2PApplication($a2_p_application_submission) + public function beginA2PApplication($a2_p_application_submission, string $contentType = self::contentTypes['beginA2PApplication'][0]) { - list($response) = $this->beginA2PApplicationWithHttpInfo($a2_p_application_submission); + list($response) = $this->beginA2PApplicationWithHttpInfo($a2_p_application_submission, $contentType); return $response; } @@ -139,14 +156,15 @@ public function beginA2PApplication($a2_p_application_submission) * Create A2P Application * * @param \OpenAPI\Client\Model\A2PApplicationSubmission $a2_p_application_submission (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['beginA2PApplication'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function beginA2PApplicationWithHttpInfo($a2_p_application_submission) + public function beginA2PApplicationWithHttpInfo($a2_p_application_submission, string $contentType = self::contentTypes['beginA2PApplication'][0]) { - $request = $this->beginA2PApplicationRequest($a2_p_application_submission); + $request = $this->beginA2PApplicationRequest($a2_p_application_submission, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +207,21 @@ public function beginA2PApplicationWithHttpInfo($a2_p_application_submission) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +234,21 @@ public function beginA2PApplicationWithHttpInfo($a2_p_application_submission) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +261,21 @@ public function beginA2PApplicationWithHttpInfo($a2_p_application_submission) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +288,21 @@ public function beginA2PApplicationWithHttpInfo($a2_p_application_submission) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +317,21 @@ public function beginA2PApplicationWithHttpInfo($a2_p_application_submission) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +385,14 @@ public function beginA2PApplicationWithHttpInfo($a2_p_application_submission) * Create A2P Application * * @param \OpenAPI\Client\Model\A2PApplicationSubmission $a2_p_application_submission (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['beginA2PApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function beginA2PApplicationAsync($a2_p_application_submission) + public function beginA2PApplicationAsync($a2_p_application_submission, string $contentType = self::contentTypes['beginA2PApplication'][0]) { - return $this->beginA2PApplicationAsyncWithHttpInfo($a2_p_application_submission) + return $this->beginA2PApplicationAsyncWithHttpInfo($a2_p_application_submission, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +406,15 @@ function ($response) { * Create A2P Application * * @param \OpenAPI\Client\Model\A2PApplicationSubmission $a2_p_application_submission (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['beginA2PApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function beginA2PApplicationAsyncWithHttpInfo($a2_p_application_submission) + public function beginA2PApplicationAsyncWithHttpInfo($a2_p_application_submission, string $contentType = self::contentTypes['beginA2PApplication'][0]) { $returnType = 'bool'; - $request = $this->beginA2PApplicationRequest($a2_p_application_submission); + $request = $this->beginA2PApplicationRequest($a2_p_application_submission, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +424,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +456,14 @@ function ($exception) { * Create request for operation 'beginA2PApplication' * * @param \OpenAPI\Client\Model\A2PApplicationSubmission $a2_p_application_submission (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['beginA2PApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function beginA2PApplicationRequest($a2_p_application_submission) + public function beginA2PApplicationRequest($a2_p_application_submission, string $contentType = self::contentTypes['beginA2PApplication'][0]) { + // verify the required parameter 'a2_p_application_submission' is set if ($a2_p_application_submission === null || (is_array($a2_p_application_submission) && count($a2_p_application_submission) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +471,7 @@ public function beginA2PApplicationRequest($a2_p_application_submission) ); } + $resourcePath = '/v2/a2p/application'; $formParams = []; $queryParams = []; @@ -382,21 +483,17 @@ public function beginA2PApplicationRequest($a2_p_application_submission) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($a2_p_application_submission)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($a2_p_application_submission)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($a2_p_application_submission)); } else { $httpBody = $a2_p_application_submission; } @@ -415,12 +512,12 @@ public function beginA2PApplicationRequest($a2_p_application_submission) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -436,10 +533,11 @@ public function beginA2PApplicationRequest($a2_p_application_submission) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -450,14 +548,15 @@ public function beginA2PApplicationRequest($a2_p_application_submission) * * Fetch A2P Application * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchA2PApplication'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchA2PApplication() + public function fetchA2PApplication(string $contentType = self::contentTypes['fetchA2PApplication'][0]) { - list($response) = $this->fetchA2PApplicationWithHttpInfo(); + list($response) = $this->fetchA2PApplicationWithHttpInfo($contentType); return $response; } @@ -466,14 +565,15 @@ public function fetchA2PApplication() * * Fetch A2P Application * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchA2PApplication'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchA2PApplicationWithHttpInfo() + public function fetchA2PApplicationWithHttpInfo(string $contentType = self::contentTypes['fetchA2PApplication'][0]) { - $request = $this->fetchA2PApplicationRequest(); + $request = $this->fetchA2PApplicationRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -516,6 +616,21 @@ public function fetchA2PApplicationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -528,6 +643,21 @@ public function fetchA2PApplicationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -540,6 +670,21 @@ public function fetchA2PApplicationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -552,6 +697,21 @@ public function fetchA2PApplicationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -566,6 +726,21 @@ public function fetchA2PApplicationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -618,13 +793,14 @@ public function fetchA2PApplicationWithHttpInfo() * * Fetch A2P Application * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchA2PApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchA2PApplicationAsync() + public function fetchA2PApplicationAsync(string $contentType = self::contentTypes['fetchA2PApplication'][0]) { - return $this->fetchA2PApplicationAsyncWithHttpInfo() + return $this->fetchA2PApplicationAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -637,14 +813,15 @@ function ($response) { * * Fetch A2P Application * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchA2PApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchA2PApplicationAsyncWithHttpInfo() + public function fetchA2PApplicationAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchA2PApplication'][0]) { $returnType = 'mixed'; - $request = $this->fetchA2PApplicationRequest(); + $request = $this->fetchA2PApplicationRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -654,6 +831,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -682,13 +862,15 @@ function ($exception) { /** * Create request for operation 'fetchA2PApplication' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchA2PApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchA2PApplicationRequest() + public function fetchA2PApplicationRequest(string $contentType = self::contentTypes['fetchA2PApplication'][0]) { + $resourcePath = '/v2/a2p/application'; $formParams = []; $queryParams = []; @@ -700,16 +882,11 @@ public function fetchA2PApplicationRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -727,12 +904,12 @@ public function fetchA2PApplicationRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -748,10 +925,11 @@ public function fetchA2PApplicationRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -762,14 +940,15 @@ public function fetchA2PApplicationRequest() * * Fetch A2P Registration * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchA2PRegistration'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchA2PRegistration() + public function fetchA2PRegistration(string $contentType = self::contentTypes['fetchA2PRegistration'][0]) { - list($response) = $this->fetchA2PRegistrationWithHttpInfo(); + list($response) = $this->fetchA2PRegistrationWithHttpInfo($contentType); return $response; } @@ -778,14 +957,15 @@ public function fetchA2PRegistration() * * Fetch A2P Registration * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchA2PRegistration'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchA2PRegistrationWithHttpInfo() + public function fetchA2PRegistrationWithHttpInfo(string $contentType = self::contentTypes['fetchA2PRegistration'][0]) { - $request = $this->fetchA2PRegistrationRequest(); + $request = $this->fetchA2PRegistrationRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -828,6 +1008,21 @@ public function fetchA2PRegistrationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -840,6 +1035,21 @@ public function fetchA2PRegistrationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -852,6 +1062,21 @@ public function fetchA2PRegistrationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -864,6 +1089,21 @@ public function fetchA2PRegistrationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -878,6 +1118,21 @@ public function fetchA2PRegistrationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -930,13 +1185,14 @@ public function fetchA2PRegistrationWithHttpInfo() * * Fetch A2P Registration * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchA2PRegistration'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchA2PRegistrationAsync() + public function fetchA2PRegistrationAsync(string $contentType = self::contentTypes['fetchA2PRegistration'][0]) { - return $this->fetchA2PRegistrationAsyncWithHttpInfo() + return $this->fetchA2PRegistrationAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -949,14 +1205,15 @@ function ($response) { * * Fetch A2P Registration * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchA2PRegistration'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchA2PRegistrationAsyncWithHttpInfo() + public function fetchA2PRegistrationAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchA2PRegistration'][0]) { $returnType = 'mixed'; - $request = $this->fetchA2PRegistrationRequest(); + $request = $this->fetchA2PRegistrationRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -966,6 +1223,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -994,13 +1254,15 @@ function ($exception) { /** * Create request for operation 'fetchA2PRegistration' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchA2PRegistration'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchA2PRegistrationRequest() + public function fetchA2PRegistrationRequest(string $contentType = self::contentTypes['fetchA2PRegistration'][0]) { + $resourcePath = '/v2/a2p/registration'; $formParams = []; $queryParams = []; @@ -1012,16 +1274,11 @@ public function fetchA2PRegistrationRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1039,12 +1296,12 @@ public function fetchA2PRegistrationRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1060,10 +1317,11 @@ public function fetchA2PRegistrationRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1076,14 +1334,15 @@ public function fetchA2PRegistrationRequest() * * @param string $application_id application_id (required) * @param \OpenAPI\Client\Model\WTA2PApplicationUpdateParams $wta2_p_application_update_params wta2_p_application_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateA2PApplication'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateA2PApplication($application_id, $wta2_p_application_update_params) + public function updateA2PApplication($application_id, $wta2_p_application_update_params, string $contentType = self::contentTypes['updateA2PApplication'][0]) { - list($response) = $this->updateA2PApplicationWithHttpInfo($application_id, $wta2_p_application_update_params); + list($response) = $this->updateA2PApplicationWithHttpInfo($application_id, $wta2_p_application_update_params, $contentType); return $response; } @@ -1094,14 +1353,15 @@ public function updateA2PApplication($application_id, $wta2_p_application_update * * @param string $application_id (required) * @param \OpenAPI\Client\Model\WTA2PApplicationUpdateParams $wta2_p_application_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateA2PApplication'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateA2PApplicationWithHttpInfo($application_id, $wta2_p_application_update_params) + public function updateA2PApplicationWithHttpInfo($application_id, $wta2_p_application_update_params, string $contentType = self::contentTypes['updateA2PApplication'][0]) { - $request = $this->updateA2PApplicationRequest($application_id, $wta2_p_application_update_params); + $request = $this->updateA2PApplicationRequest($application_id, $wta2_p_application_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1144,6 +1404,21 @@ public function updateA2PApplicationWithHttpInfo($application_id, $wta2_p_applic $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1156,6 +1431,21 @@ public function updateA2PApplicationWithHttpInfo($application_id, $wta2_p_applic $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1168,6 +1458,21 @@ public function updateA2PApplicationWithHttpInfo($application_id, $wta2_p_applic $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1180,6 +1485,21 @@ public function updateA2PApplicationWithHttpInfo($application_id, $wta2_p_applic $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1194,6 +1514,21 @@ public function updateA2PApplicationWithHttpInfo($application_id, $wta2_p_applic $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1248,13 +1583,14 @@ public function updateA2PApplicationWithHttpInfo($application_id, $wta2_p_applic * * @param string $application_id (required) * @param \OpenAPI\Client\Model\WTA2PApplicationUpdateParams $wta2_p_application_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateA2PApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateA2PApplicationAsync($application_id, $wta2_p_application_update_params) + public function updateA2PApplicationAsync($application_id, $wta2_p_application_update_params, string $contentType = self::contentTypes['updateA2PApplication'][0]) { - return $this->updateA2PApplicationAsyncWithHttpInfo($application_id, $wta2_p_application_update_params) + return $this->updateA2PApplicationAsyncWithHttpInfo($application_id, $wta2_p_application_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1269,14 +1605,15 @@ function ($response) { * * @param string $application_id (required) * @param \OpenAPI\Client\Model\WTA2PApplicationUpdateParams $wta2_p_application_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateA2PApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateA2PApplicationAsyncWithHttpInfo($application_id, $wta2_p_application_update_params) + public function updateA2PApplicationAsyncWithHttpInfo($application_id, $wta2_p_application_update_params, string $contentType = self::contentTypes['updateA2PApplication'][0]) { $returnType = 'bool'; - $request = $this->updateA2PApplicationRequest($application_id, $wta2_p_application_update_params); + $request = $this->updateA2PApplicationRequest($application_id, $wta2_p_application_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1286,6 +1623,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1316,12 +1656,14 @@ function ($exception) { * * @param string $application_id (required) * @param \OpenAPI\Client\Model\WTA2PApplicationUpdateParams $wta2_p_application_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateA2PApplication'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateA2PApplicationRequest($application_id, $wta2_p_application_update_params) + public function updateA2PApplicationRequest($application_id, $wta2_p_application_update_params, string $contentType = self::contentTypes['updateA2PApplication'][0]) { + // verify the required parameter 'application_id' is set if ($application_id === null || (is_array($application_id) && count($application_id) === 0)) { throw new \InvalidArgumentException( @@ -1337,7 +1679,7 @@ public function updateA2PApplicationRequest($application_id, $wta2_p_application if (!preg_match("/^[a-zA-Z0-9]+$/", $application_id)) { throw new \InvalidArgumentException("invalid value for \"application_id\" when calling A2PApi.updateA2PApplication, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'wta2_p_application_update_params' is set if ($wta2_p_application_update_params === null || (is_array($wta2_p_application_update_params) && count($wta2_p_application_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1345,6 +1687,7 @@ public function updateA2PApplicationRequest($application_id, $wta2_p_application ); } + $resourcePath = '/v2/a2p/application/{applicationID}'; $formParams = []; $queryParams = []; @@ -1364,21 +1707,17 @@ public function updateA2PApplicationRequest($application_id, $wta2_p_application } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wta2_p_application_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wta2_p_application_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wta2_p_application_update_params)); } else { $httpBody = $wta2_p_application_update_params; } @@ -1397,12 +1736,12 @@ public function updateA2PApplicationRequest($application_id, $wta2_p_application // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1418,10 +1757,11 @@ public function updateA2PApplicationRequest($application_id, $wta2_p_application $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/AdvertisementCreditsApi.php b/lib/Api/AdvertisementCreditsApi.php index 6531cb4..a72aeed 100644 --- a/lib/Api/AdvertisementCreditsApi.php +++ b/lib/Api/AdvertisementCreditsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createAdvertisementCredit' => [ + 'application/json', + ], + 'fetchAdvertisementCreditById' => [ + 'application/json', + ], + 'fetchAdvertisementCreditScans' => [ + 'application/json', + ], + 'fetchAllAdvertisementCredits' => [ + 'application/json', + ], + 'restoreAdvertisementCredit' => [ + 'application/json', + ], + 'updateAdvertisementCredit' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +147,15 @@ public function getConfig() * Archive ad credit * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveAdvertisementCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTAdvertisementCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveAdvertisementCredit($id) + public function archiveAdvertisementCredit($id, string $contentType = self::contentTypes['archiveAdvertisementCredit'][0]) { - list($response) = $this->archiveAdvertisementCreditWithHttpInfo($id); + list($response) = $this->archiveAdvertisementCreditWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +165,15 @@ public function archiveAdvertisementCredit($id) * Archive ad credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveAdvertisementCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTAdvertisementCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveAdvertisementCreditWithHttpInfo($id) + public function archiveAdvertisementCreditWithHttpInfo($id, string $contentType = self::contentTypes['archiveAdvertisementCredit'][0]) { - $request = $this->archiveAdvertisementCreditRequest($id); + $request = $this->archiveAdvertisementCreditRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +216,21 @@ public function archiveAdvertisementCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTAdvertisementCredit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +243,21 @@ public function archiveAdvertisementCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +270,21 @@ public function archiveAdvertisementCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +297,21 @@ public function archiveAdvertisementCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +326,21 @@ public function archiveAdvertisementCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +394,14 @@ public function archiveAdvertisementCreditWithHttpInfo($id) * Archive ad credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveAdvertisementCreditAsync($id) + public function archiveAdvertisementCreditAsync($id, string $contentType = self::contentTypes['archiveAdvertisementCredit'][0]) { - return $this->archiveAdvertisementCreditAsyncWithHttpInfo($id) + return $this->archiveAdvertisementCreditAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +415,15 @@ function ($response) { * Archive ad credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveAdvertisementCreditAsyncWithHttpInfo($id) + public function archiveAdvertisementCreditAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveAdvertisementCredit'][0]) { $returnType = '\OpenAPI\Client\Model\WTAdvertisementCredit'; - $request = $this->archiveAdvertisementCreditRequest($id); + $request = $this->archiveAdvertisementCreditRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +433,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +465,14 @@ function ($exception) { * Create request for operation 'archiveAdvertisementCredit' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveAdvertisementCreditRequest($id) + public function archiveAdvertisementCreditRequest($id, string $contentType = self::contentTypes['archiveAdvertisementCredit'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +480,7 @@ public function archiveAdvertisementCreditRequest($id) ); } + $resourcePath = '/v2/payment/advertisementCredit/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +500,11 @@ public function archiveAdvertisementCreditRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +522,12 @@ public function archiveAdvertisementCreditRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +543,11 @@ public function archiveAdvertisementCreditRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +559,15 @@ public function archiveAdvertisementCreditRequest($id) * Create ad credit * * @param \OpenAPI\Client\Model\WTAdvertisementCreditCreateParams $wt_advertisement_credit_create_params wt_advertisement_credit_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAdvertisementCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTAdvertisementCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError */ - public function createAdvertisementCredit($wt_advertisement_credit_create_params) + public function createAdvertisementCredit($wt_advertisement_credit_create_params, string $contentType = self::contentTypes['createAdvertisementCredit'][0]) { - list($response) = $this->createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_create_params); + list($response) = $this->createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_create_params, $contentType); return $response; } @@ -470,14 +577,15 @@ public function createAdvertisementCredit($wt_advertisement_credit_create_params * Create ad credit * * @param \OpenAPI\Client\Model\WTAdvertisementCreditCreateParams $wt_advertisement_credit_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAdvertisementCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTAdvertisementCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_create_params) + public function createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_create_params, string $contentType = self::contentTypes['createAdvertisementCredit'][0]) { - $request = $this->createAdvertisementCreditRequest($wt_advertisement_credit_create_params); + $request = $this->createAdvertisementCreditRequest($wt_advertisement_credit_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +628,21 @@ public function createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTAdvertisementCredit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +655,21 @@ public function createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +682,21 @@ public function createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +709,21 @@ public function createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -568,6 +736,21 @@ public function createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantNotInitialized' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -580,6 +763,21 @@ public function createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -594,6 +792,21 @@ public function createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -663,13 +876,14 @@ public function createAdvertisementCreditWithHttpInfo($wt_advertisement_credit_c * Create ad credit * * @param \OpenAPI\Client\Model\WTAdvertisementCreditCreateParams $wt_advertisement_credit_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAdvertisementCreditAsync($wt_advertisement_credit_create_params) + public function createAdvertisementCreditAsync($wt_advertisement_credit_create_params, string $contentType = self::contentTypes['createAdvertisementCredit'][0]) { - return $this->createAdvertisementCreditAsyncWithHttpInfo($wt_advertisement_credit_create_params) + return $this->createAdvertisementCreditAsyncWithHttpInfo($wt_advertisement_credit_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -683,14 +897,15 @@ function ($response) { * Create ad credit * * @param \OpenAPI\Client\Model\WTAdvertisementCreditCreateParams $wt_advertisement_credit_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAdvertisementCreditAsyncWithHttpInfo($wt_advertisement_credit_create_params) + public function createAdvertisementCreditAsyncWithHttpInfo($wt_advertisement_credit_create_params, string $contentType = self::contentTypes['createAdvertisementCredit'][0]) { $returnType = '\OpenAPI\Client\Model\WTAdvertisementCredit'; - $request = $this->createAdvertisementCreditRequest($wt_advertisement_credit_create_params); + $request = $this->createAdvertisementCreditRequest($wt_advertisement_credit_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -700,6 +915,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -729,12 +947,14 @@ function ($exception) { * Create request for operation 'createAdvertisementCredit' * * @param \OpenAPI\Client\Model\WTAdvertisementCreditCreateParams $wt_advertisement_credit_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createAdvertisementCreditRequest($wt_advertisement_credit_create_params) + public function createAdvertisementCreditRequest($wt_advertisement_credit_create_params, string $contentType = self::contentTypes['createAdvertisementCredit'][0]) { + // verify the required parameter 'wt_advertisement_credit_create_params' is set if ($wt_advertisement_credit_create_params === null || (is_array($wt_advertisement_credit_create_params) && count($wt_advertisement_credit_create_params) === 0)) { throw new \InvalidArgumentException( @@ -742,6 +962,7 @@ public function createAdvertisementCreditRequest($wt_advertisement_credit_create ); } + $resourcePath = '/v2/payment/advertisementCredit'; $formParams = []; $queryParams = []; @@ -753,21 +974,17 @@ public function createAdvertisementCreditRequest($wt_advertisement_credit_create - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_advertisement_credit_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_advertisement_credit_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_advertisement_credit_create_params)); } else { $httpBody = $wt_advertisement_credit_create_params; } @@ -786,12 +1003,12 @@ public function createAdvertisementCreditRequest($wt_advertisement_credit_create // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -807,10 +1024,11 @@ public function createAdvertisementCreditRequest($wt_advertisement_credit_create $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -822,14 +1040,15 @@ public function createAdvertisementCreditRequest($wt_advertisement_credit_create * Fetch ad credit * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTAdvertisementCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAdvertisementCreditById($id) + public function fetchAdvertisementCreditById($id, string $contentType = self::contentTypes['fetchAdvertisementCreditById'][0]) { - list($response) = $this->fetchAdvertisementCreditByIdWithHttpInfo($id); + list($response) = $this->fetchAdvertisementCreditByIdWithHttpInfo($id, $contentType); return $response; } @@ -839,14 +1058,15 @@ public function fetchAdvertisementCreditById($id) * Fetch ad credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTAdvertisementCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAdvertisementCreditByIdWithHttpInfo($id) + public function fetchAdvertisementCreditByIdWithHttpInfo($id, string $contentType = self::contentTypes['fetchAdvertisementCreditById'][0]) { - $request = $this->fetchAdvertisementCreditByIdRequest($id); + $request = $this->fetchAdvertisementCreditByIdRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -889,6 +1109,21 @@ public function fetchAdvertisementCreditByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTAdvertisementCredit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -901,6 +1136,21 @@ public function fetchAdvertisementCreditByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -913,6 +1163,21 @@ public function fetchAdvertisementCreditByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -925,6 +1190,21 @@ public function fetchAdvertisementCreditByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -939,6 +1219,21 @@ public function fetchAdvertisementCreditByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -992,13 +1287,14 @@ public function fetchAdvertisementCreditByIdWithHttpInfo($id) * Fetch ad credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAdvertisementCreditByIdAsync($id) + public function fetchAdvertisementCreditByIdAsync($id, string $contentType = self::contentTypes['fetchAdvertisementCreditById'][0]) { - return $this->fetchAdvertisementCreditByIdAsyncWithHttpInfo($id) + return $this->fetchAdvertisementCreditByIdAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1012,14 +1308,15 @@ function ($response) { * Fetch ad credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAdvertisementCreditByIdAsyncWithHttpInfo($id) + public function fetchAdvertisementCreditByIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchAdvertisementCreditById'][0]) { $returnType = '\OpenAPI\Client\Model\WTAdvertisementCredit'; - $request = $this->fetchAdvertisementCreditByIdRequest($id); + $request = $this->fetchAdvertisementCreditByIdRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1029,6 +1326,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1058,12 +1358,14 @@ function ($exception) { * Create request for operation 'fetchAdvertisementCreditById' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAdvertisementCreditByIdRequest($id) + public function fetchAdvertisementCreditByIdRequest($id, string $contentType = self::contentTypes['fetchAdvertisementCreditById'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1071,6 +1373,7 @@ public function fetchAdvertisementCreditByIdRequest($id) ); } + $resourcePath = '/v2/payment/advertisementCredit/{id}'; $formParams = []; $queryParams = []; @@ -1090,16 +1393,11 @@ public function fetchAdvertisementCreditByIdRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1117,12 +1415,12 @@ public function fetchAdvertisementCreditByIdRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1138,10 +1436,11 @@ public function fetchAdvertisementCreditByIdRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1153,14 +1452,15 @@ public function fetchAdvertisementCreditByIdRequest($id) * Fetch scans * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditScans'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTAdvertisementCreditScan[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAdvertisementCreditScans($id) + public function fetchAdvertisementCreditScans($id, string $contentType = self::contentTypes['fetchAdvertisementCreditScans'][0]) { - list($response) = $this->fetchAdvertisementCreditScansWithHttpInfo($id); + list($response) = $this->fetchAdvertisementCreditScansWithHttpInfo($id, $contentType); return $response; } @@ -1170,14 +1470,15 @@ public function fetchAdvertisementCreditScans($id) * Fetch scans * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditScans'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTAdvertisementCreditScan[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAdvertisementCreditScansWithHttpInfo($id) + public function fetchAdvertisementCreditScansWithHttpInfo($id, string $contentType = self::contentTypes['fetchAdvertisementCreditScans'][0]) { - $request = $this->fetchAdvertisementCreditScansRequest($id); + $request = $this->fetchAdvertisementCreditScansRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1220,6 +1521,21 @@ public function fetchAdvertisementCreditScansWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTAdvertisementCreditScan[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1232,6 +1548,21 @@ public function fetchAdvertisementCreditScansWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1244,6 +1575,21 @@ public function fetchAdvertisementCreditScansWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1256,6 +1602,21 @@ public function fetchAdvertisementCreditScansWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1270,6 +1631,21 @@ public function fetchAdvertisementCreditScansWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1323,13 +1699,14 @@ public function fetchAdvertisementCreditScansWithHttpInfo($id) * Fetch scans * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditScans'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAdvertisementCreditScansAsync($id) + public function fetchAdvertisementCreditScansAsync($id, string $contentType = self::contentTypes['fetchAdvertisementCreditScans'][0]) { - return $this->fetchAdvertisementCreditScansAsyncWithHttpInfo($id) + return $this->fetchAdvertisementCreditScansAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1343,14 +1720,15 @@ function ($response) { * Fetch scans * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditScans'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAdvertisementCreditScansAsyncWithHttpInfo($id) + public function fetchAdvertisementCreditScansAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchAdvertisementCreditScans'][0]) { $returnType = '\OpenAPI\Client\Model\WTAdvertisementCreditScan[]'; - $request = $this->fetchAdvertisementCreditScansRequest($id); + $request = $this->fetchAdvertisementCreditScansRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1360,6 +1738,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1389,12 +1770,14 @@ function ($exception) { * Create request for operation 'fetchAdvertisementCreditScans' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditScans'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAdvertisementCreditScansRequest($id) + public function fetchAdvertisementCreditScansRequest($id, string $contentType = self::contentTypes['fetchAdvertisementCreditScans'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1402,6 +1785,7 @@ public function fetchAdvertisementCreditScansRequest($id) ); } + $resourcePath = '/v2/payment/advertisementCredit/scans/{id}'; $formParams = []; $queryParams = []; @@ -1421,16 +1805,11 @@ public function fetchAdvertisementCreditScansRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1448,12 +1827,12 @@ public function fetchAdvertisementCreditScansRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1469,10 +1848,11 @@ public function fetchAdvertisementCreditScansRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1484,14 +1864,15 @@ public function fetchAdvertisementCreditScansRequest($id) * Fetch all active ad credits * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllAdvertisementCredits'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTAdvertisementCredit[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllAdvertisementCredits($is_archive_included = null) + public function fetchAllAdvertisementCredits($is_archive_included = null, string $contentType = self::contentTypes['fetchAllAdvertisementCredits'][0]) { - list($response) = $this->fetchAllAdvertisementCreditsWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllAdvertisementCreditsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -1501,14 +1882,15 @@ public function fetchAllAdvertisementCredits($is_archive_included = null) * Fetch all active ad credits * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllAdvertisementCredits'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTAdvertisementCredit[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllAdvertisementCreditsWithHttpInfo($is_archive_included = null) + public function fetchAllAdvertisementCreditsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllAdvertisementCredits'][0]) { - $request = $this->fetchAllAdvertisementCreditsRequest($is_archive_included); + $request = $this->fetchAllAdvertisementCreditsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -1551,6 +1933,21 @@ public function fetchAllAdvertisementCreditsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTAdvertisementCredit[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1563,6 +1960,21 @@ public function fetchAllAdvertisementCreditsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1575,6 +1987,21 @@ public function fetchAllAdvertisementCreditsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1587,6 +2014,21 @@ public function fetchAllAdvertisementCreditsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1601,6 +2043,21 @@ public function fetchAllAdvertisementCreditsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1654,13 +2111,14 @@ public function fetchAllAdvertisementCreditsWithHttpInfo($is_archive_included = * Fetch all active ad credits * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllAdvertisementCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllAdvertisementCreditsAsync($is_archive_included = null) + public function fetchAllAdvertisementCreditsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllAdvertisementCredits'][0]) { - return $this->fetchAllAdvertisementCreditsAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllAdvertisementCreditsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -1674,14 +2132,15 @@ function ($response) { * Fetch all active ad credits * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllAdvertisementCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllAdvertisementCreditsAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllAdvertisementCreditsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllAdvertisementCredits'][0]) { $returnType = '\OpenAPI\Client\Model\WTAdvertisementCredit[]'; - $request = $this->fetchAllAdvertisementCreditsRequest($is_archive_included); + $request = $this->fetchAllAdvertisementCreditsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1691,6 +2150,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1720,13 +2182,16 @@ function ($exception) { * Create request for operation 'fetchAllAdvertisementCredits' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllAdvertisementCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllAdvertisementCreditsRequest($is_archive_included = null) + public function fetchAllAdvertisementCreditsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllAdvertisementCredits'][0]) { + + $resourcePath = '/v2/payment/advertisementCredit/all'; $formParams = []; $queryParams = []; @@ -1735,30 +2200,23 @@ public function fetchAllAdvertisementCreditsRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1776,12 +2234,12 @@ public function fetchAllAdvertisementCreditsRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1797,10 +2255,11 @@ public function fetchAllAdvertisementCreditsRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1812,14 +2271,15 @@ public function fetchAllAdvertisementCreditsRequest($is_archive_included = null) * Restore ad credit * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreAdvertisementCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTAdvertisementCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreAdvertisementCredit($id) + public function restoreAdvertisementCredit($id, string $contentType = self::contentTypes['restoreAdvertisementCredit'][0]) { - list($response) = $this->restoreAdvertisementCreditWithHttpInfo($id); + list($response) = $this->restoreAdvertisementCreditWithHttpInfo($id, $contentType); return $response; } @@ -1829,14 +2289,15 @@ public function restoreAdvertisementCredit($id) * Restore ad credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreAdvertisementCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTAdvertisementCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreAdvertisementCreditWithHttpInfo($id) + public function restoreAdvertisementCreditWithHttpInfo($id, string $contentType = self::contentTypes['restoreAdvertisementCredit'][0]) { - $request = $this->restoreAdvertisementCreditRequest($id); + $request = $this->restoreAdvertisementCreditRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1879,6 +2340,21 @@ public function restoreAdvertisementCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTAdvertisementCredit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1891,6 +2367,21 @@ public function restoreAdvertisementCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1903,6 +2394,21 @@ public function restoreAdvertisementCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1915,6 +2421,21 @@ public function restoreAdvertisementCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1929,6 +2450,21 @@ public function restoreAdvertisementCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1982,13 +2518,14 @@ public function restoreAdvertisementCreditWithHttpInfo($id) * Restore ad credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreAdvertisementCreditAsync($id) + public function restoreAdvertisementCreditAsync($id, string $contentType = self::contentTypes['restoreAdvertisementCredit'][0]) { - return $this->restoreAdvertisementCreditAsyncWithHttpInfo($id) + return $this->restoreAdvertisementCreditAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -2002,14 +2539,15 @@ function ($response) { * Restore ad credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreAdvertisementCreditAsyncWithHttpInfo($id) + public function restoreAdvertisementCreditAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreAdvertisementCredit'][0]) { $returnType = '\OpenAPI\Client\Model\WTAdvertisementCredit'; - $request = $this->restoreAdvertisementCreditRequest($id); + $request = $this->restoreAdvertisementCreditRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2019,6 +2557,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2048,12 +2589,14 @@ function ($exception) { * Create request for operation 'restoreAdvertisementCredit' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreAdvertisementCreditRequest($id) + public function restoreAdvertisementCreditRequest($id, string $contentType = self::contentTypes['restoreAdvertisementCredit'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -2061,6 +2604,7 @@ public function restoreAdvertisementCreditRequest($id) ); } + $resourcePath = '/v2/payment/advertisementCredit/{id}'; $formParams = []; $queryParams = []; @@ -2080,16 +2624,11 @@ public function restoreAdvertisementCreditRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2107,12 +2646,12 @@ public function restoreAdvertisementCreditRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2128,10 +2667,11 @@ public function restoreAdvertisementCreditRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2144,14 +2684,15 @@ public function restoreAdvertisementCreditRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTAdvertisementCreditUpdateParams $wt_advertisement_credit_update_params wt_advertisement_credit_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAdvertisementCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTAdvertisementCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function updateAdvertisementCredit($id, $wt_advertisement_credit_update_params) + public function updateAdvertisementCredit($id, $wt_advertisement_credit_update_params, string $contentType = self::contentTypes['updateAdvertisementCredit'][0]) { - list($response) = $this->updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_credit_update_params); + list($response) = $this->updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_credit_update_params, $contentType); return $response; } @@ -2162,14 +2703,15 @@ public function updateAdvertisementCredit($id, $wt_advertisement_credit_update_p * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTAdvertisementCreditUpdateParams $wt_advertisement_credit_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAdvertisementCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTAdvertisementCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_credit_update_params) + public function updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_credit_update_params, string $contentType = self::contentTypes['updateAdvertisementCredit'][0]) { - $request = $this->updateAdvertisementCreditRequest($id, $wt_advertisement_credit_update_params); + $request = $this->updateAdvertisementCreditRequest($id, $wt_advertisement_credit_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -2212,6 +2754,21 @@ public function updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_cre $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTAdvertisementCredit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2224,6 +2781,21 @@ public function updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_cre $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2236,6 +2808,21 @@ public function updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_cre $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2248,6 +2835,21 @@ public function updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_cre $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2260,6 +2862,21 @@ public function updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_cre $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2272,6 +2889,21 @@ public function updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_cre $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2286,6 +2918,21 @@ public function updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_cre $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2356,13 +3003,14 @@ public function updateAdvertisementCreditWithHttpInfo($id, $wt_advertisement_cre * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTAdvertisementCreditUpdateParams $wt_advertisement_credit_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAdvertisementCreditAsync($id, $wt_advertisement_credit_update_params) + public function updateAdvertisementCreditAsync($id, $wt_advertisement_credit_update_params, string $contentType = self::contentTypes['updateAdvertisementCredit'][0]) { - return $this->updateAdvertisementCreditAsyncWithHttpInfo($id, $wt_advertisement_credit_update_params) + return $this->updateAdvertisementCreditAsyncWithHttpInfo($id, $wt_advertisement_credit_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -2377,14 +3025,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTAdvertisementCreditUpdateParams $wt_advertisement_credit_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAdvertisementCreditAsyncWithHttpInfo($id, $wt_advertisement_credit_update_params) + public function updateAdvertisementCreditAsyncWithHttpInfo($id, $wt_advertisement_credit_update_params, string $contentType = self::contentTypes['updateAdvertisementCredit'][0]) { $returnType = '\OpenAPI\Client\Model\WTAdvertisementCredit'; - $request = $this->updateAdvertisementCreditRequest($id, $wt_advertisement_credit_update_params); + $request = $this->updateAdvertisementCreditRequest($id, $wt_advertisement_credit_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2394,6 +3043,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2424,18 +3076,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTAdvertisementCreditUpdateParams $wt_advertisement_credit_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateAdvertisementCreditRequest($id, $wt_advertisement_credit_update_params) + public function updateAdvertisementCreditRequest($id, $wt_advertisement_credit_update_params, string $contentType = self::contentTypes['updateAdvertisementCredit'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateAdvertisementCredit' ); } + // verify the required parameter 'wt_advertisement_credit_update_params' is set if ($wt_advertisement_credit_update_params === null || (is_array($wt_advertisement_credit_update_params) && count($wt_advertisement_credit_update_params) === 0)) { throw new \InvalidArgumentException( @@ -2443,6 +3098,7 @@ public function updateAdvertisementCreditRequest($id, $wt_advertisement_credit_u ); } + $resourcePath = '/v2/payment/advertisementCredit/{id}'; $formParams = []; $queryParams = []; @@ -2462,21 +3118,17 @@ public function updateAdvertisementCreditRequest($id, $wt_advertisement_credit_u } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_advertisement_credit_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_advertisement_credit_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_advertisement_credit_update_params)); } else { $httpBody = $wt_advertisement_credit_update_params; } @@ -2495,12 +3147,12 @@ public function updateAdvertisementCreditRequest($id, $wt_advertisement_credit_u // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2516,10 +3168,11 @@ public function updateAdvertisementCreditRequest($id, $wt_advertisement_credit_u $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/AmenitiesApi.php b/lib/Api/AmenitiesApi.php index a60d55c..bdcb092 100644 --- a/lib/Api/AmenitiesApi.php +++ b/lib/Api/AmenitiesApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createAmenity' => [ + 'application/json', + ], + 'fetchAllAmenities' => [ + 'application/json', + ], + 'restoreAmenity' => [ + 'application/json', + ], + 'updateAmenity' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive amenity * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveAmenity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Amenity|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveAmenity($id) + public function archiveAmenity($id, string $contentType = self::contentTypes['archiveAmenity'][0]) { - list($response) = $this->archiveAmenityWithHttpInfo($id); + list($response) = $this->archiveAmenityWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveAmenity($id) * Archive amenity * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveAmenity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Amenity|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveAmenityWithHttpInfo($id) + public function archiveAmenityWithHttpInfo($id, string $contentType = self::contentTypes['archiveAmenity'][0]) { - $request = $this->archiveAmenityRequest($id); + $request = $this->archiveAmenityRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveAmenityWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Amenity' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveAmenityWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveAmenityWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveAmenityWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveAmenityWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveAmenityWithHttpInfo($id) * Archive amenity * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveAmenityAsync($id) + public function archiveAmenityAsync($id, string $contentType = self::contentTypes['archiveAmenity'][0]) { - return $this->archiveAmenityAsyncWithHttpInfo($id) + return $this->archiveAmenityAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive amenity * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveAmenityAsyncWithHttpInfo($id) + public function archiveAmenityAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveAmenity'][0]) { $returnType = '\OpenAPI\Client\Model\Amenity'; - $request = $this->archiveAmenityRequest($id); + $request = $this->archiveAmenityRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveAmenity' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveAmenityRequest($id) + public function archiveAmenityRequest($id, string $contentType = self::contentTypes['archiveAmenity'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveAmenityRequest($id) ); } + $resourcePath = '/v2/amenities/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveAmenityRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveAmenityRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveAmenityRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveAmenityRequest($id) * Create amenity * * @param \OpenAPI\Client\Model\WTAmenityCreateParams $wt_amenity_create_params wt_amenity_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAmenity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Amenity|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createAmenity($wt_amenity_create_params) + public function createAmenity($wt_amenity_create_params, string $contentType = self::contentTypes['createAmenity'][0]) { - list($response) = $this->createAmenityWithHttpInfo($wt_amenity_create_params); + list($response) = $this->createAmenityWithHttpInfo($wt_amenity_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createAmenity($wt_amenity_create_params) * Create amenity * * @param \OpenAPI\Client\Model\WTAmenityCreateParams $wt_amenity_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAmenity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Amenity|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createAmenityWithHttpInfo($wt_amenity_create_params) + public function createAmenityWithHttpInfo($wt_amenity_create_params, string $contentType = self::contentTypes['createAmenity'][0]) { - $request = $this->createAmenityRequest($wt_amenity_create_params); + $request = $this->createAmenityRequest($wt_amenity_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createAmenityWithHttpInfo($wt_amenity_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Amenity' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createAmenityWithHttpInfo($wt_amenity_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createAmenityWithHttpInfo($wt_amenity_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createAmenityWithHttpInfo($wt_amenity_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createAmenityWithHttpInfo($wt_amenity_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createAmenityWithHttpInfo($wt_amenity_create_params) * Create amenity * * @param \OpenAPI\Client\Model\WTAmenityCreateParams $wt_amenity_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAmenityAsync($wt_amenity_create_params) + public function createAmenityAsync($wt_amenity_create_params, string $contentType = self::contentTypes['createAmenity'][0]) { - return $this->createAmenityAsyncWithHttpInfo($wt_amenity_create_params) + return $this->createAmenityAsyncWithHttpInfo($wt_amenity_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create amenity * * @param \OpenAPI\Client\Model\WTAmenityCreateParams $wt_amenity_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAmenityAsyncWithHttpInfo($wt_amenity_create_params) + public function createAmenityAsyncWithHttpInfo($wt_amenity_create_params, string $contentType = self::contentTypes['createAmenity'][0]) { $returnType = '\OpenAPI\Client\Model\Amenity'; - $request = $this->createAmenityRequest($wt_amenity_create_params); + $request = $this->createAmenityRequest($wt_amenity_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createAmenity' * * @param \OpenAPI\Client\Model\WTAmenityCreateParams $wt_amenity_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createAmenityRequest($wt_amenity_create_params) + public function createAmenityRequest($wt_amenity_create_params, string $contentType = self::contentTypes['createAmenity'][0]) { + // verify the required parameter 'wt_amenity_create_params' is set if ($wt_amenity_create_params === null || (is_array($wt_amenity_create_params) && count($wt_amenity_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createAmenityRequest($wt_amenity_create_params) ); } + $resourcePath = '/v2/amenities'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createAmenityRequest($wt_amenity_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_amenity_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_amenity_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_amenity_create_params)); } else { $httpBody = $wt_amenity_create_params; } @@ -746,12 +927,12 @@ public function createAmenityRequest($wt_amenity_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createAmenityRequest($wt_amenity_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createAmenityRequest($wt_amenity_create_params) * Fetch all amenities * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllAmenities'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllAmenities($is_archive_included = null) + public function fetchAllAmenities($is_archive_included = null, string $contentType = self::contentTypes['fetchAllAmenities'][0]) { - list($response) = $this->fetchAllAmenitiesWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllAmenitiesWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllAmenities($is_archive_included = null) * Fetch all amenities * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllAmenities'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllAmenitiesWithHttpInfo($is_archive_included = null) + public function fetchAllAmenitiesWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllAmenities'][0]) { - $request = $this->fetchAllAmenitiesRequest($is_archive_included); + $request = $this->fetchAllAmenitiesRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllAmenitiesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllAmenitiesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllAmenitiesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllAmenitiesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllAmenitiesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllAmenitiesWithHttpInfo($is_archive_included = null) * Fetch all amenities * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllAmenities'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllAmenitiesAsync($is_archive_included = null) + public function fetchAllAmenitiesAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllAmenities'][0]) { - return $this->fetchAllAmenitiesAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllAmenitiesAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all amenities * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllAmenities'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllAmenitiesAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllAmenitiesAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllAmenities'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllAmenitiesRequest($is_archive_included); + $request = $this->fetchAllAmenitiesRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllAmenities' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllAmenities'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllAmenitiesRequest($is_archive_included = null) + public function fetchAllAmenitiesRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllAmenities'][0]) { + + $resourcePath = '/v2/amenities/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllAmenitiesRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllAmenitiesRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllAmenitiesRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllAmenitiesRequest($is_archive_included = null) * Restore amenity * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreAmenity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Amenity|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreAmenity($id) + public function restoreAmenity($id, string $contentType = self::contentTypes['restoreAmenity'][0]) { - list($response) = $this->restoreAmenityWithHttpInfo($id); + list($response) = $this->restoreAmenityWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restoreAmenity($id) * Restore amenity * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreAmenity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Amenity|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreAmenityWithHttpInfo($id) + public function restoreAmenityWithHttpInfo($id, string $contentType = self::contentTypes['restoreAmenity'][0]) { - $request = $this->restoreAmenityRequest($id); + $request = $this->restoreAmenityRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restoreAmenityWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Amenity' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restoreAmenityWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restoreAmenityWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restoreAmenityWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restoreAmenityWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restoreAmenityWithHttpInfo($id) * Restore amenity * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreAmenityAsync($id) + public function restoreAmenityAsync($id, string $contentType = self::contentTypes['restoreAmenity'][0]) { - return $this->restoreAmenityAsyncWithHttpInfo($id) + return $this->restoreAmenityAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore amenity * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreAmenityAsyncWithHttpInfo($id) + public function restoreAmenityAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreAmenity'][0]) { $returnType = '\OpenAPI\Client\Model\Amenity'; - $request = $this->restoreAmenityRequest($id); + $request = $this->restoreAmenityRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restoreAmenity' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreAmenityRequest($id) + public function restoreAmenityRequest($id, string $contentType = self::contentTypes['restoreAmenity'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restoreAmenityRequest($id) ); } + $resourcePath = '/v2/amenities/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restoreAmenityRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restoreAmenityRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restoreAmenityRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restoreAmenityRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTAmenityUpdateParams $wt_amenity_update_params wt_amenity_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAmenity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Amenity|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateAmenity($id, $wt_amenity_update_params) + public function updateAmenity($id, $wt_amenity_update_params, string $contentType = self::contentTypes['updateAmenity'][0]) { - list($response) = $this->updateAmenityWithHttpInfo($id, $wt_amenity_update_params); + list($response) = $this->updateAmenityWithHttpInfo($id, $wt_amenity_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateAmenity($id, $wt_amenity_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTAmenityUpdateParams $wt_amenity_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAmenity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Amenity|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateAmenityWithHttpInfo($id, $wt_amenity_update_params) + public function updateAmenityWithHttpInfo($id, $wt_amenity_update_params, string $contentType = self::contentTypes['updateAmenity'][0]) { - $request = $this->updateAmenityRequest($id, $wt_amenity_update_params); + $request = $this->updateAmenityRequest($id, $wt_amenity_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateAmenityWithHttpInfo($id, $wt_amenity_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Amenity' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateAmenityWithHttpInfo($id, $wt_amenity_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateAmenityWithHttpInfo($id, $wt_amenity_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateAmenityWithHttpInfo($id, $wt_amenity_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateAmenityWithHttpInfo($id, $wt_amenity_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateAmenityWithHttpInfo($id, $wt_amenity_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTAmenityUpdateParams $wt_amenity_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAmenityAsync($id, $wt_amenity_update_params) + public function updateAmenityAsync($id, $wt_amenity_update_params, string $contentType = self::contentTypes['updateAmenity'][0]) { - return $this->updateAmenityAsyncWithHttpInfo($id, $wt_amenity_update_params) + return $this->updateAmenityAsyncWithHttpInfo($id, $wt_amenity_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTAmenityUpdateParams $wt_amenity_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAmenityAsyncWithHttpInfo($id, $wt_amenity_update_params) + public function updateAmenityAsyncWithHttpInfo($id, $wt_amenity_update_params, string $contentType = self::contentTypes['updateAmenity'][0]) { $returnType = '\OpenAPI\Client\Model\Amenity'; - $request = $this->updateAmenityRequest($id, $wt_amenity_update_params); + $request = $this->updateAmenityRequest($id, $wt_amenity_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTAmenityUpdateParams $wt_amenity_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateAmenity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateAmenityRequest($id, $wt_amenity_update_params) + public function updateAmenityRequest($id, $wt_amenity_update_params, string $contentType = self::contentTypes['updateAmenity'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateAmenity' ); } + // verify the required parameter 'wt_amenity_update_params' is set if ($wt_amenity_update_params === null || (is_array($wt_amenity_update_params) && count($wt_amenity_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateAmenityRequest($id, $wt_amenity_update_params) ); } + $resourcePath = '/v2/amenities/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateAmenityRequest($id, $wt_amenity_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_amenity_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_amenity_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_amenity_update_params)); } else { $httpBody = $wt_amenity_update_params; } @@ -1753,12 +2177,12 @@ public function updateAmenityRequest($id, $wt_amenity_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateAmenityRequest($id, $wt_amenity_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/AnalyticsApi.php b/lib/Api/AnalyticsApi.php index 70f9680..ed28b72 100644 --- a/lib/Api/AnalyticsApi.php +++ b/lib/Api/AnalyticsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'countAuthenticatedSessions' => [ + 'application/json', + ], + 'countDistinctRedemptions' => [ + 'application/json', + ], + 'countHelpDeskRequests' => [ + 'application/json', + ], + 'countInboundMessages' => [ + 'application/json', + ], + 'countNewSessions' => [ + 'application/json', + ], + 'countOptInListSubscribersPartitionedByDate' => [ + 'application/json', + ], + 'countOutboundMessages' => [ + 'application/json', + ], + 'countTotalSessions' => [ + 'application/json', + ], + 'countTransactions' => [ + 'application/json', + ], + 'countVerifiedWalletPageViews' => [ + 'application/json', + ], + 'countWalletPageViews' => [ + 'application/json', + ], + 'exitLinkSummary' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsCountPartitionedByEmployee' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsCountPartitionedByValueType' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsRefundsCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID' => [ + 'application/json', + ], + 'fetchAnalyticsAdCreditsScansCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignWalletPageViews' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsCountPartitionedByCampaignID' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsCountPartitionedByEmployee' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsCountPartitionedByPaymentDesign' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsCountPartitionedByValueType' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsRefundsAmountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID' => [ + 'application/json', + ], + 'fetchAnalyticsCampaignsRefundsCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber' => [ + 'application/json', + ], + 'fetchAnalyticsDistinctWalletSessions' => [ + 'application/json', + ], + 'fetchAnalyticsDynamicVouchersCountPartitionedByEmployee' => [ + 'application/json', + ], + 'fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign' => [ + 'application/json', + ], + 'fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID' => [ + 'application/json', + ], + 'fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID' => [ + 'application/json', + ], + 'fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID' => [ + 'application/json', + ], + 'fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID' => [ + 'application/json', + ], + 'fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee' => [ + 'application/json', + ], + 'fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsItemWalletPageViews' => [ + 'application/json', + ], + 'fetchAnalyticsMemberCount' => [ + 'application/json', + ], + 'fetchAnalyticsMerchantCreditCount' => [ + 'application/json', + ], + 'fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID' => [ + 'application/json', + ], + 'fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts' => [ + 'application/json', + ], + 'fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee' => [ + 'application/json', + ], + 'fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber' => [ + 'application/json', + ], + 'fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsSentOutboundMessagesCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber' => [ + 'application/json', + ], + 'fetchAnalyticsStaticVoucherWalletPageViews' => [ + 'application/json', + ], + 'fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsTCPAStopCountPartitionedByDate' => [ + 'application/json', + ], + 'fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber' => [ + 'application/json', + ], + 'fetchAnalyticsTotalAmountRedeemedPerMerchantCredit' => [ + 'application/json', + ], + 'fetchAnalyticsTotalAmountRedeemedPerTier' => [ + 'application/json', + ], + 'fetchAnalyticsTotalAmountRefundedPerMerchantCredit' => [ + 'application/json', + ], + 'fetchAnalyticsTotalAmountRefundedPerTier' => [ + 'application/json', + ], + 'fetchAnalyticsTotalPointsRedeemed' => [ + 'application/json', + ], + 'fetchAnalyticsTotalPointsRefunded' => [ + 'application/json', + ], + 'fetchAnalyticsWalletSessionActivity' => [ + 'application/json', + ], + 'fetchWalletPageViewByID' => [ + 'application/json', + ], + 'referringSitesSummary' => [ + 'application/json', + ], + 'sumRevenue' => [ + 'application/json', + ], + 'sumTransactions' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -126,14 +382,15 @@ public function getConfig() * @param bool $is_archive_included is_archive_included (optional) * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAllSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countAllSubscribers($is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countAllSubscribers($is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countAllSubscribers'][0]) { - list($response) = $this->countAllSubscribersWithHttpInfo($is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date); + list($response) = $this->countAllSubscribersWithHttpInfo($is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType); return $response; } @@ -147,14 +404,15 @@ public function countAllSubscribers($is_subscribed = null, $is_pending_age21_ver * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAllSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countAllSubscribersWithHttpInfo($is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countAllSubscribersWithHttpInfo($is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countAllSubscribers'][0]) { - $request = $this->countAllSubscribersRequest($is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date); + $request = $this->countAllSubscribersRequest($is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -197,6 +455,21 @@ public function countAllSubscribersWithHttpInfo($is_subscribed = null, $is_pendi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -209,6 +482,21 @@ public function countAllSubscribersWithHttpInfo($is_subscribed = null, $is_pendi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -221,6 +509,21 @@ public function countAllSubscribersWithHttpInfo($is_subscribed = null, $is_pendi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -233,6 +536,21 @@ public function countAllSubscribersWithHttpInfo($is_subscribed = null, $is_pendi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -247,6 +565,21 @@ public function countAllSubscribersWithHttpInfo($is_subscribed = null, $is_pendi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -304,13 +637,14 @@ public function countAllSubscribersWithHttpInfo($is_subscribed = null, $is_pendi * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAllSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countAllSubscribersAsync($is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countAllSubscribersAsync($is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countAllSubscribers'][0]) { - return $this->countAllSubscribersAsyncWithHttpInfo($is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date) + return $this->countAllSubscribersAsyncWithHttpInfo($is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -328,14 +662,15 @@ function ($response) { * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAllSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countAllSubscribersAsyncWithHttpInfo($is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countAllSubscribersAsyncWithHttpInfo($is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countAllSubscribers'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countAllSubscribersRequest($is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date); + $request = $this->countAllSubscribersRequest($is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -345,6 +680,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -378,13 +716,20 @@ function ($exception) { * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAllSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countAllSubscribersRequest($is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countAllSubscribersRequest($is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countAllSubscribers'][0]) { + + + + + + $resourcePath = '/v2/analytics/sms/all/subscribers/count'; $formParams = []; $queryParams = []; @@ -393,74 +738,59 @@ public function countAllSubscribersRequest($is_subscribed = null, $is_pending_ag $multipart = false; // query params - if ($is_subscribed !== null) { - if('form' === 'form' && is_array($is_subscribed)) { - foreach($is_subscribed as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isSubscribed'] = $is_subscribed; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_subscribed, + 'isSubscribed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_pending_age21_verification !== null) { - if('form' === 'form' && is_array($is_pending_age21_verification)) { - foreach($is_pending_age21_verification as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isPendingAge21Verification'] = $is_pending_age21_verification; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_pending_age21_verification, + 'isPendingAge21Verification', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -478,12 +808,12 @@ public function countAllSubscribersRequest($is_subscribed = null, $is_pending_ag // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -499,10 +829,11 @@ public function countAllSubscribersRequest($is_subscribed = null, $is_pending_ag $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -515,14 +846,15 @@ public function countAllSubscribersRequest($is_subscribed = null, $is_pending_ag * * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAuthenticatedSessions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countAuthenticatedSessions($start_date = null, $end_date = null) + public function countAuthenticatedSessions($start_date = null, $end_date = null, string $contentType = self::contentTypes['countAuthenticatedSessions'][0]) { - list($response) = $this->countAuthenticatedSessionsWithHttpInfo($start_date, $end_date); + list($response) = $this->countAuthenticatedSessionsWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -533,14 +865,15 @@ public function countAuthenticatedSessions($start_date = null, $end_date = null) * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAuthenticatedSessions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countAuthenticatedSessionsWithHttpInfo($start_date = null, $end_date = null) + public function countAuthenticatedSessionsWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['countAuthenticatedSessions'][0]) { - $request = $this->countAuthenticatedSessionsRequest($start_date, $end_date); + $request = $this->countAuthenticatedSessionsRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -583,6 +916,21 @@ public function countAuthenticatedSessionsWithHttpInfo($start_date = null, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -595,6 +943,21 @@ public function countAuthenticatedSessionsWithHttpInfo($start_date = null, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -607,6 +970,21 @@ public function countAuthenticatedSessionsWithHttpInfo($start_date = null, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -619,6 +997,21 @@ public function countAuthenticatedSessionsWithHttpInfo($start_date = null, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -633,6 +1026,21 @@ public function countAuthenticatedSessionsWithHttpInfo($start_date = null, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -687,13 +1095,14 @@ public function countAuthenticatedSessionsWithHttpInfo($start_date = null, $end_ * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAuthenticatedSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countAuthenticatedSessionsAsync($start_date = null, $end_date = null) + public function countAuthenticatedSessionsAsync($start_date = null, $end_date = null, string $contentType = self::contentTypes['countAuthenticatedSessions'][0]) { - return $this->countAuthenticatedSessionsAsyncWithHttpInfo($start_date, $end_date) + return $this->countAuthenticatedSessionsAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -708,14 +1117,15 @@ function ($response) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAuthenticatedSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countAuthenticatedSessionsAsyncWithHttpInfo($start_date = null, $end_date = null) + public function countAuthenticatedSessionsAsyncWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['countAuthenticatedSessions'][0]) { $returnType = 'mixed'; - $request = $this->countAuthenticatedSessionsRequest($start_date, $end_date); + $request = $this->countAuthenticatedSessionsRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -725,6 +1135,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -755,13 +1168,17 @@ function ($exception) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAuthenticatedSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countAuthenticatedSessionsRequest($start_date = null, $end_date = null) + public function countAuthenticatedSessionsRequest($start_date = null, $end_date = null, string $contentType = self::contentTypes['countAuthenticatedSessions'][0]) { + + + $resourcePath = '/v2/analytics/walletPageViews/sessions/count/distinct/authenticated'; $formParams = []; $queryParams = []; @@ -770,41 +1187,32 @@ public function countAuthenticatedSessionsRequest($start_date = null, $end_date $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -822,12 +1230,12 @@ public function countAuthenticatedSessionsRequest($start_date = null, $end_date // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -843,10 +1251,11 @@ public function countAuthenticatedSessionsRequest($start_date = null, $end_date $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -861,14 +1270,15 @@ public function countAuthenticatedSessionsRequest($start_date = null, $end_date * @param \DateTime $end_date end_date (required) * @param string $transaction_type transaction_type (optional) * @param string $segment_type segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDistinctRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countDistinctRedemptions($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function countDistinctRedemptions($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['countDistinctRedemptions'][0]) { - list($response) = $this->countDistinctRedemptionsWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type); + list($response) = $this->countDistinctRedemptionsWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type, $contentType); return $response; } @@ -881,14 +1291,15 @@ public function countDistinctRedemptions($start_date, $end_date, $transaction_ty * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDistinctRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countDistinctRedemptionsWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function countDistinctRedemptionsWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['countDistinctRedemptions'][0]) { - $request = $this->countDistinctRedemptionsRequest($start_date, $end_date, $transaction_type, $segment_type); + $request = $this->countDistinctRedemptionsRequest($start_date, $end_date, $transaction_type, $segment_type, $contentType); try { $options = $this->createHttpClientOption(); @@ -931,6 +1342,21 @@ public function countDistinctRedemptionsWithHttpInfo($start_date, $end_date, $tr $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -943,6 +1369,21 @@ public function countDistinctRedemptionsWithHttpInfo($start_date, $end_date, $tr $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -955,6 +1396,21 @@ public function countDistinctRedemptionsWithHttpInfo($start_date, $end_date, $tr $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -967,6 +1423,21 @@ public function countDistinctRedemptionsWithHttpInfo($start_date, $end_date, $tr $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -981,6 +1452,21 @@ public function countDistinctRedemptionsWithHttpInfo($start_date, $end_date, $tr $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1037,13 +1523,14 @@ public function countDistinctRedemptionsWithHttpInfo($start_date, $end_date, $tr * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDistinctRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countDistinctRedemptionsAsync($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function countDistinctRedemptionsAsync($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['countDistinctRedemptions'][0]) { - return $this->countDistinctRedemptionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type) + return $this->countDistinctRedemptionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type, $contentType) ->then( function ($response) { return $response[0]; @@ -1060,14 +1547,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDistinctRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countDistinctRedemptionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function countDistinctRedemptionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['countDistinctRedemptions'][0]) { $returnType = 'mixed'; - $request = $this->countDistinctRedemptionsRequest($start_date, $end_date, $transaction_type, $segment_type); + $request = $this->countDistinctRedemptionsRequest($start_date, $end_date, $transaction_type, $segment_type, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1077,6 +1565,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1109,18 +1600,21 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDistinctRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countDistinctRedemptionsRequest($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function countDistinctRedemptionsRequest($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['countDistinctRedemptions'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling countDistinctRedemptions' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -1128,6 +1622,9 @@ public function countDistinctRedemptionsRequest($start_date, $end_date, $transac ); } + + + $resourcePath = '/v2/analytics/ledger/paymentObject/distinct/count'; $formParams = []; $queryParams = []; @@ -1136,63 +1633,50 @@ public function countDistinctRedemptionsRequest($start_date, $end_date, $transac $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($transaction_type !== null) { - if('form' === 'form' && is_array($transaction_type)) { - foreach($transaction_type as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['transactionType'] = $transaction_type; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $transaction_type, + 'transactionType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($segment_type !== null) { - if('form' === 'form' && is_array($segment_type)) { - foreach($segment_type as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['segmentType'] = $segment_type; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $segment_type, + 'segmentType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1210,12 +1694,12 @@ public function countDistinctRedemptionsRequest($start_date, $end_date, $transac // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1231,10 +1715,11 @@ public function countDistinctRedemptionsRequest($start_date, $end_date, $transac $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1250,14 +1735,15 @@ public function countDistinctRedemptionsRequest($start_date, $end_date, $transac * @param string $locale locale (required) * @param string $timezone timezone (required) * @param bool $is_resolved is_resolved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countHelpDeskRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countHelpDeskRequests($start_date, $end_date, $locale, $timezone, $is_resolved = null) + public function countHelpDeskRequests($start_date, $end_date, $locale, $timezone, $is_resolved = null, string $contentType = self::contentTypes['countHelpDeskRequests'][0]) { - list($response) = $this->countHelpDeskRequestsWithHttpInfo($start_date, $end_date, $locale, $timezone, $is_resolved); + list($response) = $this->countHelpDeskRequestsWithHttpInfo($start_date, $end_date, $locale, $timezone, $is_resolved, $contentType); return $response; } @@ -1271,14 +1757,15 @@ public function countHelpDeskRequests($start_date, $end_date, $locale, $timezone * @param string $locale (required) * @param string $timezone (required) * @param bool $is_resolved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countHelpDeskRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countHelpDeskRequestsWithHttpInfo($start_date, $end_date, $locale, $timezone, $is_resolved = null) + public function countHelpDeskRequestsWithHttpInfo($start_date, $end_date, $locale, $timezone, $is_resolved = null, string $contentType = self::contentTypes['countHelpDeskRequests'][0]) { - $request = $this->countHelpDeskRequestsRequest($start_date, $end_date, $locale, $timezone, $is_resolved); + $request = $this->countHelpDeskRequestsRequest($start_date, $end_date, $locale, $timezone, $is_resolved, $contentType); try { $options = $this->createHttpClientOption(); @@ -1321,6 +1808,21 @@ public function countHelpDeskRequestsWithHttpInfo($start_date, $end_date, $local $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1333,6 +1835,21 @@ public function countHelpDeskRequestsWithHttpInfo($start_date, $end_date, $local $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1345,6 +1862,21 @@ public function countHelpDeskRequestsWithHttpInfo($start_date, $end_date, $local $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1357,6 +1889,21 @@ public function countHelpDeskRequestsWithHttpInfo($start_date, $end_date, $local $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1371,6 +1918,21 @@ public function countHelpDeskRequestsWithHttpInfo($start_date, $end_date, $local $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1428,13 +1990,14 @@ public function countHelpDeskRequestsWithHttpInfo($start_date, $end_date, $local * @param string $locale (required) * @param string $timezone (required) * @param bool $is_resolved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countHelpDeskRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countHelpDeskRequestsAsync($start_date, $end_date, $locale, $timezone, $is_resolved = null) + public function countHelpDeskRequestsAsync($start_date, $end_date, $locale, $timezone, $is_resolved = null, string $contentType = self::contentTypes['countHelpDeskRequests'][0]) { - return $this->countHelpDeskRequestsAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $is_resolved) + return $this->countHelpDeskRequestsAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $is_resolved, $contentType) ->then( function ($response) { return $response[0]; @@ -1452,14 +2015,15 @@ function ($response) { * @param string $locale (required) * @param string $timezone (required) * @param bool $is_resolved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countHelpDeskRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countHelpDeskRequestsAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $is_resolved = null) + public function countHelpDeskRequestsAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $is_resolved = null, string $contentType = self::contentTypes['countHelpDeskRequests'][0]) { $returnType = 'mixed'; - $request = $this->countHelpDeskRequestsRequest($start_date, $end_date, $locale, $timezone, $is_resolved); + $request = $this->countHelpDeskRequestsRequest($start_date, $end_date, $locale, $timezone, $is_resolved, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1469,6 +2033,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1502,30 +2069,35 @@ function ($exception) { * @param string $locale (required) * @param string $timezone (required) * @param bool $is_resolved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countHelpDeskRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countHelpDeskRequestsRequest($start_date, $end_date, $locale, $timezone, $is_resolved = null) + public function countHelpDeskRequestsRequest($start_date, $end_date, $locale, $timezone, $is_resolved = null, string $contentType = self::contentTypes['countHelpDeskRequests'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling countHelpDeskRequests' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling countHelpDeskRequests' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling countHelpDeskRequests' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -1533,6 +2105,8 @@ public function countHelpDeskRequestsRequest($start_date, $end_date, $locale, $t ); } + + $resourcePath = '/v2/analytics/helpdeskrequests/count'; $formParams = []; $queryParams = []; @@ -1541,74 +2115,59 @@ public function countHelpDeskRequestsRequest($start_date, $end_date, $locale, $t $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($is_resolved !== null) { - if('form' === 'form' && is_array($is_resolved)) { - foreach($is_resolved as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isResolved'] = $is_resolved; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_resolved, + 'isResolved', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1626,12 +2185,12 @@ public function countHelpDeskRequestsRequest($start_date, $end_date, $locale, $t // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1647,10 +2206,11 @@ public function countHelpDeskRequestsRequest($start_date, $end_date, $locale, $t $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1663,14 +2223,15 @@ public function countHelpDeskRequestsRequest($start_date, $end_date, $locale, $t * * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countInboundMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countInboundMessages($start_date = null, $end_date = null) + public function countInboundMessages($start_date = null, $end_date = null, string $contentType = self::contentTypes['countInboundMessages'][0]) { - list($response) = $this->countInboundMessagesWithHttpInfo($start_date, $end_date); + list($response) = $this->countInboundMessagesWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -1681,14 +2242,15 @@ public function countInboundMessages($start_date = null, $end_date = null) * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countInboundMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countInboundMessagesWithHttpInfo($start_date = null, $end_date = null) + public function countInboundMessagesWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['countInboundMessages'][0]) { - $request = $this->countInboundMessagesRequest($start_date, $end_date); + $request = $this->countInboundMessagesRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -1731,6 +2293,21 @@ public function countInboundMessagesWithHttpInfo($start_date = null, $end_date = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1743,6 +2320,21 @@ public function countInboundMessagesWithHttpInfo($start_date = null, $end_date = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1755,6 +2347,21 @@ public function countInboundMessagesWithHttpInfo($start_date = null, $end_date = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1767,6 +2374,21 @@ public function countInboundMessagesWithHttpInfo($start_date = null, $end_date = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1781,6 +2403,21 @@ public function countInboundMessagesWithHttpInfo($start_date = null, $end_date = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1835,13 +2472,14 @@ public function countInboundMessagesWithHttpInfo($start_date = null, $end_date = * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countInboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countInboundMessagesAsync($start_date = null, $end_date = null) + public function countInboundMessagesAsync($start_date = null, $end_date = null, string $contentType = self::contentTypes['countInboundMessages'][0]) { - return $this->countInboundMessagesAsyncWithHttpInfo($start_date, $end_date) + return $this->countInboundMessagesAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -1856,14 +2494,15 @@ function ($response) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countInboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countInboundMessagesAsyncWithHttpInfo($start_date = null, $end_date = null) + public function countInboundMessagesAsyncWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['countInboundMessages'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countInboundMessagesRequest($start_date, $end_date); + $request = $this->countInboundMessagesRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1873,6 +2512,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1903,13 +2545,17 @@ function ($exception) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countInboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countInboundMessagesRequest($start_date = null, $end_date = null) + public function countInboundMessagesRequest($start_date = null, $end_date = null, string $contentType = self::contentTypes['countInboundMessages'][0]) { + + + $resourcePath = '/v2/analytics/sms/inbound/count'; $formParams = []; $queryParams = []; @@ -1918,41 +2564,32 @@ public function countInboundMessagesRequest($start_date = null, $end_date = null $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1970,12 +2607,12 @@ public function countInboundMessagesRequest($start_date = null, $end_date = null // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1991,10 +2628,11 @@ public function countInboundMessagesRequest($start_date = null, $end_date = null $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2007,14 +2645,15 @@ public function countInboundMessagesRequest($start_date = null, $end_date = null * * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countNewSessions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countNewSessions($start_date = null, $end_date = null) + public function countNewSessions($start_date = null, $end_date = null, string $contentType = self::contentTypes['countNewSessions'][0]) { - list($response) = $this->countNewSessionsWithHttpInfo($start_date, $end_date); + list($response) = $this->countNewSessionsWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -2025,14 +2664,15 @@ public function countNewSessions($start_date = null, $end_date = null) * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countNewSessions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countNewSessionsWithHttpInfo($start_date = null, $end_date = null) + public function countNewSessionsWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['countNewSessions'][0]) { - $request = $this->countNewSessionsRequest($start_date, $end_date); + $request = $this->countNewSessionsRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -2075,6 +2715,21 @@ public function countNewSessionsWithHttpInfo($start_date = null, $end_date = nul $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2087,6 +2742,21 @@ public function countNewSessionsWithHttpInfo($start_date = null, $end_date = nul $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2099,6 +2769,21 @@ public function countNewSessionsWithHttpInfo($start_date = null, $end_date = nul $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2111,6 +2796,21 @@ public function countNewSessionsWithHttpInfo($start_date = null, $end_date = nul $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2125,6 +2825,21 @@ public function countNewSessionsWithHttpInfo($start_date = null, $end_date = nul $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2179,13 +2894,14 @@ public function countNewSessionsWithHttpInfo($start_date = null, $end_date = nul * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countNewSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countNewSessionsAsync($start_date = null, $end_date = null) + public function countNewSessionsAsync($start_date = null, $end_date = null, string $contentType = self::contentTypes['countNewSessions'][0]) { - return $this->countNewSessionsAsyncWithHttpInfo($start_date, $end_date) + return $this->countNewSessionsAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -2200,14 +2916,15 @@ function ($response) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countNewSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countNewSessionsAsyncWithHttpInfo($start_date = null, $end_date = null) + public function countNewSessionsAsyncWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['countNewSessions'][0]) { $returnType = 'mixed'; - $request = $this->countNewSessionsRequest($start_date, $end_date); + $request = $this->countNewSessionsRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2217,6 +2934,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2247,13 +2967,17 @@ function ($exception) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countNewSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countNewSessionsRequest($start_date = null, $end_date = null) + public function countNewSessionsRequest($start_date = null, $end_date = null, string $contentType = self::contentTypes['countNewSessions'][0]) { + + + $resourcePath = '/v2/analytics/walletPageViews/sessions/count/distinct/first'; $formParams = []; $queryParams = []; @@ -2262,41 +2986,32 @@ public function countNewSessionsRequest($start_date = null, $end_date = null) $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2314,12 +3029,12 @@ public function countNewSessionsRequest($start_date = null, $end_date = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2335,10 +3050,11 @@ public function countNewSessionsRequest($start_date = null, $end_date = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2351,14 +3067,15 @@ public function countNewSessionsRequest($start_date = null, $end_date = null) * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInListSubscribersPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countOptInListSubscribersPartitionedByDate($start_date, $end_date) + public function countOptInListSubscribersPartitionedByDate($start_date, $end_date, string $contentType = self::contentTypes['countOptInListSubscribersPartitionedByDate'][0]) { - list($response) = $this->countOptInListSubscribersPartitionedByDateWithHttpInfo($start_date, $end_date); + list($response) = $this->countOptInListSubscribersPartitionedByDateWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -2369,14 +3086,15 @@ public function countOptInListSubscribersPartitionedByDate($start_date, $end_dat * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInListSubscribersPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countOptInListSubscribersPartitionedByDateWithHttpInfo($start_date, $end_date) + public function countOptInListSubscribersPartitionedByDateWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['countOptInListSubscribersPartitionedByDate'][0]) { - $request = $this->countOptInListSubscribersPartitionedByDateRequest($start_date, $end_date); + $request = $this->countOptInListSubscribersPartitionedByDateRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -2419,6 +3137,21 @@ public function countOptInListSubscribersPartitionedByDateWithHttpInfo($start_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2431,6 +3164,21 @@ public function countOptInListSubscribersPartitionedByDateWithHttpInfo($start_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2443,6 +3191,21 @@ public function countOptInListSubscribersPartitionedByDateWithHttpInfo($start_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2455,6 +3218,21 @@ public function countOptInListSubscribersPartitionedByDateWithHttpInfo($start_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2469,6 +3247,21 @@ public function countOptInListSubscribersPartitionedByDateWithHttpInfo($start_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2523,13 +3316,14 @@ public function countOptInListSubscribersPartitionedByDateWithHttpInfo($start_da * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInListSubscribersPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countOptInListSubscribersPartitionedByDateAsync($start_date, $end_date) + public function countOptInListSubscribersPartitionedByDateAsync($start_date, $end_date, string $contentType = self::contentTypes['countOptInListSubscribersPartitionedByDate'][0]) { - return $this->countOptInListSubscribersPartitionedByDateAsyncWithHttpInfo($start_date, $end_date) + return $this->countOptInListSubscribersPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -2544,14 +3338,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInListSubscribersPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countOptInListSubscribersPartitionedByDateAsyncWithHttpInfo($start_date, $end_date) + public function countOptInListSubscribersPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['countOptInListSubscribersPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->countOptInListSubscribersPartitionedByDateRequest($start_date, $end_date); + $request = $this->countOptInListSubscribersPartitionedByDateRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2561,6 +3356,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2591,18 +3389,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInListSubscribersPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countOptInListSubscribersPartitionedByDateRequest($start_date, $end_date) + public function countOptInListSubscribersPartitionedByDateRequest($start_date, $end_date, string $contentType = self::contentTypes['countOptInListSubscribersPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling countOptInListSubscribersPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -2610,6 +3411,7 @@ public function countOptInListSubscribersPartitionedByDateRequest($start_date, $ ); } + $resourcePath = '/v2/analytics/sms/all/subscribers/count/date'; $formParams = []; $queryParams = []; @@ -2618,41 +3420,32 @@ public function countOptInListSubscribersPartitionedByDateRequest($start_date, $ $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2670,12 +3463,12 @@ public function countOptInListSubscribersPartitionedByDateRequest($start_date, $ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2691,10 +3484,11 @@ public function countOptInListSubscribersPartitionedByDateRequest($start_date, $ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2707,14 +3501,15 @@ public function countOptInListSubscribersPartitionedByDateRequest($start_date, $ * * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOutboundMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countOutboundMessages($start_date = null, $end_date = null) + public function countOutboundMessages($start_date = null, $end_date = null, string $contentType = self::contentTypes['countOutboundMessages'][0]) { - list($response) = $this->countOutboundMessagesWithHttpInfo($start_date, $end_date); + list($response) = $this->countOutboundMessagesWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -2725,14 +3520,15 @@ public function countOutboundMessages($start_date = null, $end_date = null) * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOutboundMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countOutboundMessagesWithHttpInfo($start_date = null, $end_date = null) + public function countOutboundMessagesWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['countOutboundMessages'][0]) { - $request = $this->countOutboundMessagesRequest($start_date, $end_date); + $request = $this->countOutboundMessagesRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -2775,6 +3571,21 @@ public function countOutboundMessagesWithHttpInfo($start_date = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2787,6 +3598,21 @@ public function countOutboundMessagesWithHttpInfo($start_date = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2799,6 +3625,21 @@ public function countOutboundMessagesWithHttpInfo($start_date = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2811,6 +3652,21 @@ public function countOutboundMessagesWithHttpInfo($start_date = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2825,6 +3681,21 @@ public function countOutboundMessagesWithHttpInfo($start_date = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2879,13 +3750,14 @@ public function countOutboundMessagesWithHttpInfo($start_date = null, $end_date * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOutboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countOutboundMessagesAsync($start_date = null, $end_date = null) + public function countOutboundMessagesAsync($start_date = null, $end_date = null, string $contentType = self::contentTypes['countOutboundMessages'][0]) { - return $this->countOutboundMessagesAsyncWithHttpInfo($start_date, $end_date) + return $this->countOutboundMessagesAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -2900,14 +3772,15 @@ function ($response) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOutboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countOutboundMessagesAsyncWithHttpInfo($start_date = null, $end_date = null) + public function countOutboundMessagesAsyncWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['countOutboundMessages'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countOutboundMessagesRequest($start_date, $end_date); + $request = $this->countOutboundMessagesRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2917,6 +3790,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2947,13 +3823,17 @@ function ($exception) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOutboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countOutboundMessagesRequest($start_date = null, $end_date = null) + public function countOutboundMessagesRequest($start_date = null, $end_date = null, string $contentType = self::contentTypes['countOutboundMessages'][0]) { + + + $resourcePath = '/v2/analytics/sms/outbound/count'; $formParams = []; $queryParams = []; @@ -2962,41 +3842,32 @@ public function countOutboundMessagesRequest($start_date = null, $end_date = nul $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3014,12 +3885,12 @@ public function countOutboundMessagesRequest($start_date = null, $end_date = nul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3035,10 +3906,11 @@ public function countOutboundMessagesRequest($start_date = null, $end_date = nul $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3051,14 +3923,15 @@ public function countOutboundMessagesRequest($start_date = null, $end_date = nul * * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countTotalSessions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countTotalSessions($start_date = null, $end_date = null) + public function countTotalSessions($start_date = null, $end_date = null, string $contentType = self::contentTypes['countTotalSessions'][0]) { - list($response) = $this->countTotalSessionsWithHttpInfo($start_date, $end_date); + list($response) = $this->countTotalSessionsWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -3069,14 +3942,15 @@ public function countTotalSessions($start_date = null, $end_date = null) * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countTotalSessions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countTotalSessionsWithHttpInfo($start_date = null, $end_date = null) + public function countTotalSessionsWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['countTotalSessions'][0]) { - $request = $this->countTotalSessionsRequest($start_date, $end_date); + $request = $this->countTotalSessionsRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -3119,6 +3993,21 @@ public function countTotalSessionsWithHttpInfo($start_date = null, $end_date = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3131,6 +4020,21 @@ public function countTotalSessionsWithHttpInfo($start_date = null, $end_date = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3143,6 +4047,21 @@ public function countTotalSessionsWithHttpInfo($start_date = null, $end_date = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3155,6 +4074,21 @@ public function countTotalSessionsWithHttpInfo($start_date = null, $end_date = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3169,6 +4103,21 @@ public function countTotalSessionsWithHttpInfo($start_date = null, $end_date = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3223,13 +4172,14 @@ public function countTotalSessionsWithHttpInfo($start_date = null, $end_date = n * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countTotalSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countTotalSessionsAsync($start_date = null, $end_date = null) + public function countTotalSessionsAsync($start_date = null, $end_date = null, string $contentType = self::contentTypes['countTotalSessions'][0]) { - return $this->countTotalSessionsAsyncWithHttpInfo($start_date, $end_date) + return $this->countTotalSessionsAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -3244,14 +4194,15 @@ function ($response) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countTotalSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countTotalSessionsAsyncWithHttpInfo($start_date = null, $end_date = null) + public function countTotalSessionsAsyncWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['countTotalSessions'][0]) { $returnType = 'mixed'; - $request = $this->countTotalSessionsRequest($start_date, $end_date); + $request = $this->countTotalSessionsRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3261,6 +4212,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3291,13 +4245,17 @@ function ($exception) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countTotalSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countTotalSessionsRequest($start_date = null, $end_date = null) + public function countTotalSessionsRequest($start_date = null, $end_date = null, string $contentType = self::contentTypes['countTotalSessions'][0]) { + + + $resourcePath = '/v2/analytics/walletPageViews/sessions/count/distinct'; $formParams = []; $queryParams = []; @@ -3306,41 +4264,32 @@ public function countTotalSessionsRequest($start_date = null, $end_date = null) $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3358,12 +4307,12 @@ public function countTotalSessionsRequest($start_date = null, $end_date = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3379,10 +4328,11 @@ public function countTotalSessionsRequest($start_date = null, $end_date = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3397,14 +4347,15 @@ public function countTotalSessionsRequest($start_date = null, $end_date = null) * @param \DateTime $end_date end_date (required) * @param string $transaction_type transaction_type (optional) * @param string $segment_type segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countTransactions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countTransactions($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function countTransactions($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['countTransactions'][0]) { - list($response) = $this->countTransactionsWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type); + list($response) = $this->countTransactionsWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type, $contentType); return $response; } @@ -3417,14 +4368,15 @@ public function countTransactions($start_date, $end_date, $transaction_type = nu * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countTransactions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countTransactionsWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function countTransactionsWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['countTransactions'][0]) { - $request = $this->countTransactionsRequest($start_date, $end_date, $transaction_type, $segment_type); + $request = $this->countTransactionsRequest($start_date, $end_date, $transaction_type, $segment_type, $contentType); try { $options = $this->createHttpClientOption(); @@ -3467,6 +4419,21 @@ public function countTransactionsWithHttpInfo($start_date, $end_date, $transacti $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3479,6 +4446,21 @@ public function countTransactionsWithHttpInfo($start_date, $end_date, $transacti $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3491,6 +4473,21 @@ public function countTransactionsWithHttpInfo($start_date, $end_date, $transacti $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3503,6 +4500,21 @@ public function countTransactionsWithHttpInfo($start_date, $end_date, $transacti $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3517,6 +4529,21 @@ public function countTransactionsWithHttpInfo($start_date, $end_date, $transacti $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3573,13 +4600,14 @@ public function countTransactionsWithHttpInfo($start_date, $end_date, $transacti * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countTransactions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countTransactionsAsync($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function countTransactionsAsync($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['countTransactions'][0]) { - return $this->countTransactionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type) + return $this->countTransactionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type, $contentType) ->then( function ($response) { return $response[0]; @@ -3596,14 +4624,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countTransactions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countTransactionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function countTransactionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['countTransactions'][0]) { $returnType = 'mixed'; - $request = $this->countTransactionsRequest($start_date, $end_date, $transaction_type, $segment_type); + $request = $this->countTransactionsRequest($start_date, $end_date, $transaction_type, $segment_type, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3613,6 +4642,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3645,18 +4677,21 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countTransactions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countTransactionsRequest($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function countTransactionsRequest($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['countTransactions'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling countTransactions' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -3664,6 +4699,9 @@ public function countTransactionsRequest($start_date, $end_date, $transaction_ty ); } + + + $resourcePath = '/v2/analytics/ledger/transactions/count'; $formParams = []; $queryParams = []; @@ -3672,63 +4710,50 @@ public function countTransactionsRequest($start_date, $end_date, $transaction_ty $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($transaction_type !== null) { - if('form' === 'form' && is_array($transaction_type)) { - foreach($transaction_type as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['transactionType'] = $transaction_type; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $transaction_type, + 'transactionType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($segment_type !== null) { - if('form' === 'form' && is_array($segment_type)) { - foreach($segment_type as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['segmentType'] = $segment_type; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $segment_type, + 'segmentType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3746,12 +4771,12 @@ public function countTransactionsRequest($start_date, $end_date, $transaction_ty // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3767,10 +4792,11 @@ public function countTransactionsRequest($start_date, $end_date, $transaction_ty $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3783,14 +4809,15 @@ public function countTransactionsRequest($start_date, $end_date, $transaction_ty * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVerifiedWalletPageViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTWalletObjectPrefixCounts[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countVerifiedWalletPageViews($start_date, $end_date) + public function countVerifiedWalletPageViews($start_date, $end_date, string $contentType = self::contentTypes['countVerifiedWalletPageViews'][0]) { - list($response) = $this->countVerifiedWalletPageViewsWithHttpInfo($start_date, $end_date); + list($response) = $this->countVerifiedWalletPageViewsWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -3801,14 +4828,15 @@ public function countVerifiedWalletPageViews($start_date, $end_date) * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVerifiedWalletPageViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTWalletObjectPrefixCounts[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countVerifiedWalletPageViewsWithHttpInfo($start_date, $end_date) + public function countVerifiedWalletPageViewsWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['countVerifiedWalletPageViews'][0]) { - $request = $this->countVerifiedWalletPageViewsRequest($start_date, $end_date); + $request = $this->countVerifiedWalletPageViewsRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -3851,6 +4879,21 @@ public function countVerifiedWalletPageViewsWithHttpInfo($start_date, $end_date) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTWalletObjectPrefixCounts[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3863,6 +4906,21 @@ public function countVerifiedWalletPageViewsWithHttpInfo($start_date, $end_date) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3875,6 +4933,21 @@ public function countVerifiedWalletPageViewsWithHttpInfo($start_date, $end_date) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3887,6 +4960,21 @@ public function countVerifiedWalletPageViewsWithHttpInfo($start_date, $end_date) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3901,6 +4989,21 @@ public function countVerifiedWalletPageViewsWithHttpInfo($start_date, $end_date) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3955,13 +5058,14 @@ public function countVerifiedWalletPageViewsWithHttpInfo($start_date, $end_date) * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVerifiedWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countVerifiedWalletPageViewsAsync($start_date, $end_date) + public function countVerifiedWalletPageViewsAsync($start_date, $end_date, string $contentType = self::contentTypes['countVerifiedWalletPageViews'][0]) { - return $this->countVerifiedWalletPageViewsAsyncWithHttpInfo($start_date, $end_date) + return $this->countVerifiedWalletPageViewsAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -3976,14 +5080,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVerifiedWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countVerifiedWalletPageViewsAsyncWithHttpInfo($start_date, $end_date) + public function countVerifiedWalletPageViewsAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['countVerifiedWalletPageViews'][0]) { $returnType = '\OpenAPI\Client\Model\WTWalletObjectPrefixCounts[]'; - $request = $this->countVerifiedWalletPageViewsRequest($start_date, $end_date); + $request = $this->countVerifiedWalletPageViewsRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3993,6 +5098,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4023,18 +5131,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVerifiedWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countVerifiedWalletPageViewsRequest($start_date, $end_date) + public function countVerifiedWalletPageViewsRequest($start_date, $end_date, string $contentType = self::contentTypes['countVerifiedWalletPageViews'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling countVerifiedWalletPageViews' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -4042,6 +5153,7 @@ public function countVerifiedWalletPageViewsRequest($start_date, $end_date) ); } + $resourcePath = '/v2/analytics/walletPageViews/sessions/verified/distinct/walletObjectsCount'; $formParams = []; $queryParams = []; @@ -4050,41 +5162,32 @@ public function countVerifiedWalletPageViewsRequest($start_date, $end_date) $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4102,12 +5205,12 @@ public function countVerifiedWalletPageViewsRequest($start_date, $end_date) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4123,10 +5226,11 @@ public function countVerifiedWalletPageViewsRequest($start_date, $end_date) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4139,14 +5243,15 @@ public function countVerifiedWalletPageViewsRequest($start_date, $end_date) * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countWalletPageViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTWalletObjectPrefixCounts[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countWalletPageViews($start_date, $end_date) + public function countWalletPageViews($start_date, $end_date, string $contentType = self::contentTypes['countWalletPageViews'][0]) { - list($response) = $this->countWalletPageViewsWithHttpInfo($start_date, $end_date); + list($response) = $this->countWalletPageViewsWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -4157,14 +5262,15 @@ public function countWalletPageViews($start_date, $end_date) * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countWalletPageViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTWalletObjectPrefixCounts[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countWalletPageViewsWithHttpInfo($start_date, $end_date) + public function countWalletPageViewsWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['countWalletPageViews'][0]) { - $request = $this->countWalletPageViewsRequest($start_date, $end_date); + $request = $this->countWalletPageViewsRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -4207,6 +5313,21 @@ public function countWalletPageViewsWithHttpInfo($start_date, $end_date) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTWalletObjectPrefixCounts[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4219,6 +5340,21 @@ public function countWalletPageViewsWithHttpInfo($start_date, $end_date) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4231,6 +5367,21 @@ public function countWalletPageViewsWithHttpInfo($start_date, $end_date) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4243,6 +5394,21 @@ public function countWalletPageViewsWithHttpInfo($start_date, $end_date) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4257,6 +5423,21 @@ public function countWalletPageViewsWithHttpInfo($start_date, $end_date) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4311,13 +5492,14 @@ public function countWalletPageViewsWithHttpInfo($start_date, $end_date) * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countWalletPageViewsAsync($start_date, $end_date) + public function countWalletPageViewsAsync($start_date, $end_date, string $contentType = self::contentTypes['countWalletPageViews'][0]) { - return $this->countWalletPageViewsAsyncWithHttpInfo($start_date, $end_date) + return $this->countWalletPageViewsAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -4332,14 +5514,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countWalletPageViewsAsyncWithHttpInfo($start_date, $end_date) + public function countWalletPageViewsAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['countWalletPageViews'][0]) { $returnType = '\OpenAPI\Client\Model\WTWalletObjectPrefixCounts[]'; - $request = $this->countWalletPageViewsRequest($start_date, $end_date); + $request = $this->countWalletPageViewsRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4349,6 +5532,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4379,18 +5565,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countWalletPageViewsRequest($start_date, $end_date) + public function countWalletPageViewsRequest($start_date, $end_date, string $contentType = self::contentTypes['countWalletPageViews'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling countWalletPageViews' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -4398,6 +5587,7 @@ public function countWalletPageViewsRequest($start_date, $end_date) ); } + $resourcePath = '/v2/analytics/walletPageViews/sessions/distinct/walletObjectsCount'; $formParams = []; $queryParams = []; @@ -4406,41 +5596,32 @@ public function countWalletPageViewsRequest($start_date, $end_date) $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4458,12 +5639,12 @@ public function countWalletPageViewsRequest($start_date, $end_date) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4479,10 +5660,11 @@ public function countWalletPageViewsRequest($start_date, $end_date) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4495,14 +5677,15 @@ public function countWalletPageViewsRequest($start_date, $end_date) * * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exitLinkSummary'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function exitLinkSummary($start_date = null, $end_date = null) + public function exitLinkSummary($start_date = null, $end_date = null, string $contentType = self::contentTypes['exitLinkSummary'][0]) { - list($response) = $this->exitLinkSummaryWithHttpInfo($start_date, $end_date); + list($response) = $this->exitLinkSummaryWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -4513,14 +5696,15 @@ public function exitLinkSummary($start_date = null, $end_date = null) * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exitLinkSummary'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function exitLinkSummaryWithHttpInfo($start_date = null, $end_date = null) + public function exitLinkSummaryWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['exitLinkSummary'][0]) { - $request = $this->exitLinkSummaryRequest($start_date, $end_date); + $request = $this->exitLinkSummaryRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -4563,6 +5747,21 @@ public function exitLinkSummaryWithHttpInfo($start_date = null, $end_date = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4575,6 +5774,21 @@ public function exitLinkSummaryWithHttpInfo($start_date = null, $end_date = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4587,6 +5801,21 @@ public function exitLinkSummaryWithHttpInfo($start_date = null, $end_date = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4599,6 +5828,21 @@ public function exitLinkSummaryWithHttpInfo($start_date = null, $end_date = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4613,6 +5857,21 @@ public function exitLinkSummaryWithHttpInfo($start_date = null, $end_date = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4667,13 +5926,14 @@ public function exitLinkSummaryWithHttpInfo($start_date = null, $end_date = null * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exitLinkSummary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exitLinkSummaryAsync($start_date = null, $end_date = null) + public function exitLinkSummaryAsync($start_date = null, $end_date = null, string $contentType = self::contentTypes['exitLinkSummary'][0]) { - return $this->exitLinkSummaryAsyncWithHttpInfo($start_date, $end_date) + return $this->exitLinkSummaryAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -4688,14 +5948,15 @@ function ($response) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exitLinkSummary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exitLinkSummaryAsyncWithHttpInfo($start_date = null, $end_date = null) + public function exitLinkSummaryAsyncWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['exitLinkSummary'][0]) { $returnType = 'mixed'; - $request = $this->exitLinkSummaryRequest($start_date, $end_date); + $request = $this->exitLinkSummaryRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4705,6 +5966,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4735,13 +5999,17 @@ function ($exception) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exitLinkSummary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function exitLinkSummaryRequest($start_date = null, $end_date = null) + public function exitLinkSummaryRequest($start_date = null, $end_date = null, string $contentType = self::contentTypes['exitLinkSummary'][0]) { + + + $resourcePath = '/v2/analytics/walletPageViews/exitLinkSummary'; $formParams = []; $queryParams = []; @@ -4750,41 +6018,32 @@ public function exitLinkSummaryRequest($start_date = null, $end_date = null) $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4802,12 +6061,12 @@ public function exitLinkSummaryRequest($start_date = null, $end_date = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4823,10 +6082,11 @@ public function exitLinkSummaryRequest($start_date = null, $end_date = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4839,14 +6099,15 @@ public function exitLinkSummaryRequest($start_date = null, $end_date = null) * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsCountPartitionedByEmployee($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByEmployee($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByEmployee'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsAdCreditsCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -4857,14 +6118,15 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployee($start_date, $ * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByEmployee'][0]) { - $request = $this->fetchAnalyticsAdCreditsCountPartitionedByEmployeeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsCountPartitionedByEmployeeRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -4907,6 +6169,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeWithHttpInfo($s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4919,6 +6196,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeWithHttpInfo($s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4931,6 +6223,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeWithHttpInfo($s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4943,6 +6250,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeWithHttpInfo($s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4957,6 +6279,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeWithHttpInfo($s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5011,13 +6348,14 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeWithHttpInfo($s * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeAsync($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByEmployee'][0]) { - return $this->fetchAnalyticsAdCreditsCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsAdCreditsCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -5032,14 +6370,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByEmployee'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsAdCreditsCountPartitionedByEmployeeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsCountPartitionedByEmployeeRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5049,6 +6388,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5079,18 +6421,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeRequest($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByEmployee'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsCountPartitionedByEmployee' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -5098,6 +6443,7 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeRequest($start_ ); } + $resourcePath = '/v2/analytics/advertisementCredits/count/employee'; $formParams = []; $queryParams = []; @@ -5106,41 +6452,32 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeRequest($start_ $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5158,12 +6495,12 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeRequest($start_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5179,10 +6516,11 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeRequest($start_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5195,14 +6533,15 @@ public function fetchAnalyticsAdCreditsCountPartitionedByEmployeeRequest($start_ * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -5213,14 +6552,15 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign($start_da * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign'][0]) { - $request = $this->fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -5263,6 +6603,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignWithHttpIn $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5275,6 +6630,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignWithHttpIn $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5287,6 +6657,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignWithHttpIn $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5299,6 +6684,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignWithHttpIn $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5313,6 +6713,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignWithHttpIn $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5367,13 +6782,14 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignWithHttpIn * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignAsync($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign'][0]) { - return $this->fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -5388,14 +6804,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5405,6 +6822,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5435,18 +6855,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignRequest($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsCountPartitionedByPaymentDesign' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -5454,6 +6877,7 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignRequest($s ); } + $resourcePath = '/v2/analytics/advertisementCredits/count/paymentDesign'; $formParams = []; $queryParams = []; @@ -5462,41 +6886,32 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignRequest($s $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5514,12 +6929,12 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignRequest($s // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5535,10 +6950,11 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignRequest($s $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5551,14 +6967,15 @@ public function fetchAnalyticsAdCreditsCountPartitionedByPaymentDesignRequest($s * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByValueType'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsCountPartitionedByValueType($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByValueType($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByValueType'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsCountPartitionedByValueTypeWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsAdCreditsCountPartitionedByValueTypeWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -5569,14 +6986,15 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueType($start_date, * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByValueType'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByValueType'][0]) { - $request = $this->fetchAnalyticsAdCreditsCountPartitionedByValueTypeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsCountPartitionedByValueTypeRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -5619,6 +7037,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5631,6 +7064,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5643,6 +7091,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5655,6 +7118,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5669,6 +7147,21 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5723,13 +7216,14 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeWithHttpInfo($ * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByValueType'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeAsync($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByValueType'][0]) { - return $this->fetchAnalyticsAdCreditsCountPartitionedByValueTypeAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsAdCreditsCountPartitionedByValueTypeAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -5744,14 +7238,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByValueType'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByValueType'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsAdCreditsCountPartitionedByValueTypeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsCountPartitionedByValueTypeRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5761,6 +7256,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5791,18 +7289,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByValueType'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeRequest($start_date, $end_date) + public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsCountPartitionedByValueType'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsCountPartitionedByValueType' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -5810,6 +7311,7 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeRequest($start ); } + $resourcePath = '/v2/analytics/advertisementCredits/count/valueType'; $formParams = []; $queryParams = []; @@ -5818,41 +7320,32 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeRequest($start $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5870,12 +7363,12 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeRequest($start // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5891,10 +7384,11 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeRequest($start $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5907,14 +7401,15 @@ public function fetchAnalyticsAdCreditsCountPartitionedByValueTypeRequest($start * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID($start_date, $end_date) + public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -5925,14 +7420,15 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID( * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID'][0]) { - $request = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -5975,6 +7471,21 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5987,6 +7498,21 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5999,6 +7525,21 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6011,6 +7552,21 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6025,6 +7581,21 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6079,13 +7650,14 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDW * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDAsync($start_date, $end_date) + public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID'][0]) { - return $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -6100,14 +7672,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6117,6 +7690,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6147,18 +7723,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDRequest($start_date, $end_date) + public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -6166,6 +7745,7 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDR ); } + $resourcePath = '/v2/analytics/advertisementCredits/redemptions/amount/adCredit'; $formParams = []; $queryParams = []; @@ -6174,41 +7754,32 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDR $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6226,12 +7797,12 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDR // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6247,10 +7818,11 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDR $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6265,14 +7837,15 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByAdCreditIDR * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -6285,14 +7858,15 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate($start * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -6335,6 +7909,21 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6347,6 +7936,21 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6359,6 +7963,21 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6371,6 +7990,21 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6385,6 +8019,21 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6441,13 +8090,14 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateWithHtt * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate'][0]) { - return $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -6464,14 +8114,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6481,6 +8132,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6513,30 +8167,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -6544,6 +8203,7 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateRequest ); } + $resourcePath = '/v2/analytics/advertisementCredits/redemptions/amount/date'; $formParams = []; $queryParams = []; @@ -6552,63 +8212,50 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateRequest $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6626,12 +8273,12 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateRequest // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6647,10 +8294,11 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateRequest $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6663,14 +8311,15 @@ public function fetchAnalyticsAdCreditsRedemptionsAmountPartitionedByDateRequest * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID($start_date, $end_date) + public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -6681,14 +8330,15 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID($ * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID'][0]) { - $request = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -6731,6 +8381,21 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6743,6 +8408,21 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6755,6 +8435,21 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6767,6 +8462,21 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6781,6 +8491,21 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6835,13 +8560,14 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDWi * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDAsync($start_date, $end_date) + public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID'][0]) { - return $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -6856,14 +8582,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6873,6 +8600,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6903,18 +8633,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDRequest($start_date, $end_date) + public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -6922,6 +8655,7 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDRe ); } + $resourcePath = '/v2/analytics/advertisementCredits/redemptions/count/adCredit'; $formParams = []; $queryParams = []; @@ -6930,41 +8664,32 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDRe $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6982,12 +8707,12 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDRe // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7003,10 +8728,11 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDRe $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7021,14 +8747,15 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByAdCreditIDRe * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -7041,14 +8768,15 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate($start_ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -7091,6 +8819,21 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7103,6 +8846,21 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7115,6 +8873,21 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7127,6 +8900,21 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7141,6 +8929,21 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7197,13 +9000,14 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateWithHttp * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -7220,14 +9024,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7237,6 +9042,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7269,30 +9077,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -7300,6 +9113,7 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateRequest( ); } + $resourcePath = '/v2/analytics/advertisementCredits/redemptions/count/date'; $formParams = []; $queryParams = []; @@ -7308,63 +9122,50 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateRequest( $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -7382,12 +9183,12 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateRequest( // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7403,10 +9204,11 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateRequest( $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7419,14 +9221,15 @@ public function fetchAnalyticsAdCreditsRedemptionsCountPartitionedByDateRequest( * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID($start_date, $end_date) + public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -7437,14 +9240,15 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID($sta * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID'][0]) { - $request = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -7487,6 +9291,21 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7499,6 +9318,21 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7511,6 +9345,21 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7523,6 +9372,21 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7537,6 +9401,21 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7591,13 +9470,14 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDWithH * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDAsync($start_date, $end_date) + public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID'][0]) { - return $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -7612,14 +9492,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7629,6 +9510,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7659,18 +9543,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDRequest($start_date, $end_date) + public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -7678,6 +9565,7 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDReque ); } + $resourcePath = '/v2/analytics/advertisementCredits/refunds/amount/adCredit'; $formParams = []; $queryParams = []; @@ -7686,41 +9574,32 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDReque $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -7738,12 +9617,12 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDReque // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7759,10 +9638,11 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDReque $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7777,14 +9657,15 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByAdCreditIDReque * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -7797,14 +9678,15 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate($start_dat * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -7847,6 +9729,21 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7859,6 +9756,21 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7871,6 +9783,21 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7883,6 +9810,21 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7897,6 +9839,21 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7953,13 +9910,14 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateWithHttpInf * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate'][0]) { - return $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -7976,14 +9934,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7993,6 +9952,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8025,30 +9987,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsAdCreditsRefundsAmountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -8056,6 +10023,7 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateRequest($st ); } + $resourcePath = '/v2/analytics/advertisementCredits/refunds/amount/date'; $formParams = []; $queryParams = []; @@ -8064,63 +10032,50 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateRequest($st $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -8138,12 +10093,12 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateRequest($st // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8159,10 +10114,11 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateRequest($st $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8175,14 +10131,15 @@ public function fetchAnalyticsAdCreditsRefundsAmountPartitionedByDateRequest($st * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID($start_date, $end_date) + public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -8193,14 +10150,15 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID($star * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID'][0]) { - $request = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -8243,6 +10201,21 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8255,6 +10228,21 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8267,6 +10255,21 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8279,6 +10282,21 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8293,6 +10311,21 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8347,13 +10380,14 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDWithHt * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDAsync($start_date, $end_date) + public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID'][0]) { - return $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -8368,14 +10402,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8385,6 +10420,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8415,18 +10453,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDRequest($start_date, $end_date) + public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -8434,6 +10475,7 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDReques ); } + $resourcePath = '/v2/analytics/advertisementCredits/refunds/count/adCredit'; $formParams = []; $queryParams = []; @@ -8442,41 +10484,32 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDReques $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -8494,12 +10527,12 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDReques // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8515,10 +10548,11 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDReques $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8533,14 +10567,15 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByAdCreditIDReques * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -8553,14 +10588,15 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDate($start_date * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -8603,6 +10639,21 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateWithHttpInfo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8615,6 +10666,21 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateWithHttpInfo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8627,6 +10693,21 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateWithHttpInfo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8639,6 +10720,21 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateWithHttpInfo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8653,6 +10749,21 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateWithHttpInfo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8709,13 +10820,14 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateWithHttpInfo * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -8732,14 +10844,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsAdCreditsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8749,6 +10862,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8781,30 +10897,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsRefundsCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsRefundsCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsAdCreditsRefundsCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsAdCreditsRefundsCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -8812,6 +10933,7 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateRequest($sta ); } + $resourcePath = '/v2/analytics/advertisementCredits/refunds/count/date'; $formParams = []; $queryParams = []; @@ -8820,63 +10942,50 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateRequest($sta $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -8894,12 +11003,12 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateRequest($sta // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8915,10 +11024,11 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateRequest($sta $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8931,14 +11041,15 @@ public function fetchAnalyticsAdCreditsRefundsCountPartitionedByDateRequest($sta * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID($start_date, $end_date) + public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -8949,14 +11060,15 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID($start_ * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID'][0]) { - $request = $this->fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -8999,6 +11111,21 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9011,6 +11138,21 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9023,6 +11165,21 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9035,6 +11192,21 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9049,6 +11221,21 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9103,13 +11290,14 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDWithHttp * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDAsync($start_date, $end_date) + public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID'][0]) { - return $this->fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -9124,14 +11312,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9141,6 +11330,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9171,18 +11363,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDRequest($start_date, $end_date) + public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -9190,6 +11385,7 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDRequest( ); } + $resourcePath = '/v2/analytics/advertisementCredits/scans/count/adCredit'; $formParams = []; $queryParams = []; @@ -9198,41 +11394,32 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDRequest( $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -9250,12 +11437,12 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDRequest( // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -9271,10 +11458,11 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDRequest( $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9289,14 +11477,15 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByAdCreditIDRequest( * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsAdCreditsScansCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsScansCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsAdCreditsScansCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsAdCreditsScansCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -9309,14 +11498,15 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDate($start_date, * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsAdCreditsScansCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsScansCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsAdCreditsScansCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsAdCreditsScansCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -9359,6 +11549,21 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDateWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9371,6 +11576,21 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDateWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9383,6 +11603,21 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDateWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9395,6 +11630,21 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDateWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9409,6 +11659,21 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDateWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9465,13 +11730,14 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDateWithHttpInfo($ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsScansCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsScansCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsAdCreditsScansCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsAdCreditsScansCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -9488,14 +11754,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsAdCreditsScansCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsScansCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsAdCreditsScansCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsAdCreditsScansCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9505,6 +11772,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9537,30 +11807,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsAdCreditsScansCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsAdCreditsScansCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsAdCreditsScansCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsAdCreditsScansCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsAdCreditsScansCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsAdCreditsScansCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -9568,6 +11843,7 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDateRequest($start ); } + $resourcePath = '/v2/analytics/advertisementCredits/scans/count/date'; $formParams = []; $queryParams = []; @@ -9576,63 +11852,50 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDateRequest($start $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -9650,12 +11913,12 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDateRequest($start // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -9671,10 +11934,11 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDateRequest($start $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9686,14 +11950,15 @@ public function fetchAnalyticsAdCreditsScansCountPartitionedByDateRequest($start * Fetch a campaign's wallet page views * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignWalletPageViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTWalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignWalletPageViews($campaign_id) + public function fetchAnalyticsCampaignWalletPageViews($campaign_id, string $contentType = self::contentTypes['fetchAnalyticsCampaignWalletPageViews'][0]) { - list($response) = $this->fetchAnalyticsCampaignWalletPageViewsWithHttpInfo($campaign_id); + list($response) = $this->fetchAnalyticsCampaignWalletPageViewsWithHttpInfo($campaign_id, $contentType); return $response; } @@ -9703,14 +11968,15 @@ public function fetchAnalyticsCampaignWalletPageViews($campaign_id) * Fetch a campaign's wallet page views * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignWalletPageViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTWalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignWalletPageViewsWithHttpInfo($campaign_id) + public function fetchAnalyticsCampaignWalletPageViewsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['fetchAnalyticsCampaignWalletPageViews'][0]) { - $request = $this->fetchAnalyticsCampaignWalletPageViewsRequest($campaign_id); + $request = $this->fetchAnalyticsCampaignWalletPageViewsRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -9753,6 +12019,21 @@ public function fetchAnalyticsCampaignWalletPageViewsWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTWalletPageView[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9765,6 +12046,21 @@ public function fetchAnalyticsCampaignWalletPageViewsWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9777,6 +12073,21 @@ public function fetchAnalyticsCampaignWalletPageViewsWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9789,6 +12100,21 @@ public function fetchAnalyticsCampaignWalletPageViewsWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9803,6 +12129,21 @@ public function fetchAnalyticsCampaignWalletPageViewsWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9856,13 +12197,14 @@ public function fetchAnalyticsCampaignWalletPageViewsWithHttpInfo($campaign_id) * Fetch a campaign's wallet page views * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignWalletPageViewsAsync($campaign_id) + public function fetchAnalyticsCampaignWalletPageViewsAsync($campaign_id, string $contentType = self::contentTypes['fetchAnalyticsCampaignWalletPageViews'][0]) { - return $this->fetchAnalyticsCampaignWalletPageViewsAsyncWithHttpInfo($campaign_id) + return $this->fetchAnalyticsCampaignWalletPageViewsAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -9876,14 +12218,15 @@ function ($response) { * Fetch a campaign's wallet page views * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignWalletPageViewsAsyncWithHttpInfo($campaign_id) + public function fetchAnalyticsCampaignWalletPageViewsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['fetchAnalyticsCampaignWalletPageViews'][0]) { $returnType = '\OpenAPI\Client\Model\WTWalletPageView[]'; - $request = $this->fetchAnalyticsCampaignWalletPageViewsRequest($campaign_id); + $request = $this->fetchAnalyticsCampaignWalletPageViewsRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9893,6 +12236,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9922,12 +12268,14 @@ function ($exception) { * Create request for operation 'fetchAnalyticsCampaignWalletPageViews' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignWalletPageViewsRequest($campaign_id) + public function fetchAnalyticsCampaignWalletPageViewsRequest($campaign_id, string $contentType = self::contentTypes['fetchAnalyticsCampaignWalletPageViews'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -9935,6 +12283,7 @@ public function fetchAnalyticsCampaignWalletPageViewsRequest($campaign_id) ); } + $resourcePath = '/v2/analytics/walletPageViews/campaign/{campaignID}'; $formParams = []; $queryParams = []; @@ -9954,16 +12303,11 @@ public function fetchAnalyticsCampaignWalletPageViewsRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -9981,12 +12325,12 @@ public function fetchAnalyticsCampaignWalletPageViewsRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -10002,10 +12346,11 @@ public function fetchAnalyticsCampaignWalletPageViewsRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -10018,14 +12363,15 @@ public function fetchAnalyticsCampaignWalletPageViewsRequest($campaign_id) * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsCountPartitionedByCampaignID($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByCampaignID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByCampaignID'][0]) { - list($response) = $this->fetchAnalyticsCampaignsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsCampaignsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -10036,14 +12382,15 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignID($start_date, * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByCampaignID'][0]) { - $request = $this->fetchAnalyticsCampaignsCountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsCountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -10086,6 +12433,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDWithHttpInfo( $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10098,6 +12460,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDWithHttpInfo( $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10110,6 +12487,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDWithHttpInfo( $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10122,6 +12514,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDWithHttpInfo( $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10136,6 +12543,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDWithHttpInfo( $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10190,13 +12612,14 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDWithHttpInfo( * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDAsync($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByCampaignID'][0]) { - return $this->fetchAnalyticsCampaignsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsCampaignsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -10211,14 +12634,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByCampaignID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsCampaignsCountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsCountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10228,6 +12652,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10258,18 +12685,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDRequest($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByCampaignID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsCountPartitionedByCampaignID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -10277,6 +12707,7 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDRequest($star ); } + $resourcePath = '/v2/analytics/campaigns/count/campaign/created'; $formParams = []; $queryParams = []; @@ -10285,41 +12716,32 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDRequest($star $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -10337,12 +12759,12 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDRequest($star // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -10358,10 +12780,11 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDRequest($star $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -10374,14 +12797,15 @@ public function fetchAnalyticsCampaignsCountPartitionedByCampaignIDRequest($star * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsCountPartitionedByEmployee($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByEmployee($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByEmployee'][0]) { - list($response) = $this->fetchAnalyticsCampaignsCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsCampaignsCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -10392,14 +12816,15 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployee($start_date, $ * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByEmployee'][0]) { - $request = $this->fetchAnalyticsCampaignsCountPartitionedByEmployeeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsCountPartitionedByEmployeeRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -10442,6 +12867,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployeeWithHttpInfo($s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10454,6 +12894,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployeeWithHttpInfo($s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10466,6 +12921,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployeeWithHttpInfo($s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10478,6 +12948,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployeeWithHttpInfo($s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10492,6 +12977,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployeeWithHttpInfo($s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10546,13 +13046,14 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployeeWithHttpInfo($s * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsCountPartitionedByEmployeeAsync($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByEmployeeAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByEmployee'][0]) { - return $this->fetchAnalyticsCampaignsCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsCampaignsCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -10567,14 +13068,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByEmployee'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsCampaignsCountPartitionedByEmployeeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsCountPartitionedByEmployeeRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10584,6 +13086,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10614,18 +13119,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsCountPartitionedByEmployeeRequest($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByEmployeeRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByEmployee'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsCountPartitionedByEmployee' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -10633,6 +13141,7 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployeeRequest($start_ ); } + $resourcePath = '/v2/analytics/campaigns/count/employee'; $formParams = []; $queryParams = []; @@ -10641,41 +13150,32 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployeeRequest($start_ $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -10693,12 +13193,12 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployeeRequest($start_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -10714,10 +13214,11 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployeeRequest($start_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -10730,14 +13231,15 @@ public function fetchAnalyticsCampaignsCountPartitionedByEmployeeRequest($start_ * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByPaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesign($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesign($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByPaymentDesign'][0]) { - list($response) = $this->fetchAnalyticsCampaignsCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsCampaignsCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -10748,14 +13250,15 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesign($start_da * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByPaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByPaymentDesign'][0]) { - $request = $this->fetchAnalyticsCampaignsCountPartitionedByPaymentDesignRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsCountPartitionedByPaymentDesignRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -10798,6 +13301,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignWithHttpIn $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10810,6 +13328,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignWithHttpIn $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10822,6 +13355,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignWithHttpIn $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10834,6 +13382,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignWithHttpIn $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10848,6 +13411,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignWithHttpIn $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10902,13 +13480,14 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignWithHttpIn * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignAsync($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByPaymentDesign'][0]) { - return $this->fetchAnalyticsCampaignsCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsCampaignsCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -10923,14 +13502,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByPaymentDesign'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsCampaignsCountPartitionedByPaymentDesignRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsCountPartitionedByPaymentDesignRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10940,6 +13520,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10970,18 +13553,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignRequest($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByPaymentDesign'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsCountPartitionedByPaymentDesign' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -10989,6 +13575,7 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignRequest($s ); } + $resourcePath = '/v2/analytics/campaigns/count/paymentDesign'; $formParams = []; $queryParams = []; @@ -10997,41 +13584,32 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignRequest($s $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -11049,12 +13627,12 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignRequest($s // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -11070,10 +13648,11 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignRequest($s $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -11086,14 +13665,15 @@ public function fetchAnalyticsCampaignsCountPartitionedByPaymentDesignRequest($s * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByValueType'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsCountPartitionedByValueType($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByValueType($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByValueType'][0]) { - list($response) = $this->fetchAnalyticsCampaignsCountPartitionedByValueTypeWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsCampaignsCountPartitionedByValueTypeWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -11104,14 +13684,15 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueType($start_date, * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByValueType'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsCountPartitionedByValueTypeWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByValueTypeWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByValueType'][0]) { - $request = $this->fetchAnalyticsCampaignsCountPartitionedByValueTypeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsCountPartitionedByValueTypeRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -11154,6 +13735,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueTypeWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11166,6 +13762,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueTypeWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11178,6 +13789,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueTypeWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11190,6 +13816,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueTypeWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11204,6 +13845,21 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueTypeWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11258,13 +13914,14 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueTypeWithHttpInfo($ * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByValueType'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsCountPartitionedByValueTypeAsync($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByValueTypeAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByValueType'][0]) { - return $this->fetchAnalyticsCampaignsCountPartitionedByValueTypeAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsCampaignsCountPartitionedByValueTypeAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -11279,14 +13936,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByValueType'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsCountPartitionedByValueTypeAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByValueTypeAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByValueType'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsCampaignsCountPartitionedByValueTypeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsCountPartitionedByValueTypeRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11296,6 +13954,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -11326,18 +13987,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByValueType'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsCountPartitionedByValueTypeRequest($start_date, $end_date) + public function fetchAnalyticsCampaignsCountPartitionedByValueTypeRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsCountPartitionedByValueType'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsCountPartitionedByValueType' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -11345,6 +14009,7 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueTypeRequest($start ); } + $resourcePath = '/v2/analytics/campaigns/count/valueType'; $formParams = []; $queryParams = []; @@ -11353,41 +14018,32 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueTypeRequest($start $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -11405,12 +14061,12 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueTypeRequest($start // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -11426,10 +14082,11 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueTypeRequest($start $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -11442,14 +14099,15 @@ public function fetchAnalyticsCampaignsCountPartitionedByValueTypeRequest($start * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID($start_date, $end_date) + public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID'][0]) { - list($response) = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -11460,14 +14118,15 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID( * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID'][0]) { - $request = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -11510,6 +14169,21 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11522,6 +14196,21 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11534,6 +14223,21 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11546,6 +14250,21 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11560,6 +14279,21 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11614,13 +14348,14 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDW * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDAsync($start_date, $end_date) + public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID'][0]) { - return $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -11635,14 +14370,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11652,6 +14388,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -11682,18 +14421,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDRequest($start_date, $end_date) + public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -11701,6 +14443,7 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDR ); } + $resourcePath = '/v2/analytics/campaigns/redemptions/amount/campaign'; $formParams = []; $queryParams = []; @@ -11709,41 +14452,32 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDR $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -11761,12 +14495,12 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDR // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -11782,10 +14516,11 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDR $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -11800,14 +14535,15 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByCampaignIDR * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -11820,14 +14556,15 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate($start * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -11870,6 +14607,21 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11882,6 +14634,21 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11894,6 +14661,21 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11906,6 +14688,21 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11920,6 +14717,21 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11976,13 +14788,14 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateWithHtt * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate'][0]) { - return $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -11999,14 +14812,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12016,6 +14830,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -12048,30 +14865,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -12079,6 +14901,7 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateRequest ); } + $resourcePath = '/v2/analytics/campaigns/redemptions/amount/date'; $formParams = []; $queryParams = []; @@ -12087,63 +14910,50 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateRequest $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -12161,12 +14971,12 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateRequest // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -12182,10 +14992,11 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateRequest $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -12198,14 +15009,15 @@ public function fetchAnalyticsCampaignsRedemptionsAmountPartitionedByDateRequest * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID($start_date, $end_date) + public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID'][0]) { - list($response) = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -12216,14 +15028,15 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID($ * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID'][0]) { - $request = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -12266,6 +15079,21 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12278,6 +15106,21 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12290,6 +15133,21 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12302,6 +15160,21 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12316,6 +15189,21 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12370,13 +15258,14 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDWi * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDAsync($start_date, $end_date) + public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID'][0]) { - return $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -12391,14 +15280,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12408,6 +15298,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -12438,18 +15331,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDRequest($start_date, $end_date) + public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -12457,6 +15353,7 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDRe ); } + $resourcePath = '/v2/analytics/campaigns/redemptions/count/campaign'; $formParams = []; $queryParams = []; @@ -12465,41 +15362,32 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDRe $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -12517,12 +15405,12 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDRe // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -12538,10 +15426,11 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDRe $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -12556,14 +15445,15 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByCampaignIDRe * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -12576,14 +15466,15 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate($start_ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -12626,6 +15517,21 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12638,6 +15544,21 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12650,6 +15571,21 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12662,6 +15598,21 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12676,6 +15627,21 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12732,13 +15698,14 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateWithHttp * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -12755,14 +15722,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12772,6 +15740,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -12804,30 +15775,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsCampaignsRedemptionsCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -12835,6 +15811,7 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateRequest( ); } + $resourcePath = '/v2/analytics/campaigns/redemptions/count/date'; $formParams = []; $queryParams = []; @@ -12843,63 +15820,50 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateRequest( $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -12917,12 +15881,12 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateRequest( // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -12938,10 +15902,11 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateRequest( $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -12954,14 +15919,15 @@ public function fetchAnalyticsCampaignsRedemptionsCountPartitionedByDateRequest( * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID($start_date, $end_date) + public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID'][0]) { - list($response) = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -12972,14 +15938,15 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID($sta * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID'][0]) { - $request = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -13022,6 +15989,21 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13034,6 +16016,21 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13046,6 +16043,21 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13058,6 +16070,21 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13072,6 +16099,21 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13126,13 +16168,14 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDWithH * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDAsync($start_date, $end_date) + public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID'][0]) { - return $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -13147,14 +16190,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13164,6 +16208,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -13194,18 +16241,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDRequest($start_date, $end_date) + public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -13213,6 +16263,7 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDReque ); } + $resourcePath = '/v2/analytics/campaigns/refunds/amount/campaign'; $formParams = []; $queryParams = []; @@ -13221,41 +16272,32 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDReque $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -13273,12 +16315,12 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDReque // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -13294,10 +16336,11 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDReque $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -13312,14 +16355,15 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByCampaignIDReque * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -13332,14 +16376,15 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDate($start_dat * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -13382,6 +16427,21 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13394,6 +16454,21 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13406,6 +16481,21 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13418,6 +16508,21 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13432,6 +16537,21 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13488,13 +16608,14 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateWithHttpInf * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByDate'][0]) { - return $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -13511,14 +16632,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsCampaignsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13528,6 +16650,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -13560,30 +16685,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsAmountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsRefundsAmountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsCampaignsRefundsAmountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsCampaignsRefundsAmountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -13591,6 +16721,7 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateRequest($st ); } + $resourcePath = '/v2/analytics/campaigns/refunds/amount/date'; $formParams = []; $queryParams = []; @@ -13599,63 +16730,50 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateRequest($st $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -13673,12 +16791,12 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateRequest($st // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -13694,10 +16812,11 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateRequest($st $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -13710,14 +16829,15 @@ public function fetchAnalyticsCampaignsRefundsAmountPartitionedByDateRequest($st * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID($start_date, $end_date) + public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID'][0]) { - list($response) = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -13728,14 +16848,15 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID($star * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID'][0]) { - $request = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -13778,6 +16899,21 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13790,6 +16926,21 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13802,6 +16953,21 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13814,6 +16980,21 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13828,6 +17009,21 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13882,13 +17078,14 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDWithHt * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDAsync($start_date, $end_date) + public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID'][0]) { - return $this->fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -13903,14 +17100,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13920,6 +17118,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -13950,18 +17151,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDRequest($start_date, $end_date) + public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -13969,6 +17173,7 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDReques ); } + $resourcePath = '/v2/analytics/campaigns/refunds/count/campaign'; $formParams = []; $queryParams = []; @@ -13977,41 +17182,32 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDReques $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -14029,12 +17225,12 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDReques // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -14050,10 +17246,11 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDReques $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -14068,14 +17265,15 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByCampaignIDReques * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsCampaignsRefundsCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRefundsCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -14088,14 +17286,15 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDate($start_date * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -14138,6 +17337,21 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateWithHttpInfo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14150,6 +17364,21 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateWithHttpInfo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14162,6 +17391,21 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateWithHttpInfo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14174,6 +17418,21 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateWithHttpInfo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14188,6 +17447,21 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateWithHttpInfo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14244,13 +17518,14 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateWithHttpInfo * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsCampaignsRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsCampaignsRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -14267,14 +17542,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsCampaignsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14284,6 +17560,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -14316,30 +17595,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsCampaignsRefundsCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsCampaignsRefundsCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsCampaignsRefundsCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsCampaignsRefundsCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -14347,6 +17631,7 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateRequest($sta ); } + $resourcePath = '/v2/analytics/campaigns/refunds/count/date'; $formParams = []; $queryParams = []; @@ -14355,63 +17640,50 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateRequest($sta $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -14429,12 +17701,12 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateRequest($sta // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -14450,10 +17722,11 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateRequest($sta $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -14468,14 +17741,15 @@ public function fetchAnalyticsCampaignsRefundsCountPartitionedByDateRequest($sta * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -14488,14 +17762,15 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate($s * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -14538,6 +17813,21 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateWit $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14550,6 +17840,21 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateWit $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14562,6 +17867,21 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateWit $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14574,6 +17894,21 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateWit $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14588,6 +17923,21 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateWit $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14644,13 +17994,14 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateWit * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -14667,14 +18018,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14684,6 +18036,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -14716,30 +18071,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -14747,6 +18107,7 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateReq ); } + $resourcePath = '/v2/analytics/outboundSMS/count/date/delivered'; $formParams = []; $queryParams = []; @@ -14755,63 +18116,50 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateReq $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -14829,12 +18177,12 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateReq // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -14850,10 +18198,11 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateReq $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -14866,14 +18215,15 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByDateReq * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber($start_date, $end_date) + public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber'][0]) { - list($response) = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -14884,14 +18234,15 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber'][0]) { - $request = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -14934,6 +18285,21 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14946,6 +18312,21 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14958,6 +18339,21 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14970,6 +18366,21 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14984,6 +18395,21 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15038,13 +18464,14 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberAsync($start_date, $end_date) + public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber'][0]) { - return $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -15059,14 +18486,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15076,6 +18504,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -15106,18 +18537,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date) + public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNumber' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -15125,6 +18559,7 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu ); } + $resourcePath = '/v2/analytics/outboundSMS/count/phoneNumber/delivered'; $formParams = []; $queryParams = []; @@ -15133,41 +18568,32 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -15185,12 +18611,12 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -15206,10 +18632,11 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -15222,14 +18649,15 @@ public function fetchAnalyticsDeliveredOutboundMessagesCountPartitionedByPhoneNu * * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDistinctWalletSessions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDistinctWalletSessions($start_date = null, $end_date = null) + public function fetchAnalyticsDistinctWalletSessions($start_date = null, $end_date = null, string $contentType = self::contentTypes['fetchAnalyticsDistinctWalletSessions'][0]) { - list($response) = $this->fetchAnalyticsDistinctWalletSessionsWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsDistinctWalletSessionsWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -15240,14 +18668,15 @@ public function fetchAnalyticsDistinctWalletSessions($start_date = null, $end_da * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDistinctWalletSessions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDistinctWalletSessionsWithHttpInfo($start_date = null, $end_date = null) + public function fetchAnalyticsDistinctWalletSessionsWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['fetchAnalyticsDistinctWalletSessions'][0]) { - $request = $this->fetchAnalyticsDistinctWalletSessionsRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDistinctWalletSessionsRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -15290,6 +18719,21 @@ public function fetchAnalyticsDistinctWalletSessionsWithHttpInfo($start_date = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15302,6 +18746,21 @@ public function fetchAnalyticsDistinctWalletSessionsWithHttpInfo($start_date = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15314,6 +18773,21 @@ public function fetchAnalyticsDistinctWalletSessionsWithHttpInfo($start_date = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15326,6 +18800,21 @@ public function fetchAnalyticsDistinctWalletSessionsWithHttpInfo($start_date = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15340,6 +18829,21 @@ public function fetchAnalyticsDistinctWalletSessionsWithHttpInfo($start_date = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15394,13 +18898,14 @@ public function fetchAnalyticsDistinctWalletSessionsWithHttpInfo($start_date = n * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDistinctWalletSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDistinctWalletSessionsAsync($start_date = null, $end_date = null) + public function fetchAnalyticsDistinctWalletSessionsAsync($start_date = null, $end_date = null, string $contentType = self::contentTypes['fetchAnalyticsDistinctWalletSessions'][0]) { - return $this->fetchAnalyticsDistinctWalletSessionsAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsDistinctWalletSessionsAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -15415,14 +18920,15 @@ function ($response) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDistinctWalletSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDistinctWalletSessionsAsyncWithHttpInfo($start_date = null, $end_date = null) + public function fetchAnalyticsDistinctWalletSessionsAsyncWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['fetchAnalyticsDistinctWalletSessions'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsDistinctWalletSessionsRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDistinctWalletSessionsRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15432,6 +18938,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -15462,13 +18971,17 @@ function ($exception) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDistinctWalletSessions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDistinctWalletSessionsRequest($start_date = null, $end_date = null) + public function fetchAnalyticsDistinctWalletSessionsRequest($start_date = null, $end_date = null, string $contentType = self::contentTypes['fetchAnalyticsDistinctWalletSessions'][0]) { + + + $resourcePath = '/v2/analytics/walletPageViews/sessions/distinct'; $formParams = []; $queryParams = []; @@ -15477,41 +18990,32 @@ public function fetchAnalyticsDistinctWalletSessionsRequest($start_date = null, $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -15529,12 +19033,12 @@ public function fetchAnalyticsDistinctWalletSessionsRequest($start_date = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -15550,10 +19054,11 @@ public function fetchAnalyticsDistinctWalletSessionsRequest($start_date = null, $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -15566,14 +19071,15 @@ public function fetchAnalyticsDistinctWalletSessionsRequest($start_date = null, * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployee($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployee($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByEmployee'][0]) { - list($response) = $this->fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -15584,14 +19090,15 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployee($start_d * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByEmployee'][0]) { - $request = $this->fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -15634,6 +19141,21 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeWithHttpI $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15646,6 +19168,21 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeWithHttpI $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15658,6 +19195,21 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeWithHttpI $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15670,6 +19222,21 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeWithHttpI $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15684,6 +19251,21 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeWithHttpI $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15738,13 +19320,14 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeWithHttpI * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeAsync($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByEmployee'][0]) { - return $this->fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -15759,14 +19342,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByEmployee'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15776,6 +19360,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -15806,18 +19393,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeRequest($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByEmployee'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDynamicVouchersCountPartitionedByEmployee' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -15825,6 +19415,7 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeRequest($ ); } + $resourcePath = '/v2/analytics/dynamicVouchers/count/employee'; $formParams = []; $queryParams = []; @@ -15833,41 +19424,32 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeRequest($ $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -15885,12 +19467,12 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeRequest($ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -15906,10 +19488,11 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeRequest($ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -15922,14 +19505,15 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByEmployeeRequest($ * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign'][0]) { - list($response) = $this->fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -15940,14 +19524,15 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign($st * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign'][0]) { - $request = $this->fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -15990,6 +19575,21 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignWith $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16002,6 +19602,21 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignWith $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16014,6 +19629,21 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignWith $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16026,6 +19656,21 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignWith $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16040,6 +19685,21 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignWith $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16094,13 +19754,14 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignWith * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignAsync($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign'][0]) { - return $this->fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -16115,14 +19776,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16132,6 +19794,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -16162,18 +19827,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignRequest($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesign' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -16181,6 +19849,7 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignRequ ); } + $resourcePath = '/v2/analytics/dynamicVouchers/count/paymentDesign'; $formParams = []; $queryParams = []; @@ -16189,41 +19858,32 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignRequ $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -16241,12 +19901,12 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignRequ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -16262,10 +19922,11 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignRequ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -16280,14 +19941,15 @@ public function fetchAnalyticsDynamicVouchersCountPartitionedByPaymentDesignRequ * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -16300,14 +19962,15 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate( * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -16350,6 +20013,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16362,6 +20040,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16374,6 +20067,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16386,6 +20094,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16400,6 +20123,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16456,13 +20194,14 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateW * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate'][0]) { - return $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -16479,14 +20218,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16496,6 +20236,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -16528,30 +20271,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -16559,6 +20307,7 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateR ); } + $resourcePath = '/v2/analytics/dynamicVouchers/redemptions/amount/date'; $formParams = []; $queryParams = []; @@ -16567,63 +20316,50 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateR $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -16641,12 +20377,12 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateR // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -16662,10 +20398,11 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateR $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -16678,14 +20415,15 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDateR * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID'][0]) { - list($response) = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -16696,14 +20434,15 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID'][0]) { - $request = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -16746,6 +20485,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16758,6 +20512,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16770,6 +20539,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16782,6 +20566,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16796,6 +20595,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -16850,13 +20664,14 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDAsync($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID'][0]) { - return $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -16871,14 +20686,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -16888,6 +20704,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -16918,18 +20737,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynamicVoucherID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -16937,6 +20759,7 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam ); } + $resourcePath = '/v2/analytics/dynamicVouchers/redemptions/amount/dynamicVoucher'; $formParams = []; $queryParams = []; @@ -16945,41 +20768,32 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -16997,12 +20811,12 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -17018,10 +20832,11 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -17036,14 +20851,15 @@ public function fetchAnalyticsDynamicVouchersRedemptionsAmountPartitionedByDynam * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -17056,14 +20872,15 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate($ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -17106,6 +20923,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17118,6 +20950,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17130,6 +20977,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17142,6 +21004,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17156,6 +21033,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17212,13 +21104,14 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateWi * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -17235,14 +21128,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17252,6 +21146,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -17284,30 +21181,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -17315,6 +21217,7 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateRe ); } + $resourcePath = '/v2/analytics/dynamicVouchers/redemptions/count/date'; $formParams = []; $queryParams = []; @@ -17323,63 +21226,50 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateRe $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -17397,12 +21287,12 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateRe // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -17418,10 +21308,11 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateRe $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -17434,14 +21325,15 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDateRe * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID'][0]) { - list($response) = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -17452,14 +21344,15 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID'][0]) { - $request = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -17502,6 +21395,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17514,6 +21422,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17526,6 +21449,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17538,6 +21476,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17552,6 +21505,21 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17606,13 +21574,14 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDAsync($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID'][0]) { - return $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -17627,14 +21596,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -17644,6 +21614,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -17674,18 +21647,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynamicVoucherID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -17693,6 +21669,7 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami ); } + $resourcePath = '/v2/analytics/dynamicVouchers/redemptions/count/dynamicVoucher'; $formParams = []; $queryParams = []; @@ -17701,41 +21678,32 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -17753,12 +21721,12 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -17774,10 +21742,11 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -17792,14 +21761,15 @@ public function fetchAnalyticsDynamicVouchersRedemptionsCountPartitionedByDynami * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -17812,14 +21782,15 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate($sta * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -17862,6 +21833,21 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17874,6 +21860,21 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17886,6 +21887,21 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17898,6 +21914,21 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17912,6 +21943,21 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -17968,13 +22014,14 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateWithH * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate'][0]) { - return $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -17991,14 +22038,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18008,6 +22056,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -18040,30 +22091,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -18071,6 +22127,7 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateReque ); } + $resourcePath = '/v2/analytics/dynamicVouchers/refunds/amount/date'; $formParams = []; $queryParams = []; @@ -18079,63 +22136,50 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateReque $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -18153,12 +22197,12 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateReque // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -18174,10 +22218,11 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateReque $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -18190,14 +22235,15 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDateReque * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID'][0]) { - list($response) = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -18208,14 +22254,15 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID'][0]) { - $request = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -18258,6 +22305,21 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -18270,6 +22332,21 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -18282,6 +22359,21 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -18294,6 +22386,21 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -18308,6 +22415,21 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -18362,13 +22484,14 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDAsync($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID'][0]) { - return $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -18383,14 +22506,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18400,6 +22524,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -18430,18 +22557,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVoucherID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -18449,6 +22579,7 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo ); } + $resourcePath = '/v2/analytics/dynamicVouchers/refunds/amount/dynamicVoucher'; $formParams = []; $queryParams = []; @@ -18457,41 +22588,32 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -18509,12 +22631,12 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -18530,10 +22652,11 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -18548,14 +22671,15 @@ public function fetchAnalyticsDynamicVouchersRefundsAmountPartitionedByDynamicVo * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -18568,14 +22692,15 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate($star * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -18618,6 +22743,21 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -18630,6 +22770,21 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -18642,6 +22797,21 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -18654,6 +22824,21 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -18668,6 +22853,21 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -18724,13 +22924,14 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateWithHt * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -18747,14 +22948,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -18764,6 +22966,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -18796,30 +23001,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -18827,6 +23037,7 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateReques ); } + $resourcePath = '/v2/analytics/dynamicVouchers/refunds/count/date'; $formParams = []; $queryParams = []; @@ -18835,63 +23046,50 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateReques $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -18909,12 +23107,12 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateReques // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -18930,10 +23128,11 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateReques $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -18946,14 +23145,15 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDateReques * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID'][0]) { - list($response) = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -18964,14 +23164,15 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID'][0]) { - $request = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -19014,6 +23215,21 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19026,6 +23242,21 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19038,6 +23269,21 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19050,6 +23296,21 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19064,6 +23325,21 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19118,13 +23394,14 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDAsync($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID'][0]) { - return $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -19139,14 +23416,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19156,6 +23434,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -19186,18 +23467,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date) + public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVoucherID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -19205,6 +23489,7 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou ); } + $resourcePath = '/v2/analytics/dynamicVouchers/refunds/count/dynamicVoucher'; $formParams = []; $queryParams = []; @@ -19213,41 +23498,32 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -19265,12 +23541,12 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -19286,10 +23562,11 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -19304,14 +23581,15 @@ public function fetchAnalyticsDynamicVouchersRefundsCountPartitionedByDynamicVou * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -19324,14 +23602,15 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate($sta * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -19374,6 +23653,21 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19386,6 +23680,21 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19398,6 +23707,21 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19410,6 +23734,21 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19424,6 +23763,21 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateWithH $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19480,13 +23834,14 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateWithH * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -19503,14 +23858,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19520,6 +23876,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -19552,30 +23911,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -19583,6 +23947,7 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateReque ); } + $resourcePath = '/v2/analytics/helpdeskrequests/count/date/created'; $formParams = []; $queryParams = []; @@ -19591,63 +23956,50 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateReque $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -19665,12 +24017,12 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateReque // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -19686,10 +24038,11 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateReque $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -19704,14 +24057,15 @@ public function fetchAnalyticsHelpDeskRequestsCreatedCountPartitionedByDateReque * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -19724,14 +24078,15 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate($st * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -19774,6 +24129,21 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateWith $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19786,6 +24156,21 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateWith $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19798,6 +24183,21 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateWith $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19810,6 +24210,21 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateWith $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19824,6 +24239,21 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateWith $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -19880,13 +24310,14 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateWith * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -19903,14 +24334,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -19920,6 +24352,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -19952,30 +24387,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -19983,6 +24423,7 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateRequ ); } + $resourcePath = '/v2/analytics/helpdeskrequests/count/date/resolved'; $formParams = []; $queryParams = []; @@ -19991,63 +24432,50 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateRequ $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -20065,12 +24493,12 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateRequ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -20086,10 +24514,11 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateRequ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -20102,14 +24531,15 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByDateRequ * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee($start_date, $end_date) + public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee'][0]) { - list($response) = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -20120,14 +24550,15 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee'][0]) { - $request = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -20170,6 +24601,21 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20182,6 +24628,21 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20194,6 +24655,21 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20206,6 +24682,21 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20220,6 +24711,21 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20274,13 +24780,14 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeAsync($start_date, $end_date) + public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee'][0]) { - return $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -20295,14 +24802,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20312,6 +24820,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -20342,18 +24853,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeRequest($start_date, $end_date) + public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployeeRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -20361,6 +24875,7 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee ); } + $resourcePath = '/v2/analytics/helpdeskrequests/count/employee/resolved'; $formParams = []; $queryParams = []; @@ -20369,41 +24884,32 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -20421,12 +24927,12 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -20442,10 +24948,11 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -20460,14 +24967,15 @@ public function fetchAnalyticsHelpDeskRequestsResolvedCountPartitionedByEmployee * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -20480,14 +24988,15 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate($ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -20530,6 +25039,21 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20542,6 +25066,21 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20554,6 +25093,21 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20566,6 +25120,21 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20580,6 +25149,21 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateWi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20636,13 +25220,14 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateWi * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -20659,14 +25244,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -20676,6 +25262,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -20708,30 +25297,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -20739,6 +25333,7 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateRe ); } + $resourcePath = '/v2/analytics/helpdeskrequests/count/date/unresolved'; $formParams = []; $queryParams = []; @@ -20747,63 +25342,50 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateRe $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -20821,12 +25403,12 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateRe // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -20842,10 +25424,11 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateRe $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -20857,14 +25440,15 @@ public function fetchAnalyticsHelpDeskRequestsUnresolvedCountPartitionedByDateRe * Fetch wallet page views of item * * @param string $item_id item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsItemWalletPageViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsItemWalletPageViews($item_id) + public function fetchAnalyticsItemWalletPageViews($item_id, string $contentType = self::contentTypes['fetchAnalyticsItemWalletPageViews'][0]) { - list($response) = $this->fetchAnalyticsItemWalletPageViewsWithHttpInfo($item_id); + list($response) = $this->fetchAnalyticsItemWalletPageViewsWithHttpInfo($item_id, $contentType); return $response; } @@ -20874,14 +25458,15 @@ public function fetchAnalyticsItemWalletPageViews($item_id) * Fetch wallet page views of item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsItemWalletPageViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsItemWalletPageViewsWithHttpInfo($item_id) + public function fetchAnalyticsItemWalletPageViewsWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchAnalyticsItemWalletPageViews'][0]) { - $request = $this->fetchAnalyticsItemWalletPageViewsRequest($item_id); + $request = $this->fetchAnalyticsItemWalletPageViewsRequest($item_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -20924,6 +25509,21 @@ public function fetchAnalyticsItemWalletPageViewsWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20936,6 +25536,21 @@ public function fetchAnalyticsItemWalletPageViewsWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20948,6 +25563,21 @@ public function fetchAnalyticsItemWalletPageViewsWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20960,6 +25590,21 @@ public function fetchAnalyticsItemWalletPageViewsWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -20974,8 +25619,23 @@ public function fetchAnalyticsItemWalletPageViewsWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - } - + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), @@ -21027,13 +25687,14 @@ public function fetchAnalyticsItemWalletPageViewsWithHttpInfo($item_id) * Fetch wallet page views of item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsItemWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsItemWalletPageViewsAsync($item_id) + public function fetchAnalyticsItemWalletPageViewsAsync($item_id, string $contentType = self::contentTypes['fetchAnalyticsItemWalletPageViews'][0]) { - return $this->fetchAnalyticsItemWalletPageViewsAsyncWithHttpInfo($item_id) + return $this->fetchAnalyticsItemWalletPageViewsAsyncWithHttpInfo($item_id, $contentType) ->then( function ($response) { return $response[0]; @@ -21047,14 +25708,15 @@ function ($response) { * Fetch wallet page views of item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsItemWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsItemWalletPageViewsAsyncWithHttpInfo($item_id) + public function fetchAnalyticsItemWalletPageViewsAsyncWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchAnalyticsItemWalletPageViews'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsItemWalletPageViewsRequest($item_id); + $request = $this->fetchAnalyticsItemWalletPageViewsRequest($item_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21064,6 +25726,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -21093,12 +25758,14 @@ function ($exception) { * Create request for operation 'fetchAnalyticsItemWalletPageViews' * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsItemWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsItemWalletPageViewsRequest($item_id) + public function fetchAnalyticsItemWalletPageViewsRequest($item_id, string $contentType = self::contentTypes['fetchAnalyticsItemWalletPageViews'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( @@ -21106,6 +25773,7 @@ public function fetchAnalyticsItemWalletPageViewsRequest($item_id) ); } + $resourcePath = '/v2/analytics/walletPageViews/item/{itemID}'; $formParams = []; $queryParams = []; @@ -21125,16 +25793,11 @@ public function fetchAnalyticsItemWalletPageViewsRequest($item_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -21152,12 +25815,12 @@ public function fetchAnalyticsItemWalletPageViewsRequest($item_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -21173,10 +25836,11 @@ public function fetchAnalyticsItemWalletPageViewsRequest($item_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -21191,14 +25855,15 @@ public function fetchAnalyticsItemWalletPageViewsRequest($item_id) * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsMemberCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MSAnalyticsMemberCountPartitionedByDate[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsMemberCount($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsMemberCount($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsMemberCount'][0]) { - list($response) = $this->fetchAnalyticsMemberCountWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsMemberCountWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -21211,14 +25876,15 @@ public function fetchAnalyticsMemberCount($start_date, $end_date, $locale, $time * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsMemberCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MSAnalyticsMemberCountPartitionedByDate[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsMemberCountWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsMemberCountWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsMemberCount'][0]) { - $request = $this->fetchAnalyticsMemberCountRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsMemberCountRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -21261,6 +25927,21 @@ public function fetchAnalyticsMemberCountWithHttpInfo($start_date, $end_date, $l $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MSAnalyticsMemberCountPartitionedByDate[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -21273,6 +25954,21 @@ public function fetchAnalyticsMemberCountWithHttpInfo($start_date, $end_date, $l $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -21285,6 +25981,21 @@ public function fetchAnalyticsMemberCountWithHttpInfo($start_date, $end_date, $l $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -21297,6 +26008,21 @@ public function fetchAnalyticsMemberCountWithHttpInfo($start_date, $end_date, $l $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -21311,6 +26037,21 @@ public function fetchAnalyticsMemberCountWithHttpInfo($start_date, $end_date, $l $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -21367,13 +26108,14 @@ public function fetchAnalyticsMemberCountWithHttpInfo($start_date, $end_date, $l * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsMemberCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsMemberCountAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsMemberCountAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsMemberCount'][0]) { - return $this->fetchAnalyticsMemberCountAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsMemberCountAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -21390,14 +26132,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsMemberCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsMemberCountAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsMemberCountAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsMemberCount'][0]) { $returnType = '\OpenAPI\Client\Model\MSAnalyticsMemberCountPartitionedByDate[]'; - $request = $this->fetchAnalyticsMemberCountRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsMemberCountRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21407,6 +26150,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -21439,30 +26185,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsMemberCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsMemberCountRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsMemberCountRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsMemberCount'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsMemberCount' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsMemberCount' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsMemberCount' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -21470,6 +26221,7 @@ public function fetchAnalyticsMemberCountRequest($start_date, $end_date, $locale ); } + $resourcePath = '/v2/analytics/membership/member/count'; $formParams = []; $queryParams = []; @@ -21478,63 +26230,50 @@ public function fetchAnalyticsMemberCountRequest($start_date, $end_date, $locale $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -21552,12 +26291,12 @@ public function fetchAnalyticsMemberCountRequest($start_date, $end_date, $locale // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -21573,10 +26312,11 @@ public function fetchAnalyticsMemberCountRequest($start_date, $end_date, $locale $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -21591,14 +26331,15 @@ public function fetchAnalyticsMemberCountRequest($start_date, $end_date, $locale * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsMerchantCreditCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsMerchantCreditCount($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsMerchantCreditCount($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsMerchantCreditCount'][0]) { - list($response) = $this->fetchAnalyticsMerchantCreditCountWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsMerchantCreditCountWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -21611,14 +26352,15 @@ public function fetchAnalyticsMerchantCreditCount($start_date, $end_date, $local * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsMerchantCreditCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsMerchantCreditCountWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsMerchantCreditCountWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsMerchantCreditCount'][0]) { - $request = $this->fetchAnalyticsMerchantCreditCountRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsMerchantCreditCountRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -21661,6 +26403,21 @@ public function fetchAnalyticsMerchantCreditCountWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -21673,6 +26430,21 @@ public function fetchAnalyticsMerchantCreditCountWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -21685,6 +26457,21 @@ public function fetchAnalyticsMerchantCreditCountWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -21697,6 +26484,21 @@ public function fetchAnalyticsMerchantCreditCountWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -21711,6 +26513,21 @@ public function fetchAnalyticsMerchantCreditCountWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -21767,13 +26584,14 @@ public function fetchAnalyticsMerchantCreditCountWithHttpInfo($start_date, $end_ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsMerchantCreditCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsMerchantCreditCountAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsMerchantCreditCountAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsMerchantCreditCount'][0]) { - return $this->fetchAnalyticsMerchantCreditCountAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsMerchantCreditCountAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -21790,14 +26608,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsMerchantCreditCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsMerchantCreditCountAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsMerchantCreditCountAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsMerchantCreditCount'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsMerchantCreditCountRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsMerchantCreditCountRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -21807,6 +26626,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -21839,30 +26661,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsMerchantCreditCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsMerchantCreditCountRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsMerchantCreditCountRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsMerchantCreditCount'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsMerchantCreditCount' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsMerchantCreditCount' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsMerchantCreditCount' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -21870,6 +26697,7 @@ public function fetchAnalyticsMerchantCreditCountRequest($start_date, $end_date, ); } + $resourcePath = '/v2/analytics/membership/merchantCredit/count'; $formParams = []; $queryParams = []; @@ -21878,63 +26706,50 @@ public function fetchAnalyticsMerchantCreditCountRequest($start_date, $end_date, $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -21952,12 +26767,12 @@ public function fetchAnalyticsMerchantCreditCountRequest($start_date, $end_date, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -21973,10 +26788,11 @@ public function fetchAnalyticsMerchantCreditCountRequest($start_date, $end_date, $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -21989,14 +26805,15 @@ public function fetchAnalyticsMerchantCreditCountRequest($start_date, $end_date, * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID($start_date, $end_date) + public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID'][0]) { - list($response) = $this->fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -22007,14 +26824,15 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID($star * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID'][0]) { - $request = $this->fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -22057,6 +26875,21 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22069,6 +26902,21 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22081,6 +26929,21 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22093,6 +26956,21 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22107,6 +26985,21 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDWithHt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22161,13 +27054,14 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDWithHt * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDAsync($start_date, $end_date) + public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID'][0]) { - return $this->fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -22182,14 +27076,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDRequest($start_date, $end_date); + $request = $this->fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22199,6 +27094,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -22229,18 +27127,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDRequest($start_date, $end_date) + public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignID' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -22248,6 +27149,7 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDReques ); } + $resourcePath = '/v2/analytics/campaigns/amount/campaign/offerVsRedeemed'; $formParams = []; $queryParams = []; @@ -22256,41 +27158,32 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDReques $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -22308,12 +27201,12 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDReques // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -22329,10 +27222,11 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDReques $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -22347,14 +27241,15 @@ public function fetchAnalyticsOfferVsRedeemedAmountPartitionedByCampaignIDReques * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -22367,14 +27262,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -22417,6 +27313,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22429,6 +27340,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22441,6 +27367,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22453,6 +27394,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22467,6 +27423,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22523,13 +27494,14 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -22546,14 +27518,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22563,6 +27536,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -22595,30 +27571,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -22626,6 +27607,7 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa ); } + $resourcePath = '/v2/analytics/paymentObjectBroadcasts/count/date/created'; $formParams = []; $queryParams = []; @@ -22634,63 +27616,50 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -22708,12 +27677,12 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -22729,10 +27698,11 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -22745,14 +27715,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsCreatedCountPartitionedByDa * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts'][0]) { - list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -22763,14 +27734,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts'][0]) { - $request = $this->fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsRequest($start_date, $end_date); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -22813,6 +27785,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22825,6 +27812,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22837,6 +27839,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22849,6 +27866,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22863,6 +27895,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -22917,13 +27964,14 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsAsync($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts'][0]) { - return $this->fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -22938,14 +27986,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsRequest($start_date, $end_date); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -22955,6 +28004,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -22985,18 +28037,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsRequest($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcastsRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCompletedBroadcasts' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -23004,6 +28059,7 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo ); } + $resourcePath = '/v2/analytics/paymentObjectBroadcasts/executionTime/completed'; $formParams = []; $queryParams = []; @@ -23012,41 +28068,32 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -23064,12 +28111,12 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -23085,10 +28132,11 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -23103,14 +28151,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsIndividualExecutionTimeOfCo * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -23123,14 +28172,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -23173,6 +28223,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23185,6 +28250,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23197,6 +28277,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23209,6 +28304,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23223,6 +28333,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23279,13 +28404,14 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -23302,14 +28428,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23319,6 +28446,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -23351,30 +28481,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -23382,6 +28517,7 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy ); } + $resourcePath = '/v2/analytics/paymentObjectBroadcasts/count/date/scheduled'; $formParams = []; $queryParams = []; @@ -23390,63 +28526,50 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -23464,12 +28587,12 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -23485,10 +28608,11 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -23501,14 +28625,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee'][0]) { - list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -23519,14 +28644,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee'][0]) { - $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -23569,6 +28695,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23581,6 +28722,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23593,6 +28749,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23605,6 +28776,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23619,6 +28805,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23673,13 +28874,14 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeAsync($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee'][0]) { - return $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -23694,14 +28896,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeRequest($start_date, $end_date); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -23711,6 +28914,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -23741,18 +28947,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeRequest($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployeeRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByEmployee' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -23760,6 +28969,7 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy ); } + $resourcePath = '/v2/analytics/paymentObjectBroadcasts/count/employee/scheduled'; $formParams = []; $queryParams = []; @@ -23768,41 +28978,32 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -23820,12 +29021,12 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -23841,10 +29042,11 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -23857,14 +29059,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber'][0]) { - list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -23875,14 +29078,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber'][0]) { - $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberRequest($start_date, $end_date); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -23925,6 +29129,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23937,6 +29156,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23949,6 +29183,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23961,6 +29210,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -23975,6 +29239,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -24029,13 +29308,14 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberAsync($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber'][0]) { - return $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -24050,14 +29330,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberRequest($start_date, $end_date); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24067,6 +29348,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -24097,18 +29381,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberRequest($start_date, $end_date) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumberRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedByPhoneNumber' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -24116,6 +29403,7 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy ); } + $resourcePath = '/v2/analytics/paymentObjectBroadcasts/count/phoneNumber/scheduled'; $formParams = []; $queryParams = []; @@ -24124,41 +29412,32 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -24176,12 +29455,12 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -24197,10 +29476,11 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -24215,14 +29495,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledCountPartitionedBy * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -24235,14 +29516,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -24285,6 +29567,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -24297,6 +29594,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -24309,6 +29621,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -24321,6 +29648,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -24335,6 +29677,21 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -24391,13 +29748,14 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -24414,14 +29772,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24431,6 +29790,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -24463,30 +29825,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -24494,6 +29861,7 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione ); } + $resourcePath = '/v2/analytics/paymentObjectBroadcasts/sms/count/date/scheduled'; $formParams = []; $queryParams = []; @@ -24502,63 +29870,50 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -24576,12 +29931,12 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -24597,10 +29952,11 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -24615,14 +29971,15 @@ public function fetchAnalyticsPaymentObjectBroadcastsScheduledSMSCountPartitione * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -24635,14 +29992,15 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDate($start_ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -24685,6 +30043,21 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -24697,6 +30070,21 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -24709,6 +30097,21 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -24721,6 +30124,21 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -24735,6 +30153,21 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateWithHttp $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -24791,13 +30224,14 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateWithHttp * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -24814,14 +30248,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -24831,6 +30266,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -24863,30 +30301,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsSentOutboundMessagesCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsSentOutboundMessagesCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsSentOutboundMessagesCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -24894,6 +30337,7 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateRequest( ); } + $resourcePath = '/v2/analytics/outboundSMS/count/date/sent'; $formParams = []; $queryParams = []; @@ -24902,63 +30346,50 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateRequest( $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -24976,12 +30407,12 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateRequest( // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -24997,10 +30428,11 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateRequest( $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -25013,14 +30445,15 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByDateRequest( * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber($start_date, $end_date) + public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber'][0]) { - list($response) = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -25031,14 +30464,15 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber( * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber'][0]) { - $request = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date); + $request = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -25081,6 +30515,21 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25093,6 +30542,21 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25105,6 +30569,21 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25117,6 +30596,21 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25131,6 +30625,21 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberW $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25185,13 +30694,14 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberW * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberAsync($start_date, $end_date) + public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber'][0]) { - return $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -25206,14 +30716,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date); + $request = $this->fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25223,6 +30734,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -25253,18 +30767,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date) + public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumber' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -25272,6 +30789,7 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberR ); } + $resourcePath = '/v2/analytics/outboundSMS/count/phoneNumber/sent'; $formParams = []; $queryParams = []; @@ -25280,41 +30798,32 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberR $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -25332,12 +30841,12 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberR // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -25353,10 +30862,11 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberR $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -25368,14 +30878,15 @@ public function fetchAnalyticsSentOutboundMessagesCountPartitionedByPhoneNumberR * Fetch a static voucher's wallet page views * * @param mixed $voucher_id voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsStaticVoucherWalletPageViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTWalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsStaticVoucherWalletPageViews($voucher_id) + public function fetchAnalyticsStaticVoucherWalletPageViews($voucher_id, string $contentType = self::contentTypes['fetchAnalyticsStaticVoucherWalletPageViews'][0]) { - list($response) = $this->fetchAnalyticsStaticVoucherWalletPageViewsWithHttpInfo($voucher_id); + list($response) = $this->fetchAnalyticsStaticVoucherWalletPageViewsWithHttpInfo($voucher_id, $contentType); return $response; } @@ -25385,14 +30896,15 @@ public function fetchAnalyticsStaticVoucherWalletPageViews($voucher_id) * Fetch a static voucher's wallet page views * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsStaticVoucherWalletPageViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTWalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsStaticVoucherWalletPageViewsWithHttpInfo($voucher_id) + public function fetchAnalyticsStaticVoucherWalletPageViewsWithHttpInfo($voucher_id, string $contentType = self::contentTypes['fetchAnalyticsStaticVoucherWalletPageViews'][0]) { - $request = $this->fetchAnalyticsStaticVoucherWalletPageViewsRequest($voucher_id); + $request = $this->fetchAnalyticsStaticVoucherWalletPageViewsRequest($voucher_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -25435,6 +30947,21 @@ public function fetchAnalyticsStaticVoucherWalletPageViewsWithHttpInfo($voucher_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTWalletPageView[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25447,6 +30974,21 @@ public function fetchAnalyticsStaticVoucherWalletPageViewsWithHttpInfo($voucher_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25459,6 +31001,21 @@ public function fetchAnalyticsStaticVoucherWalletPageViewsWithHttpInfo($voucher_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25471,6 +31028,21 @@ public function fetchAnalyticsStaticVoucherWalletPageViewsWithHttpInfo($voucher_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25485,6 +31057,21 @@ public function fetchAnalyticsStaticVoucherWalletPageViewsWithHttpInfo($voucher_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25538,13 +31125,14 @@ public function fetchAnalyticsStaticVoucherWalletPageViewsWithHttpInfo($voucher_ * Fetch a static voucher's wallet page views * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsStaticVoucherWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsStaticVoucherWalletPageViewsAsync($voucher_id) + public function fetchAnalyticsStaticVoucherWalletPageViewsAsync($voucher_id, string $contentType = self::contentTypes['fetchAnalyticsStaticVoucherWalletPageViews'][0]) { - return $this->fetchAnalyticsStaticVoucherWalletPageViewsAsyncWithHttpInfo($voucher_id) + return $this->fetchAnalyticsStaticVoucherWalletPageViewsAsyncWithHttpInfo($voucher_id, $contentType) ->then( function ($response) { return $response[0]; @@ -25558,14 +31146,15 @@ function ($response) { * Fetch a static voucher's wallet page views * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsStaticVoucherWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsStaticVoucherWalletPageViewsAsyncWithHttpInfo($voucher_id) + public function fetchAnalyticsStaticVoucherWalletPageViewsAsyncWithHttpInfo($voucher_id, string $contentType = self::contentTypes['fetchAnalyticsStaticVoucherWalletPageViews'][0]) { $returnType = '\OpenAPI\Client\Model\WTWalletPageView[]'; - $request = $this->fetchAnalyticsStaticVoucherWalletPageViewsRequest($voucher_id); + $request = $this->fetchAnalyticsStaticVoucherWalletPageViewsRequest($voucher_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25575,6 +31164,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -25604,12 +31196,14 @@ function ($exception) { * Create request for operation 'fetchAnalyticsStaticVoucherWalletPageViews' * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsStaticVoucherWalletPageViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsStaticVoucherWalletPageViewsRequest($voucher_id) + public function fetchAnalyticsStaticVoucherWalletPageViewsRequest($voucher_id, string $contentType = self::contentTypes['fetchAnalyticsStaticVoucherWalletPageViews'][0]) { + // verify the required parameter 'voucher_id' is set if ($voucher_id === null || (is_array($voucher_id) && count($voucher_id) === 0)) { throw new \InvalidArgumentException( @@ -25617,6 +31211,7 @@ public function fetchAnalyticsStaticVoucherWalletPageViewsRequest($voucher_id) ); } + $resourcePath = '/v2/analytics/walletPageViews/staticVoucher/{voucherID}'; $formParams = []; $queryParams = []; @@ -25636,16 +31231,11 @@ public function fetchAnalyticsStaticVoucherWalletPageViewsRequest($voucher_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -25663,12 +31253,12 @@ public function fetchAnalyticsStaticVoucherWalletPageViewsRequest($voucher_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -25684,10 +31274,11 @@ public function fetchAnalyticsStaticVoucherWalletPageViewsRequest($voucher_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -25700,14 +31291,15 @@ public function fetchAnalyticsStaticVoucherWalletPageViewsRequest($voucher_id) * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate($start_date, $end_date) + public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -25718,14 +31310,15 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate($start_dat * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateRequest($start_date, $end_date); + $request = $this->fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -25768,6 +31361,21 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25780,6 +31388,21 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25792,6 +31415,21 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25804,6 +31442,21 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25818,6 +31471,21 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -25872,13 +31540,14 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateWithHttpInf * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateAsync($start_date, $end_date) + public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -25893,14 +31562,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateRequest($start_date, $end_date); + $request = $this->fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -25910,6 +31580,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -25940,18 +31613,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateRequest($start_date, $end_date) + public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsTCPAFiltersCreateCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -25959,6 +31635,7 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateRequest($st ); } + $resourcePath = '/v2/analytics/tcpafilters/count/date/create'; $formParams = []; $queryParams = []; @@ -25967,41 +31644,32 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateRequest($st $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -26019,12 +31687,12 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateRequest($st // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -26040,10 +31708,11 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateRequest($st $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -26056,14 +31725,15 @@ public function fetchAnalyticsTCPAFiltersCreateCountPartitionedByDateRequest($st * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate($start_date, $end_date) + public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -26074,14 +31744,15 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate($start_dat * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateRequest($start_date, $end_date); + $request = $this->fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -26124,6 +31795,21 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26136,6 +31822,21 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26148,6 +31849,21 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26160,6 +31876,21 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26174,6 +31905,21 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateWithHttpInf $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26228,13 +31974,14 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateWithHttpInf * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateAsync($start_date, $end_date) + public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -26249,14 +31996,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateRequest($start_date, $end_date); + $request = $this->fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26266,6 +32014,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -26296,18 +32047,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateRequest($start_date, $end_date) + public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -26315,6 +32069,7 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateRequest($st ); } + $resourcePath = '/v2/analytics/tcpafilters/count/date/delete'; $formParams = []; $queryParams = []; @@ -26323,41 +32078,32 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateRequest($st $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -26375,12 +32121,12 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateRequest($st // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -26396,10 +32142,11 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateRequest($st $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -26414,14 +32161,15 @@ public function fetchAnalyticsTCPAFiltersDeleteCountPartitionedByDateRequest($st * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsTCPAStopCountPartitionedByDate($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTCPAStopCountPartitionedByDate($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByDate'][0]) { - list($response) = $this->fetchAnalyticsTCPAStopCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsTCPAStopCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -26434,14 +32182,15 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDate($start_date, $end_d * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByDate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsTCPAStopCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTCPAStopCountPartitionedByDateWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByDate'][0]) { - $request = $this->fetchAnalyticsTCPAStopCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTCPAStopCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -26484,6 +32233,21 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDateWithHttpInfo($start_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26496,6 +32260,21 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDateWithHttpInfo($start_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26508,6 +32287,21 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDateWithHttpInfo($start_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26520,6 +32314,21 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDateWithHttpInfo($start_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26534,6 +32343,21 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDateWithHttpInfo($start_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26590,13 +32414,14 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDateWithHttpInfo($start_ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTCPAStopCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTCPAStopCountPartitionedByDateAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByDate'][0]) { - return $this->fetchAnalyticsTCPAStopCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsTCPAStopCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -26613,14 +32438,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTCPAStopCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTCPAStopCountPartitionedByDateAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByDate'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsTCPAStopCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTCPAStopCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -26630,6 +32456,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -26662,30 +32491,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByDate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsTCPAStopCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTCPAStopCountPartitionedByDateRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByDate'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsTCPAStopCountPartitionedByDate' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsTCPAStopCountPartitionedByDate' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsTCPAStopCountPartitionedByDate' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -26693,6 +32527,7 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDateRequest($start_date, ); } + $resourcePath = '/v2/analytics/tcpa/count/date/stop'; $formParams = []; $queryParams = []; @@ -26701,63 +32536,50 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDateRequest($start_date, $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -26775,12 +32597,12 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDateRequest($start_date, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -26796,10 +32618,11 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDateRequest($start_date, $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -26812,14 +32635,15 @@ public function fetchAnalyticsTCPAStopCountPartitionedByDateRequest($start_date, * * @param \DateTime $start_date start_date (required) * @param \DateTime $end_date end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber($start_date, $end_date) + public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber'][0]) { - list($response) = $this->fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date); + list($response) = $this->fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -26830,14 +32654,15 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber($start_date, * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber'][0]) { - $request = $this->fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberRequest($start_date, $end_date); + $request = $this->fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -26880,6 +32705,21 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberWithHttpInfo( $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26892,6 +32732,21 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberWithHttpInfo( $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26904,6 +32759,21 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberWithHttpInfo( $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26916,6 +32786,21 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberWithHttpInfo( $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26930,6 +32815,21 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberWithHttpInfo( $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -26984,13 +32884,14 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberWithHttpInfo( * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberAsync($start_date, $end_date) + public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberAsync($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber'][0]) { - return $this->fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date) + return $this->fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -27005,14 +32906,15 @@ function ($response) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date) + public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberAsyncWithHttpInfo($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberRequest($start_date, $end_date); + $request = $this->fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27022,6 +32924,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -27052,18 +32957,21 @@ function ($exception) { * * @param \DateTime $start_date (required) * @param \DateTime $end_date (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberRequest($start_date, $end_date) + public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberRequest($start_date, $end_date, string $contentType = self::contentTypes['fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsTCPAStopCountPartitionedByPhoneNumber' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -27071,6 +32979,7 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberRequest($star ); } + $resourcePath = '/v2/analytics/tcpa/count/phoneNumber/stop'; $formParams = []; $queryParams = []; @@ -27079,41 +32988,32 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberRequest($star $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -27131,12 +33031,12 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberRequest($star // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -27152,10 +33052,11 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberRequest($star $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -27170,14 +33071,15 @@ public function fetchAnalyticsTCPAStopCountPartitionedByPhoneNumberRequest($star * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsTotalAmountRedeemedPerMerchantCredit($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRedeemedPerMerchantCredit($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerMerchantCredit'][0]) { - list($response) = $this->fetchAnalyticsTotalAmountRedeemedPerMerchantCreditWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsTotalAmountRedeemedPerMerchantCreditWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -27190,14 +33092,15 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCredit($start_date, * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerMerchantCredit'][0]) { - $request = $this->fetchAnalyticsTotalAmountRedeemedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalAmountRedeemedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -27240,6 +33143,21 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -27252,6 +33170,21 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -27264,6 +33197,21 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -27276,6 +33224,21 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -27290,6 +33253,21 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -27346,13 +33324,14 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditWithHttpInfo($ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerMerchantCredit'][0]) { - return $this->fetchAnalyticsTotalAmountRedeemedPerMerchantCreditAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsTotalAmountRedeemedPerMerchantCreditAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -27369,14 +33348,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerMerchantCredit'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsTotalAmountRedeemedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalAmountRedeemedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27386,6 +33366,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -27418,30 +33401,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerMerchantCredit'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsTotalAmountRedeemedPerMerchantCredit' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsTotalAmountRedeemedPerMerchantCredit' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsTotalAmountRedeemedPerMerchantCredit' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -27449,6 +33437,7 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditRequest($start ); } + $resourcePath = '/v2/analytics/membership/merchantCredit/amount/redeemed'; $formParams = []; $queryParams = []; @@ -27457,63 +33446,50 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditRequest($start $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -27531,12 +33507,12 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditRequest($start // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -27552,10 +33528,11 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditRequest($start $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -27570,14 +33547,15 @@ public function fetchAnalyticsTotalAmountRedeemedPerMerchantCreditRequest($start * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsTotalAmountRedeemedPerTier($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRedeemedPerTier($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerTier'][0]) { - list($response) = $this->fetchAnalyticsTotalAmountRedeemedPerTierWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsTotalAmountRedeemedPerTierWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -27590,14 +33568,15 @@ public function fetchAnalyticsTotalAmountRedeemedPerTier($start_date, $end_date, * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsTotalAmountRedeemedPerTierWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRedeemedPerTierWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerTier'][0]) { - $request = $this->fetchAnalyticsTotalAmountRedeemedPerTierRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalAmountRedeemedPerTierRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -27640,6 +33619,21 @@ public function fetchAnalyticsTotalAmountRedeemedPerTierWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -27652,6 +33646,21 @@ public function fetchAnalyticsTotalAmountRedeemedPerTierWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -27664,6 +33673,21 @@ public function fetchAnalyticsTotalAmountRedeemedPerTierWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -27676,6 +33700,21 @@ public function fetchAnalyticsTotalAmountRedeemedPerTierWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -27690,6 +33729,21 @@ public function fetchAnalyticsTotalAmountRedeemedPerTierWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -27746,13 +33800,14 @@ public function fetchAnalyticsTotalAmountRedeemedPerTierWithHttpInfo($start_date * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalAmountRedeemedPerTierAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRedeemedPerTierAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerTier'][0]) { - return $this->fetchAnalyticsTotalAmountRedeemedPerTierAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsTotalAmountRedeemedPerTierAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -27769,14 +33824,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalAmountRedeemedPerTierAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRedeemedPerTierAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerTier'][0]) { $returnType = '\OpenAPI\Client\Model\MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate[]'; - $request = $this->fetchAnalyticsTotalAmountRedeemedPerTierRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalAmountRedeemedPerTierRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -27786,6 +33842,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -27818,30 +33877,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsTotalAmountRedeemedPerTierRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRedeemedPerTierRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRedeemedPerTier'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsTotalAmountRedeemedPerTier' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsTotalAmountRedeemedPerTier' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsTotalAmountRedeemedPerTier' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -27849,6 +33913,7 @@ public function fetchAnalyticsTotalAmountRedeemedPerTierRequest($start_date, $en ); } + $resourcePath = '/v2/analytics/membership/tier/amount/redeemed'; $formParams = []; $queryParams = []; @@ -27857,63 +33922,50 @@ public function fetchAnalyticsTotalAmountRedeemedPerTierRequest($start_date, $en $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -27931,12 +33983,12 @@ public function fetchAnalyticsTotalAmountRedeemedPerTierRequest($start_date, $en // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -27952,10 +34004,11 @@ public function fetchAnalyticsTotalAmountRedeemedPerTierRequest($start_date, $en $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -27970,14 +34023,15 @@ public function fetchAnalyticsTotalAmountRedeemedPerTierRequest($start_date, $en * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRefundedPerMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsTotalAmountRefundedPerMerchantCredit($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRefundedPerMerchantCredit($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRefundedPerMerchantCredit'][0]) { - list($response) = $this->fetchAnalyticsTotalAmountRefundedPerMerchantCreditWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsTotalAmountRefundedPerMerchantCreditWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -27990,14 +34044,15 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCredit($start_date, * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRefundedPerMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRefundedPerMerchantCredit'][0]) { - $request = $this->fetchAnalyticsTotalAmountRefundedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalAmountRefundedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -28040,6 +34095,21 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28052,6 +34122,21 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28064,6 +34149,21 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28076,6 +34176,21 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28090,6 +34205,21 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditWithHttpInfo($ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28146,13 +34276,14 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditWithHttpInfo($ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRefundedPerMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRefundedPerMerchantCredit'][0]) { - return $this->fetchAnalyticsTotalAmountRefundedPerMerchantCreditAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsTotalAmountRefundedPerMerchantCreditAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -28169,14 +34300,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRefundedPerMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRefundedPerMerchantCredit'][0]) { $returnType = 'mixed'; - $request = $this->fetchAnalyticsTotalAmountRefundedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalAmountRefundedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28186,6 +34318,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -28218,30 +34353,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRefundedPerMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRefundedPerMerchantCredit'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsTotalAmountRefundedPerMerchantCredit' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsTotalAmountRefundedPerMerchantCredit' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsTotalAmountRefundedPerMerchantCredit' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -28249,6 +34389,7 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditRequest($start ); } + $resourcePath = '/v2/analytics/membership/merchantCredit/amount/refunded'; $formParams = []; $queryParams = []; @@ -28257,63 +34398,50 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditRequest($start $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -28331,12 +34459,12 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditRequest($start // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -28352,10 +34480,11 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditRequest($start $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -28370,14 +34499,15 @@ public function fetchAnalyticsTotalAmountRefundedPerMerchantCreditRequest($start * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRefundedPerTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MSAnalyticsMembershipTierAmountRefundedPartitionedByDate[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsTotalAmountRefundedPerTier($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRefundedPerTier($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRefundedPerTier'][0]) { - list($response) = $this->fetchAnalyticsTotalAmountRefundedPerTierWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsTotalAmountRefundedPerTierWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -28390,14 +34520,15 @@ public function fetchAnalyticsTotalAmountRefundedPerTier($start_date, $end_date, * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRefundedPerTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MSAnalyticsMembershipTierAmountRefundedPartitionedByDate[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsTotalAmountRefundedPerTierWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRefundedPerTierWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRefundedPerTier'][0]) { - $request = $this->fetchAnalyticsTotalAmountRefundedPerTierRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalAmountRefundedPerTierRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -28440,6 +34571,21 @@ public function fetchAnalyticsTotalAmountRefundedPerTierWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MSAnalyticsMembershipTierAmountRefundedPartitionedByDate[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28452,6 +34598,21 @@ public function fetchAnalyticsTotalAmountRefundedPerTierWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28464,6 +34625,21 @@ public function fetchAnalyticsTotalAmountRefundedPerTierWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28476,6 +34652,21 @@ public function fetchAnalyticsTotalAmountRefundedPerTierWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28490,6 +34681,21 @@ public function fetchAnalyticsTotalAmountRefundedPerTierWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28546,13 +34752,14 @@ public function fetchAnalyticsTotalAmountRefundedPerTierWithHttpInfo($start_date * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRefundedPerTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalAmountRefundedPerTierAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRefundedPerTierAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRefundedPerTier'][0]) { - return $this->fetchAnalyticsTotalAmountRefundedPerTierAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsTotalAmountRefundedPerTierAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -28569,14 +34776,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRefundedPerTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalAmountRefundedPerTierAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRefundedPerTierAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRefundedPerTier'][0]) { $returnType = '\OpenAPI\Client\Model\MSAnalyticsMembershipTierAmountRefundedPartitionedByDate[]'; - $request = $this->fetchAnalyticsTotalAmountRefundedPerTierRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalAmountRefundedPerTierRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28586,6 +34794,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -28618,30 +34829,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalAmountRefundedPerTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsTotalAmountRefundedPerTierRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalAmountRefundedPerTierRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalAmountRefundedPerTier'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsTotalAmountRefundedPerTier' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsTotalAmountRefundedPerTier' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsTotalAmountRefundedPerTier' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -28649,6 +34865,7 @@ public function fetchAnalyticsTotalAmountRefundedPerTierRequest($start_date, $en ); } + $resourcePath = '/v2/analytics/membership/tier/amount/refunded'; $formParams = []; $queryParams = []; @@ -28657,63 +34874,50 @@ public function fetchAnalyticsTotalAmountRefundedPerTierRequest($start_date, $en $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -28731,12 +34935,12 @@ public function fetchAnalyticsTotalAmountRefundedPerTierRequest($start_date, $en // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -28752,10 +34956,11 @@ public function fetchAnalyticsTotalAmountRefundedPerTierRequest($start_date, $en $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -28770,14 +34975,15 @@ public function fetchAnalyticsTotalAmountRefundedPerTierRequest($start_date, $en * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalPointsRedeemed'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MSAnalyticsMemberPointsRedeemedPartitionedByDate[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsTotalPointsRedeemed($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalPointsRedeemed($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalPointsRedeemed'][0]) { - list($response) = $this->fetchAnalyticsTotalPointsRedeemedWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsTotalPointsRedeemedWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -28790,14 +34996,15 @@ public function fetchAnalyticsTotalPointsRedeemed($start_date, $end_date, $local * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalPointsRedeemed'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MSAnalyticsMemberPointsRedeemedPartitionedByDate[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsTotalPointsRedeemedWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalPointsRedeemedWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalPointsRedeemed'][0]) { - $request = $this->fetchAnalyticsTotalPointsRedeemedRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalPointsRedeemedRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -28840,6 +35047,21 @@ public function fetchAnalyticsTotalPointsRedeemedWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MSAnalyticsMemberPointsRedeemedPartitionedByDate[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28852,6 +35074,21 @@ public function fetchAnalyticsTotalPointsRedeemedWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28864,6 +35101,21 @@ public function fetchAnalyticsTotalPointsRedeemedWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28876,6 +35128,21 @@ public function fetchAnalyticsTotalPointsRedeemedWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28890,6 +35157,21 @@ public function fetchAnalyticsTotalPointsRedeemedWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -28946,13 +35228,14 @@ public function fetchAnalyticsTotalPointsRedeemedWithHttpInfo($start_date, $end_ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalPointsRedeemed'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalPointsRedeemedAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalPointsRedeemedAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalPointsRedeemed'][0]) { - return $this->fetchAnalyticsTotalPointsRedeemedAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsTotalPointsRedeemedAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -28969,14 +35252,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalPointsRedeemed'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalPointsRedeemedAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalPointsRedeemedAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalPointsRedeemed'][0]) { $returnType = '\OpenAPI\Client\Model\MSAnalyticsMemberPointsRedeemedPartitionedByDate[]'; - $request = $this->fetchAnalyticsTotalPointsRedeemedRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalPointsRedeemedRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -28986,6 +35270,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -29018,30 +35305,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalPointsRedeemed'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsTotalPointsRedeemedRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalPointsRedeemedRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalPointsRedeemed'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsTotalPointsRedeemed' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsTotalPointsRedeemed' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsTotalPointsRedeemed' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -29049,6 +35341,7 @@ public function fetchAnalyticsTotalPointsRedeemedRequest($start_date, $end_date, ); } + $resourcePath = '/v2/analytics/membership/member/points/redeemed'; $formParams = []; $queryParams = []; @@ -29057,63 +35350,50 @@ public function fetchAnalyticsTotalPointsRedeemedRequest($start_date, $end_date, $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -29131,12 +35411,12 @@ public function fetchAnalyticsTotalPointsRedeemedRequest($start_date, $end_date, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -29152,10 +35432,11 @@ public function fetchAnalyticsTotalPointsRedeemedRequest($start_date, $end_date, $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -29170,14 +35451,15 @@ public function fetchAnalyticsTotalPointsRedeemedRequest($start_date, $end_date, * @param \DateTime $end_date end_date (required) * @param string $locale locale (required) * @param string $timezone timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalPointsRefunded'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MSAnalyticsMemberPointsRefundedPartitionedByDate[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsTotalPointsRefunded($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalPointsRefunded($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalPointsRefunded'][0]) { - list($response) = $this->fetchAnalyticsTotalPointsRefundedWithHttpInfo($start_date, $end_date, $locale, $timezone); + list($response) = $this->fetchAnalyticsTotalPointsRefundedWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType); return $response; } @@ -29190,14 +35472,15 @@ public function fetchAnalyticsTotalPointsRefunded($start_date, $end_date, $local * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalPointsRefunded'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MSAnalyticsMemberPointsRefundedPartitionedByDate[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsTotalPointsRefundedWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalPointsRefundedWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalPointsRefunded'][0]) { - $request = $this->fetchAnalyticsTotalPointsRefundedRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalPointsRefundedRequest($start_date, $end_date, $locale, $timezone, $contentType); try { $options = $this->createHttpClientOption(); @@ -29240,6 +35523,21 @@ public function fetchAnalyticsTotalPointsRefundedWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MSAnalyticsMemberPointsRefundedPartitionedByDate[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29252,6 +35550,21 @@ public function fetchAnalyticsTotalPointsRefundedWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29264,6 +35577,21 @@ public function fetchAnalyticsTotalPointsRefundedWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29276,6 +35604,21 @@ public function fetchAnalyticsTotalPointsRefundedWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29290,6 +35633,21 @@ public function fetchAnalyticsTotalPointsRefundedWithHttpInfo($start_date, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29346,13 +35704,14 @@ public function fetchAnalyticsTotalPointsRefundedWithHttpInfo($start_date, $end_ * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalPointsRefunded'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalPointsRefundedAsync($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalPointsRefundedAsync($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalPointsRefunded'][0]) { - return $this->fetchAnalyticsTotalPointsRefundedAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + return $this->fetchAnalyticsTotalPointsRefundedAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, $contentType) ->then( function ($response) { return $response[0]; @@ -29369,14 +35728,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalPointsRefunded'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsTotalPointsRefundedAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalPointsRefundedAsyncWithHttpInfo($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalPointsRefunded'][0]) { $returnType = '\OpenAPI\Client\Model\MSAnalyticsMemberPointsRefundedPartitionedByDate[]'; - $request = $this->fetchAnalyticsTotalPointsRefundedRequest($start_date, $end_date, $locale, $timezone); + $request = $this->fetchAnalyticsTotalPointsRefundedRequest($start_date, $end_date, $locale, $timezone, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29386,6 +35746,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -29418,30 +35781,35 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $locale (required) * @param string $timezone (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsTotalPointsRefunded'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsTotalPointsRefundedRequest($start_date, $end_date, $locale, $timezone) + public function fetchAnalyticsTotalPointsRefundedRequest($start_date, $end_date, $locale, $timezone, string $contentType = self::contentTypes['fetchAnalyticsTotalPointsRefunded'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling fetchAnalyticsTotalPointsRefunded' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date when calling fetchAnalyticsTotalPointsRefunded' ); } + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling fetchAnalyticsTotalPointsRefunded' ); } + // verify the required parameter 'timezone' is set if ($timezone === null || (is_array($timezone) && count($timezone) === 0)) { throw new \InvalidArgumentException( @@ -29449,6 +35817,7 @@ public function fetchAnalyticsTotalPointsRefundedRequest($start_date, $end_date, ); } + $resourcePath = '/v2/analytics/membership/member/points/refunded'; $formParams = []; $queryParams = []; @@ -29457,63 +35826,50 @@ public function fetchAnalyticsTotalPointsRefundedRequest($start_date, $end_date, $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($timezone !== null) { - if('form' === 'form' && is_array($timezone)) { - foreach($timezone as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['timezone'] = $timezone; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $timezone, + 'timezone', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -29531,12 +35887,12 @@ public function fetchAnalyticsTotalPointsRefundedRequest($start_date, $end_date, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -29552,10 +35908,11 @@ public function fetchAnalyticsTotalPointsRefundedRequest($start_date, $end_date, $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -29567,14 +35924,15 @@ public function fetchAnalyticsTotalPointsRefundedRequest($start_date, $end_date, * Fetch session activity * * @param string $session_id session_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsWalletSessionActivity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTWalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAnalyticsWalletSessionActivity($session_id) + public function fetchAnalyticsWalletSessionActivity($session_id, string $contentType = self::contentTypes['fetchAnalyticsWalletSessionActivity'][0]) { - list($response) = $this->fetchAnalyticsWalletSessionActivityWithHttpInfo($session_id); + list($response) = $this->fetchAnalyticsWalletSessionActivityWithHttpInfo($session_id, $contentType); return $response; } @@ -29584,14 +35942,15 @@ public function fetchAnalyticsWalletSessionActivity($session_id) * Fetch session activity * * @param string $session_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsWalletSessionActivity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTWalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAnalyticsWalletSessionActivityWithHttpInfo($session_id) + public function fetchAnalyticsWalletSessionActivityWithHttpInfo($session_id, string $contentType = self::contentTypes['fetchAnalyticsWalletSessionActivity'][0]) { - $request = $this->fetchAnalyticsWalletSessionActivityRequest($session_id); + $request = $this->fetchAnalyticsWalletSessionActivityRequest($session_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -29634,6 +35993,21 @@ public function fetchAnalyticsWalletSessionActivityWithHttpInfo($session_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTWalletPageView[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29646,6 +36020,21 @@ public function fetchAnalyticsWalletSessionActivityWithHttpInfo($session_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29658,6 +36047,21 @@ public function fetchAnalyticsWalletSessionActivityWithHttpInfo($session_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29670,6 +36074,21 @@ public function fetchAnalyticsWalletSessionActivityWithHttpInfo($session_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29684,6 +36103,21 @@ public function fetchAnalyticsWalletSessionActivityWithHttpInfo($session_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29737,13 +36171,14 @@ public function fetchAnalyticsWalletSessionActivityWithHttpInfo($session_id) * Fetch session activity * * @param string $session_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsWalletSessionActivity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsWalletSessionActivityAsync($session_id) + public function fetchAnalyticsWalletSessionActivityAsync($session_id, string $contentType = self::contentTypes['fetchAnalyticsWalletSessionActivity'][0]) { - return $this->fetchAnalyticsWalletSessionActivityAsyncWithHttpInfo($session_id) + return $this->fetchAnalyticsWalletSessionActivityAsyncWithHttpInfo($session_id, $contentType) ->then( function ($response) { return $response[0]; @@ -29757,14 +36192,15 @@ function ($response) { * Fetch session activity * * @param string $session_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsWalletSessionActivity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAnalyticsWalletSessionActivityAsyncWithHttpInfo($session_id) + public function fetchAnalyticsWalletSessionActivityAsyncWithHttpInfo($session_id, string $contentType = self::contentTypes['fetchAnalyticsWalletSessionActivity'][0]) { $returnType = '\OpenAPI\Client\Model\WTWalletPageView[]'; - $request = $this->fetchAnalyticsWalletSessionActivityRequest($session_id); + $request = $this->fetchAnalyticsWalletSessionActivityRequest($session_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -29774,6 +36210,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -29803,12 +36242,14 @@ function ($exception) { * Create request for operation 'fetchAnalyticsWalletSessionActivity' * * @param string $session_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAnalyticsWalletSessionActivity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAnalyticsWalletSessionActivityRequest($session_id) + public function fetchAnalyticsWalletSessionActivityRequest($session_id, string $contentType = self::contentTypes['fetchAnalyticsWalletSessionActivity'][0]) { + // verify the required parameter 'session_id' is set if ($session_id === null || (is_array($session_id) && count($session_id) === 0)) { throw new \InvalidArgumentException( @@ -29816,6 +36257,7 @@ public function fetchAnalyticsWalletSessionActivityRequest($session_id) ); } + $resourcePath = '/v2/analytics/walletPageViews/session/activity/{sessionID}'; $formParams = []; $queryParams = []; @@ -29835,16 +36277,11 @@ public function fetchAnalyticsWalletSessionActivityRequest($session_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -29862,12 +36299,12 @@ public function fetchAnalyticsWalletSessionActivityRequest($session_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -29883,10 +36320,11 @@ public function fetchAnalyticsWalletSessionActivityRequest($session_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -29898,14 +36336,15 @@ public function fetchAnalyticsWalletSessionActivityRequest($session_id) * Fetch session activity by wallet page view ID * * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPageViewByID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WalletPageView|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchWalletPageViewByID($id) + public function fetchWalletPageViewByID($id, string $contentType = self::contentTypes['fetchWalletPageViewByID'][0]) { - list($response) = $this->fetchWalletPageViewByIDWithHttpInfo($id); + list($response) = $this->fetchWalletPageViewByIDWithHttpInfo($id, $contentType); return $response; } @@ -29915,14 +36354,15 @@ public function fetchWalletPageViewByID($id) * Fetch session activity by wallet page view ID * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPageViewByID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WalletPageView|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchWalletPageViewByIDWithHttpInfo($id) + public function fetchWalletPageViewByIDWithHttpInfo($id, string $contentType = self::contentTypes['fetchWalletPageViewByID'][0]) { - $request = $this->fetchWalletPageViewByIDRequest($id); + $request = $this->fetchWalletPageViewByIDRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -29965,6 +36405,21 @@ public function fetchWalletPageViewByIDWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WalletPageView' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29977,6 +36432,21 @@ public function fetchWalletPageViewByIDWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -29989,6 +36459,21 @@ public function fetchWalletPageViewByIDWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30001,6 +36486,21 @@ public function fetchWalletPageViewByIDWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30015,6 +36515,21 @@ public function fetchWalletPageViewByIDWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30068,13 +36583,14 @@ public function fetchWalletPageViewByIDWithHttpInfo($id) * Fetch session activity by wallet page view ID * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPageViewByID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletPageViewByIDAsync($id) + public function fetchWalletPageViewByIDAsync($id, string $contentType = self::contentTypes['fetchWalletPageViewByID'][0]) { - return $this->fetchWalletPageViewByIDAsyncWithHttpInfo($id) + return $this->fetchWalletPageViewByIDAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -30088,14 +36604,15 @@ function ($response) { * Fetch session activity by wallet page view ID * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPageViewByID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletPageViewByIDAsyncWithHttpInfo($id) + public function fetchWalletPageViewByIDAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchWalletPageViewByID'][0]) { $returnType = '\OpenAPI\Client\Model\WalletPageView'; - $request = $this->fetchWalletPageViewByIDRequest($id); + $request = $this->fetchWalletPageViewByIDRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30105,6 +36622,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -30134,12 +36654,14 @@ function ($exception) { * Create request for operation 'fetchWalletPageViewByID' * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPageViewByID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchWalletPageViewByIDRequest($id) + public function fetchWalletPageViewByIDRequest($id, string $contentType = self::contentTypes['fetchWalletPageViewByID'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -30147,6 +36669,7 @@ public function fetchWalletPageViewByIDRequest($id) ); } + $resourcePath = '/v2/analytics/walletPageViews/activity/{id}'; $formParams = []; $queryParams = []; @@ -30166,16 +36689,11 @@ public function fetchWalletPageViewByIDRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -30193,12 +36711,12 @@ public function fetchWalletPageViewByIDRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -30214,10 +36732,11 @@ public function fetchWalletPageViewByIDRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -30230,14 +36749,15 @@ public function fetchWalletPageViewByIDRequest($id) * * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['referringSitesSummary'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function referringSitesSummary($start_date = null, $end_date = null) + public function referringSitesSummary($start_date = null, $end_date = null, string $contentType = self::contentTypes['referringSitesSummary'][0]) { - list($response) = $this->referringSitesSummaryWithHttpInfo($start_date, $end_date); + list($response) = $this->referringSitesSummaryWithHttpInfo($start_date, $end_date, $contentType); return $response; } @@ -30248,14 +36768,15 @@ public function referringSitesSummary($start_date = null, $end_date = null) * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['referringSitesSummary'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function referringSitesSummaryWithHttpInfo($start_date = null, $end_date = null) + public function referringSitesSummaryWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['referringSitesSummary'][0]) { - $request = $this->referringSitesSummaryRequest($start_date, $end_date); + $request = $this->referringSitesSummaryRequest($start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -30298,6 +36819,21 @@ public function referringSitesSummaryWithHttpInfo($start_date = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30310,6 +36846,21 @@ public function referringSitesSummaryWithHttpInfo($start_date = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30322,6 +36873,21 @@ public function referringSitesSummaryWithHttpInfo($start_date = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30334,6 +36900,21 @@ public function referringSitesSummaryWithHttpInfo($start_date = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30348,6 +36929,21 @@ public function referringSitesSummaryWithHttpInfo($start_date = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30402,13 +36998,14 @@ public function referringSitesSummaryWithHttpInfo($start_date = null, $end_date * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['referringSitesSummary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function referringSitesSummaryAsync($start_date = null, $end_date = null) + public function referringSitesSummaryAsync($start_date = null, $end_date = null, string $contentType = self::contentTypes['referringSitesSummary'][0]) { - return $this->referringSitesSummaryAsyncWithHttpInfo($start_date, $end_date) + return $this->referringSitesSummaryAsyncWithHttpInfo($start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -30423,14 +37020,15 @@ function ($response) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['referringSitesSummary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function referringSitesSummaryAsyncWithHttpInfo($start_date = null, $end_date = null) + public function referringSitesSummaryAsyncWithHttpInfo($start_date = null, $end_date = null, string $contentType = self::contentTypes['referringSitesSummary'][0]) { $returnType = 'mixed'; - $request = $this->referringSitesSummaryRequest($start_date, $end_date); + $request = $this->referringSitesSummaryRequest($start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30440,6 +37038,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -30470,13 +37071,17 @@ function ($exception) { * * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['referringSitesSummary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function referringSitesSummaryRequest($start_date = null, $end_date = null) + public function referringSitesSummaryRequest($start_date = null, $end_date = null, string $contentType = self::contentTypes['referringSitesSummary'][0]) { + + + $resourcePath = '/v2/analytics/walletPageViews/referringSitesSummary'; $formParams = []; $queryParams = []; @@ -30485,41 +37090,32 @@ public function referringSitesSummaryRequest($start_date = null, $end_date = nul $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -30537,12 +37133,12 @@ public function referringSitesSummaryRequest($start_date = null, $end_date = nul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -30558,10 +37154,11 @@ public function referringSitesSummaryRequest($start_date = null, $end_date = nul $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -30576,14 +37173,15 @@ public function referringSitesSummaryRequest($start_date = null, $end_date = nul * @param \DateTime $end_date end_date (required) * @param string $transaction_type transaction_type (optional) * @param string $segment_type segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sumRevenue'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function sumRevenue($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function sumRevenue($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['sumRevenue'][0]) { - list($response) = $this->sumRevenueWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type); + list($response) = $this->sumRevenueWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type, $contentType); return $response; } @@ -30596,14 +37194,15 @@ public function sumRevenue($start_date, $end_date, $transaction_type = null, $se * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sumRevenue'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function sumRevenueWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function sumRevenueWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['sumRevenue'][0]) { - $request = $this->sumRevenueRequest($start_date, $end_date, $transaction_type, $segment_type); + $request = $this->sumRevenueRequest($start_date, $end_date, $transaction_type, $segment_type, $contentType); try { $options = $this->createHttpClientOption(); @@ -30646,6 +37245,21 @@ public function sumRevenueWithHttpInfo($start_date, $end_date, $transaction_type $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30658,6 +37272,21 @@ public function sumRevenueWithHttpInfo($start_date, $end_date, $transaction_type $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30670,6 +37299,21 @@ public function sumRevenueWithHttpInfo($start_date, $end_date, $transaction_type $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30682,6 +37326,21 @@ public function sumRevenueWithHttpInfo($start_date, $end_date, $transaction_type $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30696,6 +37355,21 @@ public function sumRevenueWithHttpInfo($start_date, $end_date, $transaction_type $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -30752,13 +37426,14 @@ public function sumRevenueWithHttpInfo($start_date, $end_date, $transaction_type * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sumRevenue'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sumRevenueAsync($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function sumRevenueAsync($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['sumRevenue'][0]) { - return $this->sumRevenueAsyncWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type) + return $this->sumRevenueAsyncWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type, $contentType) ->then( function ($response) { return $response[0]; @@ -30775,14 +37450,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sumRevenue'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sumRevenueAsyncWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function sumRevenueAsyncWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['sumRevenue'][0]) { $returnType = 'mixed'; - $request = $this->sumRevenueRequest($start_date, $end_date, $transaction_type, $segment_type); + $request = $this->sumRevenueRequest($start_date, $end_date, $transaction_type, $segment_type, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -30792,6 +37468,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -30824,18 +37503,21 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sumRevenue'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sumRevenueRequest($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function sumRevenueRequest($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['sumRevenue'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling sumRevenue' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -30843,6 +37525,9 @@ public function sumRevenueRequest($start_date, $end_date, $transaction_type = nu ); } + + + $resourcePath = '/v2/analytics/ledger/revenue/sum'; $formParams = []; $queryParams = []; @@ -30851,63 +37536,50 @@ public function sumRevenueRequest($start_date, $end_date, $transaction_type = nu $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($transaction_type !== null) { - if('form' === 'form' && is_array($transaction_type)) { - foreach($transaction_type as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['transactionType'] = $transaction_type; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $transaction_type, + 'transactionType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($segment_type !== null) { - if('form' === 'form' && is_array($segment_type)) { - foreach($segment_type as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['segmentType'] = $segment_type; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $segment_type, + 'segmentType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -30925,12 +37597,12 @@ public function sumRevenueRequest($start_date, $end_date, $transaction_type = nu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -30946,10 +37618,11 @@ public function sumRevenueRequest($start_date, $end_date, $transaction_type = nu $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -30964,14 +37637,15 @@ public function sumRevenueRequest($start_date, $end_date, $transaction_type = nu * @param \DateTime $end_date end_date (required) * @param string $transaction_type transaction_type (optional) * @param string $segment_type segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sumTransactions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function sumTransactions($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function sumTransactions($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['sumTransactions'][0]) { - list($response) = $this->sumTransactionsWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type); + list($response) = $this->sumTransactionsWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type, $contentType); return $response; } @@ -30984,14 +37658,15 @@ public function sumTransactions($start_date, $end_date, $transaction_type = null * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sumTransactions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function sumTransactionsWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function sumTransactionsWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['sumTransactions'][0]) { - $request = $this->sumTransactionsRequest($start_date, $end_date, $transaction_type, $segment_type); + $request = $this->sumTransactionsRequest($start_date, $end_date, $transaction_type, $segment_type, $contentType); try { $options = $this->createHttpClientOption(); @@ -31034,6 +37709,21 @@ public function sumTransactionsWithHttpInfo($start_date, $end_date, $transaction $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -31046,6 +37736,21 @@ public function sumTransactionsWithHttpInfo($start_date, $end_date, $transaction $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -31058,6 +37763,21 @@ public function sumTransactionsWithHttpInfo($start_date, $end_date, $transaction $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -31070,6 +37790,21 @@ public function sumTransactionsWithHttpInfo($start_date, $end_date, $transaction $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -31084,6 +37819,21 @@ public function sumTransactionsWithHttpInfo($start_date, $end_date, $transaction $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -31140,13 +37890,14 @@ public function sumTransactionsWithHttpInfo($start_date, $end_date, $transaction * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sumTransactions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sumTransactionsAsync($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function sumTransactionsAsync($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['sumTransactions'][0]) { - return $this->sumTransactionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type) + return $this->sumTransactionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type, $segment_type, $contentType) ->then( function ($response) { return $response[0]; @@ -31163,14 +37914,15 @@ function ($response) { * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sumTransactions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sumTransactionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function sumTransactionsAsyncWithHttpInfo($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['sumTransactions'][0]) { $returnType = 'mixed'; - $request = $this->sumTransactionsRequest($start_date, $end_date, $transaction_type, $segment_type); + $request = $this->sumTransactionsRequest($start_date, $end_date, $transaction_type, $segment_type, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -31180,6 +37932,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -31212,18 +37967,21 @@ function ($exception) { * @param \DateTime $end_date (required) * @param string $transaction_type (optional) * @param string $segment_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sumTransactions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sumTransactionsRequest($start_date, $end_date, $transaction_type = null, $segment_type = null) + public function sumTransactionsRequest($start_date, $end_date, $transaction_type = null, $segment_type = null, string $contentType = self::contentTypes['sumTransactions'][0]) { + // verify the required parameter 'start_date' is set if ($start_date === null || (is_array($start_date) && count($start_date) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date when calling sumTransactions' ); } + // verify the required parameter 'end_date' is set if ($end_date === null || (is_array($end_date) && count($end_date) === 0)) { throw new \InvalidArgumentException( @@ -31231,6 +37989,9 @@ public function sumTransactionsRequest($start_date, $end_date, $transaction_type ); } + + + $resourcePath = '/v2/analytics/ledger/transactions/sum'; $formParams = []; $queryParams = []; @@ -31239,63 +38000,50 @@ public function sumTransactionsRequest($start_date, $end_date, $transaction_type $multipart = false; // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($transaction_type !== null) { - if('form' === 'form' && is_array($transaction_type)) { - foreach($transaction_type as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['transactionType'] = $transaction_type; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $transaction_type, + 'transactionType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($segment_type !== null) { - if('form' === 'form' && is_array($segment_type)) { - foreach($segment_type as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['segmentType'] = $segment_type; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $segment_type, + 'segmentType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -31313,12 +38061,12 @@ public function sumTransactionsRequest($start_date, $end_date, $transaction_type // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -31334,10 +38082,11 @@ public function sumTransactionsRequest($start_date, $end_date, $transaction_type $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/AppleWalletSubscribersApi.php b/lib/Api/AppleWalletSubscribersApi.php index 91a4f0d..12ffa38 100644 --- a/lib/Api/AppleWalletSubscribersApi.php +++ b/lib/Api/AppleWalletSubscribersApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'fetchAppleWalletSubscribers' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +132,15 @@ public function getConfig() * Fetch subscriber activity * * @param mixed $subscription_id subscription_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAppleWalletSubscriberActivity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAppleWalletSubscriberActivity($subscription_id) + public function fetchAppleWalletSubscriberActivity($subscription_id, string $contentType = self::contentTypes['fetchAppleWalletSubscriberActivity'][0]) { - list($response) = $this->fetchAppleWalletSubscriberActivityWithHttpInfo($subscription_id); + list($response) = $this->fetchAppleWalletSubscriberActivityWithHttpInfo($subscription_id, $contentType); return $response; } @@ -139,14 +150,15 @@ public function fetchAppleWalletSubscriberActivity($subscription_id) * Fetch subscriber activity * * @param mixed $subscription_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAppleWalletSubscriberActivity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAppleWalletSubscriberActivityWithHttpInfo($subscription_id) + public function fetchAppleWalletSubscriberActivityWithHttpInfo($subscription_id, string $contentType = self::contentTypes['fetchAppleWalletSubscriberActivity'][0]) { - $request = $this->fetchAppleWalletSubscriberActivityRequest($subscription_id); + $request = $this->fetchAppleWalletSubscriberActivityRequest($subscription_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +201,21 @@ public function fetchAppleWalletSubscriberActivityWithHttpInfo($subscription_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +228,21 @@ public function fetchAppleWalletSubscriberActivityWithHttpInfo($subscription_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +255,21 @@ public function fetchAppleWalletSubscriberActivityWithHttpInfo($subscription_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +282,21 @@ public function fetchAppleWalletSubscriberActivityWithHttpInfo($subscription_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +311,21 @@ public function fetchAppleWalletSubscriberActivityWithHttpInfo($subscription_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +379,14 @@ public function fetchAppleWalletSubscriberActivityWithHttpInfo($subscription_id) * Fetch subscriber activity * * @param mixed $subscription_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAppleWalletSubscriberActivity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAppleWalletSubscriberActivityAsync($subscription_id) + public function fetchAppleWalletSubscriberActivityAsync($subscription_id, string $contentType = self::contentTypes['fetchAppleWalletSubscriberActivity'][0]) { - return $this->fetchAppleWalletSubscriberActivityAsyncWithHttpInfo($subscription_id) + return $this->fetchAppleWalletSubscriberActivityAsyncWithHttpInfo($subscription_id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +400,15 @@ function ($response) { * Fetch subscriber activity * * @param mixed $subscription_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAppleWalletSubscriberActivity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAppleWalletSubscriberActivityAsyncWithHttpInfo($subscription_id) + public function fetchAppleWalletSubscriberActivityAsyncWithHttpInfo($subscription_id, string $contentType = self::contentTypes['fetchAppleWalletSubscriberActivity'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAppleWalletSubscriberActivityRequest($subscription_id); + $request = $this->fetchAppleWalletSubscriberActivityRequest($subscription_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +418,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +450,14 @@ function ($exception) { * Create request for operation 'fetchAppleWalletSubscriberActivity' * * @param mixed $subscription_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAppleWalletSubscriberActivity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAppleWalletSubscriberActivityRequest($subscription_id) + public function fetchAppleWalletSubscriberActivityRequest($subscription_id, string $contentType = self::contentTypes['fetchAppleWalletSubscriberActivity'][0]) { + // verify the required parameter 'subscription_id' is set if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +465,7 @@ public function fetchAppleWalletSubscriberActivityRequest($subscription_id) ); } + $resourcePath = '/v2/apple/wallet/pass/subscriber/activity/{subscriptionID}'; $formParams = []; $queryParams = []; @@ -390,16 +485,11 @@ public function fetchAppleWalletSubscriberActivityRequest($subscription_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +507,12 @@ public function fetchAppleWalletSubscriberActivityRequest($subscription_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +528,11 @@ public function fetchAppleWalletSubscriberActivityRequest($subscription_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -454,14 +545,15 @@ public function fetchAppleWalletSubscriberActivityRequest($subscription_id) * * @param \DateTime $start_date_time start_date_time (optional) * @param \DateTime $end_date_time end_date_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAppleWalletSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAppleWalletSubscribers($start_date_time = null, $end_date_time = null) + public function fetchAppleWalletSubscribers($start_date_time = null, $end_date_time = null, string $contentType = self::contentTypes['fetchAppleWalletSubscribers'][0]) { - list($response) = $this->fetchAppleWalletSubscribersWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchAppleWalletSubscribersWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -472,14 +564,15 @@ public function fetchAppleWalletSubscribers($start_date_time = null, $end_date_t * * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAppleWalletSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAppleWalletSubscribersWithHttpInfo($start_date_time = null, $end_date_time = null) + public function fetchAppleWalletSubscribersWithHttpInfo($start_date_time = null, $end_date_time = null, string $contentType = self::contentTypes['fetchAppleWalletSubscribers'][0]) { - $request = $this->fetchAppleWalletSubscribersRequest($start_date_time, $end_date_time); + $request = $this->fetchAppleWalletSubscribersRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -522,6 +615,21 @@ public function fetchAppleWalletSubscribersWithHttpInfo($start_date_time = null, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -534,6 +642,21 @@ public function fetchAppleWalletSubscribersWithHttpInfo($start_date_time = null, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -546,6 +669,21 @@ public function fetchAppleWalletSubscribersWithHttpInfo($start_date_time = null, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -558,6 +696,21 @@ public function fetchAppleWalletSubscribersWithHttpInfo($start_date_time = null, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -572,6 +725,21 @@ public function fetchAppleWalletSubscribersWithHttpInfo($start_date_time = null, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -626,13 +794,14 @@ public function fetchAppleWalletSubscribersWithHttpInfo($start_date_time = null, * * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAppleWalletSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAppleWalletSubscribersAsync($start_date_time = null, $end_date_time = null) + public function fetchAppleWalletSubscribersAsync($start_date_time = null, $end_date_time = null, string $contentType = self::contentTypes['fetchAppleWalletSubscribers'][0]) { - return $this->fetchAppleWalletSubscribersAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchAppleWalletSubscribersAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -647,14 +816,15 @@ function ($response) { * * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAppleWalletSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAppleWalletSubscribersAsyncWithHttpInfo($start_date_time = null, $end_date_time = null) + public function fetchAppleWalletSubscribersAsyncWithHttpInfo($start_date_time = null, $end_date_time = null, string $contentType = self::contentTypes['fetchAppleWalletSubscribers'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAppleWalletSubscribersRequest($start_date_time, $end_date_time); + $request = $this->fetchAppleWalletSubscribersRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -664,6 +834,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -694,13 +867,17 @@ function ($exception) { * * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAppleWalletSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAppleWalletSubscribersRequest($start_date_time = null, $end_date_time = null) + public function fetchAppleWalletSubscribersRequest($start_date_time = null, $end_date_time = null, string $contentType = self::contentTypes['fetchAppleWalletSubscribers'][0]) { + + + $resourcePath = '/v2/apple/wallet/pass/subscribers/all'; $formParams = []; $queryParams = []; @@ -709,41 +886,32 @@ public function fetchAppleWalletSubscribersRequest($start_date_time = null, $end $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -761,12 +929,12 @@ public function fetchAppleWalletSubscribersRequest($start_date_time = null, $end // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -782,10 +950,11 @@ public function fetchAppleWalletSubscribersRequest($start_date_time = null, $end $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/BillingApi.php b/lib/Api/BillingApi.php index ef65dd0..ba12015 100644 --- a/lib/Api/BillingApi.php +++ b/lib/Api/BillingApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'buySpecialOffer' => [ + 'application/json', + ], + 'cancelPlan' => [ + 'application/json', + ], + 'changePlan' => [ + 'application/json', + ], + 'fetchAddOns' => [ + 'application/json', + ], + 'fetchIndustry' => [ + 'application/json', + ], + 'fetchInvoices' => [ + 'application/json', + ], + 'fetchSpecialOffers' => [ + 'application/json', + ], + 'fetchSubscription' => [ + 'application/json', + ], + 'fetchUsageSummary' => [ + 'application/json', + ], + 'savePaymentMethod' => [ + 'application/json', + ], + 'upcomingInvoices' => [ + 'application/json', + ], + 'verifyPaymentMethod' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +165,15 @@ public function getConfig() * Fetch add-on products, or 1-time purchase products (non-subscription products) * * @param string $product_id product_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['buyAddOn'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function buyAddOn($product_id) + public function buyAddOn($product_id, string $contentType = self::contentTypes['buyAddOn'][0]) { - list($response) = $this->buyAddOnWithHttpInfo($product_id); + list($response) = $this->buyAddOnWithHttpInfo($product_id, $contentType); return $response; } @@ -139,14 +183,15 @@ public function buyAddOn($product_id) * Fetch add-on products, or 1-time purchase products (non-subscription products) * * @param string $product_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['buyAddOn'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function buyAddOnWithHttpInfo($product_id) + public function buyAddOnWithHttpInfo($product_id, string $contentType = self::contentTypes['buyAddOn'][0]) { - $request = $this->buyAddOnRequest($product_id); + $request = $this->buyAddOnRequest($product_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +234,21 @@ public function buyAddOnWithHttpInfo($product_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +261,21 @@ public function buyAddOnWithHttpInfo($product_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +288,21 @@ public function buyAddOnWithHttpInfo($product_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +315,21 @@ public function buyAddOnWithHttpInfo($product_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +344,21 @@ public function buyAddOnWithHttpInfo($product_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +412,14 @@ public function buyAddOnWithHttpInfo($product_id) * Fetch add-on products, or 1-time purchase products (non-subscription products) * * @param string $product_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['buyAddOn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function buyAddOnAsync($product_id) + public function buyAddOnAsync($product_id, string $contentType = self::contentTypes['buyAddOn'][0]) { - return $this->buyAddOnAsyncWithHttpInfo($product_id) + return $this->buyAddOnAsyncWithHttpInfo($product_id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +433,15 @@ function ($response) { * Fetch add-on products, or 1-time purchase products (non-subscription products) * * @param string $product_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['buyAddOn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function buyAddOnAsyncWithHttpInfo($product_id) + public function buyAddOnAsyncWithHttpInfo($product_id, string $contentType = self::contentTypes['buyAddOn'][0]) { $returnType = 'mixed'; - $request = $this->buyAddOnRequest($product_id); + $request = $this->buyAddOnRequest($product_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +451,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +483,14 @@ function ($exception) { * Create request for operation 'buyAddOn' * * @param string $product_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['buyAddOn'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function buyAddOnRequest($product_id) + public function buyAddOnRequest($product_id, string $contentType = self::contentTypes['buyAddOn'][0]) { + // verify the required parameter 'product_id' is set if ($product_id === null || (is_array($product_id) && count($product_id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +498,7 @@ public function buyAddOnRequest($product_id) ); } + $resourcePath = '/v2/billing/products/addOns/{productID}'; $formParams = []; $queryParams = []; @@ -390,16 +518,11 @@ public function buyAddOnRequest($product_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +540,12 @@ public function buyAddOnRequest($product_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +561,11 @@ public function buyAddOnRequest($product_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +577,15 @@ public function buyAddOnRequest($product_id) * Buy special offer * * @param string $product_id product_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['buySpecialOffer'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function buySpecialOffer($product_id) + public function buySpecialOffer($product_id, string $contentType = self::contentTypes['buySpecialOffer'][0]) { - list($response) = $this->buySpecialOfferWithHttpInfo($product_id); + list($response) = $this->buySpecialOfferWithHttpInfo($product_id, $contentType); return $response; } @@ -470,14 +595,15 @@ public function buySpecialOffer($product_id) * Buy special offer * * @param string $product_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['buySpecialOffer'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function buySpecialOfferWithHttpInfo($product_id) + public function buySpecialOfferWithHttpInfo($product_id, string $contentType = self::contentTypes['buySpecialOffer'][0]) { - $request = $this->buySpecialOfferRequest($product_id); + $request = $this->buySpecialOfferRequest($product_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +646,21 @@ public function buySpecialOfferWithHttpInfo($product_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +673,21 @@ public function buySpecialOfferWithHttpInfo($product_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +700,21 @@ public function buySpecialOfferWithHttpInfo($product_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +727,21 @@ public function buySpecialOfferWithHttpInfo($product_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +756,21 @@ public function buySpecialOfferWithHttpInfo($product_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +824,14 @@ public function buySpecialOfferWithHttpInfo($product_id) * Buy special offer * * @param string $product_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['buySpecialOffer'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function buySpecialOfferAsync($product_id) + public function buySpecialOfferAsync($product_id, string $contentType = self::contentTypes['buySpecialOffer'][0]) { - return $this->buySpecialOfferAsyncWithHttpInfo($product_id) + return $this->buySpecialOfferAsyncWithHttpInfo($product_id, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +845,15 @@ function ($response) { * Buy special offer * * @param string $product_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['buySpecialOffer'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function buySpecialOfferAsyncWithHttpInfo($product_id) + public function buySpecialOfferAsyncWithHttpInfo($product_id, string $contentType = self::contentTypes['buySpecialOffer'][0]) { $returnType = 'mixed'; - $request = $this->buySpecialOfferRequest($product_id); + $request = $this->buySpecialOfferRequest($product_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +863,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +895,14 @@ function ($exception) { * Create request for operation 'buySpecialOffer' * * @param string $product_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['buySpecialOffer'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function buySpecialOfferRequest($product_id) + public function buySpecialOfferRequest($product_id, string $contentType = self::contentTypes['buySpecialOffer'][0]) { + // verify the required parameter 'product_id' is set if ($product_id === null || (is_array($product_id) && count($product_id) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +910,7 @@ public function buySpecialOfferRequest($product_id) ); } + $resourcePath = '/v2/billing/products/specialOffers/{productID}'; $formParams = []; $queryParams = []; @@ -721,16 +930,11 @@ public function buySpecialOfferRequest($product_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -748,12 +952,12 @@ public function buySpecialOfferRequest($product_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -769,10 +973,11 @@ public function buySpecialOfferRequest($product_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -783,14 +988,15 @@ public function buySpecialOfferRequest($product_id) * * Cancel billing plan and revert to default * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelPlan'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function cancelPlan() + public function cancelPlan(string $contentType = self::contentTypes['cancelPlan'][0]) { - list($response) = $this->cancelPlanWithHttpInfo(); + list($response) = $this->cancelPlanWithHttpInfo($contentType); return $response; } @@ -799,14 +1005,15 @@ public function cancelPlan() * * Cancel billing plan and revert to default * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelPlan'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function cancelPlanWithHttpInfo() + public function cancelPlanWithHttpInfo(string $contentType = self::contentTypes['cancelPlan'][0]) { - $request = $this->cancelPlanRequest(); + $request = $this->cancelPlanRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1056,21 @@ public function cancelPlanWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1083,21 @@ public function cancelPlanWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1110,21 @@ public function cancelPlanWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1137,21 @@ public function cancelPlanWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1166,21 @@ public function cancelPlanWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -951,13 +1233,14 @@ public function cancelPlanWithHttpInfo() * * Cancel billing plan and revert to default * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelPlan'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function cancelPlanAsync() + public function cancelPlanAsync(string $contentType = self::contentTypes['cancelPlan'][0]) { - return $this->cancelPlanAsyncWithHttpInfo() + return $this->cancelPlanAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -970,14 +1253,15 @@ function ($response) { * * Cancel billing plan and revert to default * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelPlan'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function cancelPlanAsyncWithHttpInfo() + public function cancelPlanAsyncWithHttpInfo(string $contentType = self::contentTypes['cancelPlan'][0]) { $returnType = 'mixed'; - $request = $this->cancelPlanRequest(); + $request = $this->cancelPlanRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -987,6 +1271,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1015,13 +1302,15 @@ function ($exception) { /** * Create request for operation 'cancelPlan' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelPlan'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function cancelPlanRequest() + public function cancelPlanRequest(string $contentType = self::contentTypes['cancelPlan'][0]) { + $resourcePath = '/v2/billing/plan'; $formParams = []; $queryParams = []; @@ -1033,16 +1322,11 @@ public function cancelPlanRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1060,12 +1344,12 @@ public function cancelPlanRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1081,10 +1365,11 @@ public function cancelPlanRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1096,14 +1381,15 @@ public function cancelPlanRequest() * Change billing plan * * @param \OpenAPI\Client\Model\WTBillingChangePlan $wt_billing_change_plan wt_billing_change_plan (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changePlan'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function changePlan($wt_billing_change_plan) + public function changePlan($wt_billing_change_plan, string $contentType = self::contentTypes['changePlan'][0]) { - list($response) = $this->changePlanWithHttpInfo($wt_billing_change_plan); + list($response) = $this->changePlanWithHttpInfo($wt_billing_change_plan, $contentType); return $response; } @@ -1113,14 +1399,15 @@ public function changePlan($wt_billing_change_plan) * Change billing plan * * @param \OpenAPI\Client\Model\WTBillingChangePlan $wt_billing_change_plan (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changePlan'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function changePlanWithHttpInfo($wt_billing_change_plan) + public function changePlanWithHttpInfo($wt_billing_change_plan, string $contentType = self::contentTypes['changePlan'][0]) { - $request = $this->changePlanRequest($wt_billing_change_plan); + $request = $this->changePlanRequest($wt_billing_change_plan, $contentType); try { $options = $this->createHttpClientOption(); @@ -1163,6 +1450,21 @@ public function changePlanWithHttpInfo($wt_billing_change_plan) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1175,6 +1477,21 @@ public function changePlanWithHttpInfo($wt_billing_change_plan) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1187,6 +1504,21 @@ public function changePlanWithHttpInfo($wt_billing_change_plan) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1199,6 +1531,21 @@ public function changePlanWithHttpInfo($wt_billing_change_plan) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1560,21 @@ public function changePlanWithHttpInfo($wt_billing_change_plan) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1266,13 +1628,14 @@ public function changePlanWithHttpInfo($wt_billing_change_plan) * Change billing plan * * @param \OpenAPI\Client\Model\WTBillingChangePlan $wt_billing_change_plan (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changePlan'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function changePlanAsync($wt_billing_change_plan) + public function changePlanAsync($wt_billing_change_plan, string $contentType = self::contentTypes['changePlan'][0]) { - return $this->changePlanAsyncWithHttpInfo($wt_billing_change_plan) + return $this->changePlanAsyncWithHttpInfo($wt_billing_change_plan, $contentType) ->then( function ($response) { return $response[0]; @@ -1286,14 +1649,15 @@ function ($response) { * Change billing plan * * @param \OpenAPI\Client\Model\WTBillingChangePlan $wt_billing_change_plan (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changePlan'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function changePlanAsyncWithHttpInfo($wt_billing_change_plan) + public function changePlanAsyncWithHttpInfo($wt_billing_change_plan, string $contentType = self::contentTypes['changePlan'][0]) { $returnType = 'mixed'; - $request = $this->changePlanRequest($wt_billing_change_plan); + $request = $this->changePlanRequest($wt_billing_change_plan, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1303,6 +1667,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1332,12 +1699,14 @@ function ($exception) { * Create request for operation 'changePlan' * * @param \OpenAPI\Client\Model\WTBillingChangePlan $wt_billing_change_plan (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['changePlan'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function changePlanRequest($wt_billing_change_plan) + public function changePlanRequest($wt_billing_change_plan, string $contentType = self::contentTypes['changePlan'][0]) { + // verify the required parameter 'wt_billing_change_plan' is set if ($wt_billing_change_plan === null || (is_array($wt_billing_change_plan) && count($wt_billing_change_plan) === 0)) { throw new \InvalidArgumentException( @@ -1345,6 +1714,7 @@ public function changePlanRequest($wt_billing_change_plan) ); } + $resourcePath = '/v2/billing/plan'; $formParams = []; $queryParams = []; @@ -1356,21 +1726,17 @@ public function changePlanRequest($wt_billing_change_plan) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_billing_change_plan)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_billing_change_plan)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_billing_change_plan)); } else { $httpBody = $wt_billing_change_plan; } @@ -1389,12 +1755,12 @@ public function changePlanRequest($wt_billing_change_plan) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1410,10 +1776,11 @@ public function changePlanRequest($wt_billing_change_plan) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1424,14 +1791,15 @@ public function changePlanRequest($wt_billing_change_plan) * * Fetch add-on products, or 1-time purchase products (non-subscription products) * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAddOns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAddOns() + public function fetchAddOns(string $contentType = self::contentTypes['fetchAddOns'][0]) { - list($response) = $this->fetchAddOnsWithHttpInfo(); + list($response) = $this->fetchAddOnsWithHttpInfo($contentType); return $response; } @@ -1440,14 +1808,15 @@ public function fetchAddOns() * * Fetch add-on products, or 1-time purchase products (non-subscription products) * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAddOns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAddOnsWithHttpInfo() + public function fetchAddOnsWithHttpInfo(string $contentType = self::contentTypes['fetchAddOns'][0]) { - $request = $this->fetchAddOnsRequest(); + $request = $this->fetchAddOnsRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -1490,6 +1859,21 @@ public function fetchAddOnsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1502,6 +1886,21 @@ public function fetchAddOnsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1514,6 +1913,21 @@ public function fetchAddOnsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1526,6 +1940,21 @@ public function fetchAddOnsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1540,6 +1969,21 @@ public function fetchAddOnsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1592,13 +2036,14 @@ public function fetchAddOnsWithHttpInfo() * * Fetch add-on products, or 1-time purchase products (non-subscription products) * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAddOns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAddOnsAsync() + public function fetchAddOnsAsync(string $contentType = self::contentTypes['fetchAddOns'][0]) { - return $this->fetchAddOnsAsyncWithHttpInfo() + return $this->fetchAddOnsAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -1611,14 +2056,15 @@ function ($response) { * * Fetch add-on products, or 1-time purchase products (non-subscription products) * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAddOns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAddOnsAsyncWithHttpInfo() + public function fetchAddOnsAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchAddOns'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAddOnsRequest(); + $request = $this->fetchAddOnsRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1628,6 +2074,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1656,13 +2105,15 @@ function ($exception) { /** * Create request for operation 'fetchAddOns' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAddOns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAddOnsRequest() + public function fetchAddOnsRequest(string $contentType = self::contentTypes['fetchAddOns'][0]) { + $resourcePath = '/v2/billing/products/addOns'; $formParams = []; $queryParams = []; @@ -1674,16 +2125,11 @@ public function fetchAddOnsRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1701,12 +2147,12 @@ public function fetchAddOnsRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1722,10 +2168,11 @@ public function fetchAddOnsRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1736,14 +2183,15 @@ public function fetchAddOnsRequest() * * Fetch merchant's industry * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchIndustry'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse200|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchIndustry200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchIndustry() + public function fetchIndustry(string $contentType = self::contentTypes['fetchIndustry'][0]) { - list($response) = $this->fetchIndustryWithHttpInfo(); + list($response) = $this->fetchIndustryWithHttpInfo($contentType); return $response; } @@ -1752,14 +2200,15 @@ public function fetchIndustry() * * Fetch merchant's industry * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchIndustry'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse200|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchIndustry200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchIndustryWithHttpInfo() + public function fetchIndustryWithHttpInfo(string $contentType = self::contentTypes['fetchIndustry'][0]) { - $request = $this->fetchIndustryRequest(); + $request = $this->fetchIndustryRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -1798,14 +2247,29 @@ public function fetchIndustryWithHttpInfo() switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse200' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchIndustry200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchIndustry200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse200', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchIndustry200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1814,6 +2278,21 @@ public function fetchIndustryWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1826,6 +2305,21 @@ public function fetchIndustryWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1838,6 +2332,21 @@ public function fetchIndustryWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1847,11 +2356,26 @@ public function fetchIndustryWithHttpInfo() ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse200'; + $returnType = '\OpenAPI\Client\Model\FetchIndustry200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1865,7 +2389,7 @@ public function fetchIndustryWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse200', + '\OpenAPI\Client\Model\FetchIndustry200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1904,13 +2428,14 @@ public function fetchIndustryWithHttpInfo() * * Fetch merchant's industry * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchIndustry'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchIndustryAsync() + public function fetchIndustryAsync(string $contentType = self::contentTypes['fetchIndustry'][0]) { - return $this->fetchIndustryAsyncWithHttpInfo() + return $this->fetchIndustryAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -1923,14 +2448,15 @@ function ($response) { * * Fetch merchant's industry * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchIndustry'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchIndustryAsyncWithHttpInfo() + public function fetchIndustryAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchIndustry'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse200'; - $request = $this->fetchIndustryRequest(); + $returnType = '\OpenAPI\Client\Model\FetchIndustry200Response'; + $request = $this->fetchIndustryRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1940,6 +2466,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1968,13 +2497,15 @@ function ($exception) { /** * Create request for operation 'fetchIndustry' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchIndustry'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchIndustryRequest() + public function fetchIndustryRequest(string $contentType = self::contentTypes['fetchIndustry'][0]) { + $resourcePath = '/v2/billing/industry'; $formParams = []; $queryParams = []; @@ -1986,16 +2517,11 @@ public function fetchIndustryRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2013,12 +2539,12 @@ public function fetchIndustryRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2034,10 +2560,11 @@ public function fetchIndustryRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2048,14 +2575,15 @@ public function fetchIndustryRequest() * * Fetch all invoices * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInvoices'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInvoices() + public function fetchInvoices(string $contentType = self::contentTypes['fetchInvoices'][0]) { - list($response) = $this->fetchInvoicesWithHttpInfo(); + list($response) = $this->fetchInvoicesWithHttpInfo($contentType); return $response; } @@ -2064,14 +2592,15 @@ public function fetchInvoices() * * Fetch all invoices * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInvoices'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInvoicesWithHttpInfo() + public function fetchInvoicesWithHttpInfo(string $contentType = self::contentTypes['fetchInvoices'][0]) { - $request = $this->fetchInvoicesRequest(); + $request = $this->fetchInvoicesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -2114,6 +2643,21 @@ public function fetchInvoicesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2126,6 +2670,21 @@ public function fetchInvoicesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2138,6 +2697,21 @@ public function fetchInvoicesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2150,6 +2724,21 @@ public function fetchInvoicesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2164,6 +2753,21 @@ public function fetchInvoicesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2216,13 +2820,14 @@ public function fetchInvoicesWithHttpInfo() * * Fetch all invoices * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInvoices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInvoicesAsync() + public function fetchInvoicesAsync(string $contentType = self::contentTypes['fetchInvoices'][0]) { - return $this->fetchInvoicesAsyncWithHttpInfo() + return $this->fetchInvoicesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -2235,14 +2840,15 @@ function ($response) { * * Fetch all invoices * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInvoices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInvoicesAsyncWithHttpInfo() + public function fetchInvoicesAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchInvoices'][0]) { $returnType = 'mixed'; - $request = $this->fetchInvoicesRequest(); + $request = $this->fetchInvoicesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2252,6 +2858,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2280,13 +2889,15 @@ function ($exception) { /** * Create request for operation 'fetchInvoices' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInvoices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInvoicesRequest() + public function fetchInvoicesRequest(string $contentType = self::contentTypes['fetchInvoices'][0]) { + $resourcePath = '/v2/billing/invoices/all'; $formParams = []; $queryParams = []; @@ -2298,16 +2909,11 @@ public function fetchInvoicesRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2325,12 +2931,12 @@ public function fetchInvoicesRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2346,10 +2952,11 @@ public function fetchInvoicesRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2360,14 +2967,15 @@ public function fetchInvoicesRequest() * * Fetch special offer products * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSpecialOffers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchSpecialOffers() + public function fetchSpecialOffers(string $contentType = self::contentTypes['fetchSpecialOffers'][0]) { - list($response) = $this->fetchSpecialOffersWithHttpInfo(); + list($response) = $this->fetchSpecialOffersWithHttpInfo($contentType); return $response; } @@ -2376,14 +2984,15 @@ public function fetchSpecialOffers() * * Fetch special offer products * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSpecialOffers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchSpecialOffersWithHttpInfo() + public function fetchSpecialOffersWithHttpInfo(string $contentType = self::contentTypes['fetchSpecialOffers'][0]) { - $request = $this->fetchSpecialOffersRequest(); + $request = $this->fetchSpecialOffersRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -2426,6 +3035,21 @@ public function fetchSpecialOffersWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2438,6 +3062,21 @@ public function fetchSpecialOffersWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2450,6 +3089,21 @@ public function fetchSpecialOffersWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2462,6 +3116,21 @@ public function fetchSpecialOffersWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2476,6 +3145,21 @@ public function fetchSpecialOffersWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2528,13 +3212,14 @@ public function fetchSpecialOffersWithHttpInfo() * * Fetch special offer products * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSpecialOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchSpecialOffersAsync() + public function fetchSpecialOffersAsync(string $contentType = self::contentTypes['fetchSpecialOffers'][0]) { - return $this->fetchSpecialOffersAsyncWithHttpInfo() + return $this->fetchSpecialOffersAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -2547,14 +3232,15 @@ function ($response) { * * Fetch special offer products * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSpecialOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchSpecialOffersAsyncWithHttpInfo() + public function fetchSpecialOffersAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchSpecialOffers'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchSpecialOffersRequest(); + $request = $this->fetchSpecialOffersRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2564,6 +3250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2592,13 +3281,15 @@ function ($exception) { /** * Create request for operation 'fetchSpecialOffers' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSpecialOffers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchSpecialOffersRequest() + public function fetchSpecialOffersRequest(string $contentType = self::contentTypes['fetchSpecialOffers'][0]) { + $resourcePath = '/v2/billing/products/specialOffers'; $formParams = []; $queryParams = []; @@ -2610,16 +3301,11 @@ public function fetchSpecialOffersRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2637,12 +3323,12 @@ public function fetchSpecialOffersRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2658,10 +3344,11 @@ public function fetchSpecialOffersRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2672,14 +3359,15 @@ public function fetchSpecialOffersRequest() * * Fetch subscription * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSubscription'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchSubscription() + public function fetchSubscription(string $contentType = self::contentTypes['fetchSubscription'][0]) { - list($response) = $this->fetchSubscriptionWithHttpInfo(); + list($response) = $this->fetchSubscriptionWithHttpInfo($contentType); return $response; } @@ -2688,14 +3376,15 @@ public function fetchSubscription() * * Fetch subscription * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSubscription'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchSubscriptionWithHttpInfo() + public function fetchSubscriptionWithHttpInfo(string $contentType = self::contentTypes['fetchSubscription'][0]) { - $request = $this->fetchSubscriptionRequest(); + $request = $this->fetchSubscriptionRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -2738,6 +3427,21 @@ public function fetchSubscriptionWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2750,6 +3454,21 @@ public function fetchSubscriptionWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2762,6 +3481,21 @@ public function fetchSubscriptionWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2774,6 +3508,21 @@ public function fetchSubscriptionWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2788,6 +3537,21 @@ public function fetchSubscriptionWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2840,13 +3604,14 @@ public function fetchSubscriptionWithHttpInfo() * * Fetch subscription * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSubscription'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchSubscriptionAsync() + public function fetchSubscriptionAsync(string $contentType = self::contentTypes['fetchSubscription'][0]) { - return $this->fetchSubscriptionAsyncWithHttpInfo() + return $this->fetchSubscriptionAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -2859,14 +3624,15 @@ function ($response) { * * Fetch subscription * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSubscription'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchSubscriptionAsyncWithHttpInfo() + public function fetchSubscriptionAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchSubscription'][0]) { $returnType = 'mixed'; - $request = $this->fetchSubscriptionRequest(); + $request = $this->fetchSubscriptionRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2876,6 +3642,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2904,13 +3673,15 @@ function ($exception) { /** * Create request for operation 'fetchSubscription' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSubscription'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchSubscriptionRequest() + public function fetchSubscriptionRequest(string $contentType = self::contentTypes['fetchSubscription'][0]) { + $resourcePath = '/v2/billing/subscription'; $formParams = []; $queryParams = []; @@ -2922,16 +3693,11 @@ public function fetchSubscriptionRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2949,12 +3715,12 @@ public function fetchSubscriptionRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2970,10 +3736,11 @@ public function fetchSubscriptionRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2986,14 +3753,15 @@ public function fetchSubscriptionRequest() * * @param \DateTime $start_date_time start_date_time (optional) * @param \DateTime $end_date_time end_date_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchUsageSummary'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return object|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchUsageSummary($start_date_time = null, $end_date_time = null) + public function fetchUsageSummary($start_date_time = null, $end_date_time = null, string $contentType = self::contentTypes['fetchUsageSummary'][0]) { - list($response) = $this->fetchUsageSummaryWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchUsageSummaryWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -3004,14 +3772,15 @@ public function fetchUsageSummary($start_date_time = null, $end_date_time = null * * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchUsageSummary'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of object|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchUsageSummaryWithHttpInfo($start_date_time = null, $end_date_time = null) + public function fetchUsageSummaryWithHttpInfo($start_date_time = null, $end_date_time = null, string $contentType = self::contentTypes['fetchUsageSummary'][0]) { - $request = $this->fetchUsageSummaryRequest($start_date_time, $end_date_time); + $request = $this->fetchUsageSummaryRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -3054,6 +3823,21 @@ public function fetchUsageSummaryWithHttpInfo($start_date_time = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('object' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3066,6 +3850,21 @@ public function fetchUsageSummaryWithHttpInfo($start_date_time = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3078,6 +3877,21 @@ public function fetchUsageSummaryWithHttpInfo($start_date_time = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3090,6 +3904,21 @@ public function fetchUsageSummaryWithHttpInfo($start_date_time = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3104,6 +3933,21 @@ public function fetchUsageSummaryWithHttpInfo($start_date_time = null, $end_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3158,13 +4002,14 @@ public function fetchUsageSummaryWithHttpInfo($start_date_time = null, $end_date * * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchUsageSummary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchUsageSummaryAsync($start_date_time = null, $end_date_time = null) + public function fetchUsageSummaryAsync($start_date_time = null, $end_date_time = null, string $contentType = self::contentTypes['fetchUsageSummary'][0]) { - return $this->fetchUsageSummaryAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchUsageSummaryAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -3179,14 +4024,15 @@ function ($response) { * * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchUsageSummary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchUsageSummaryAsyncWithHttpInfo($start_date_time = null, $end_date_time = null) + public function fetchUsageSummaryAsyncWithHttpInfo($start_date_time = null, $end_date_time = null, string $contentType = self::contentTypes['fetchUsageSummary'][0]) { $returnType = 'object'; - $request = $this->fetchUsageSummaryRequest($start_date_time, $end_date_time); + $request = $this->fetchUsageSummaryRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3196,6 +4042,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3226,13 +4075,17 @@ function ($exception) { * * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchUsageSummary'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchUsageSummaryRequest($start_date_time = null, $end_date_time = null) + public function fetchUsageSummaryRequest($start_date_time = null, $end_date_time = null, string $contentType = self::contentTypes['fetchUsageSummary'][0]) { + + + $resourcePath = '/v2/billing/summary'; $formParams = []; $queryParams = []; @@ -3241,41 +4094,32 @@ public function fetchUsageSummaryRequest($start_date_time = null, $end_date_time $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3293,12 +4137,12 @@ public function fetchUsageSummaryRequest($start_date_time = null, $end_date_time // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3314,10 +4158,11 @@ public function fetchUsageSummaryRequest($start_date_time = null, $end_date_time $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3329,14 +4174,15 @@ public function fetchUsageSummaryRequest($start_date_time = null, $end_date_time * Save payment method * * @param \OpenAPI\Client\Model\WTBillingSavePaymentMethod $wt_billing_save_payment_method wt_billing_save_payment_method (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['savePaymentMethod'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function savePaymentMethod($wt_billing_save_payment_method) + public function savePaymentMethod($wt_billing_save_payment_method, string $contentType = self::contentTypes['savePaymentMethod'][0]) { - list($response) = $this->savePaymentMethodWithHttpInfo($wt_billing_save_payment_method); + list($response) = $this->savePaymentMethodWithHttpInfo($wt_billing_save_payment_method, $contentType); return $response; } @@ -3346,14 +4192,15 @@ public function savePaymentMethod($wt_billing_save_payment_method) * Save payment method * * @param \OpenAPI\Client\Model\WTBillingSavePaymentMethod $wt_billing_save_payment_method (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['savePaymentMethod'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function savePaymentMethodWithHttpInfo($wt_billing_save_payment_method) + public function savePaymentMethodWithHttpInfo($wt_billing_save_payment_method, string $contentType = self::contentTypes['savePaymentMethod'][0]) { - $request = $this->savePaymentMethodRequest($wt_billing_save_payment_method); + $request = $this->savePaymentMethodRequest($wt_billing_save_payment_method, $contentType); try { $options = $this->createHttpClientOption(); @@ -3396,6 +4243,21 @@ public function savePaymentMethodWithHttpInfo($wt_billing_save_payment_method) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3408,6 +4270,21 @@ public function savePaymentMethodWithHttpInfo($wt_billing_save_payment_method) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3420,6 +4297,21 @@ public function savePaymentMethodWithHttpInfo($wt_billing_save_payment_method) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3432,6 +4324,21 @@ public function savePaymentMethodWithHttpInfo($wt_billing_save_payment_method) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3446,6 +4353,21 @@ public function savePaymentMethodWithHttpInfo($wt_billing_save_payment_method) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3499,13 +4421,14 @@ public function savePaymentMethodWithHttpInfo($wt_billing_save_payment_method) * Save payment method * * @param \OpenAPI\Client\Model\WTBillingSavePaymentMethod $wt_billing_save_payment_method (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['savePaymentMethod'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function savePaymentMethodAsync($wt_billing_save_payment_method) + public function savePaymentMethodAsync($wt_billing_save_payment_method, string $contentType = self::contentTypes['savePaymentMethod'][0]) { - return $this->savePaymentMethodAsyncWithHttpInfo($wt_billing_save_payment_method) + return $this->savePaymentMethodAsyncWithHttpInfo($wt_billing_save_payment_method, $contentType) ->then( function ($response) { return $response[0]; @@ -3519,14 +4442,15 @@ function ($response) { * Save payment method * * @param \OpenAPI\Client\Model\WTBillingSavePaymentMethod $wt_billing_save_payment_method (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['savePaymentMethod'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function savePaymentMethodAsyncWithHttpInfo($wt_billing_save_payment_method) + public function savePaymentMethodAsyncWithHttpInfo($wt_billing_save_payment_method, string $contentType = self::contentTypes['savePaymentMethod'][0]) { $returnType = 'mixed'; - $request = $this->savePaymentMethodRequest($wt_billing_save_payment_method); + $request = $this->savePaymentMethodRequest($wt_billing_save_payment_method, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3536,6 +4460,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3565,12 +4492,14 @@ function ($exception) { * Create request for operation 'savePaymentMethod' * * @param \OpenAPI\Client\Model\WTBillingSavePaymentMethod $wt_billing_save_payment_method (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['savePaymentMethod'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function savePaymentMethodRequest($wt_billing_save_payment_method) + public function savePaymentMethodRequest($wt_billing_save_payment_method, string $contentType = self::contentTypes['savePaymentMethod'][0]) { + // verify the required parameter 'wt_billing_save_payment_method' is set if ($wt_billing_save_payment_method === null || (is_array($wt_billing_save_payment_method) && count($wt_billing_save_payment_method) === 0)) { throw new \InvalidArgumentException( @@ -3578,6 +4507,7 @@ public function savePaymentMethodRequest($wt_billing_save_payment_method) ); } + $resourcePath = '/v2/billing/paymentMethod'; $formParams = []; $queryParams = []; @@ -3589,21 +4519,17 @@ public function savePaymentMethodRequest($wt_billing_save_payment_method) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_billing_save_payment_method)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_billing_save_payment_method)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_billing_save_payment_method)); } else { $httpBody = $wt_billing_save_payment_method; } @@ -3622,12 +4548,12 @@ public function savePaymentMethodRequest($wt_billing_save_payment_method) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3643,10 +4569,11 @@ public function savePaymentMethodRequest($wt_billing_save_payment_method) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3657,14 +4584,15 @@ public function savePaymentMethodRequest($wt_billing_save_payment_method) * * Fetch upcoming invoices * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upcomingInvoices'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function upcomingInvoices() + public function upcomingInvoices(string $contentType = self::contentTypes['upcomingInvoices'][0]) { - list($response) = $this->upcomingInvoicesWithHttpInfo(); + list($response) = $this->upcomingInvoicesWithHttpInfo($contentType); return $response; } @@ -3673,14 +4601,15 @@ public function upcomingInvoices() * * Fetch upcoming invoices * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upcomingInvoices'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function upcomingInvoicesWithHttpInfo() + public function upcomingInvoicesWithHttpInfo(string $contentType = self::contentTypes['upcomingInvoices'][0]) { - $request = $this->upcomingInvoicesRequest(); + $request = $this->upcomingInvoicesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -3723,6 +4652,21 @@ public function upcomingInvoicesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3735,6 +4679,21 @@ public function upcomingInvoicesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3747,6 +4706,21 @@ public function upcomingInvoicesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3759,6 +4733,21 @@ public function upcomingInvoicesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3773,6 +4762,21 @@ public function upcomingInvoicesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3825,13 +4829,14 @@ public function upcomingInvoicesWithHttpInfo() * * Fetch upcoming invoices * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upcomingInvoices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function upcomingInvoicesAsync() + public function upcomingInvoicesAsync(string $contentType = self::contentTypes['upcomingInvoices'][0]) { - return $this->upcomingInvoicesAsyncWithHttpInfo() + return $this->upcomingInvoicesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -3844,14 +4849,15 @@ function ($response) { * * Fetch upcoming invoices * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upcomingInvoices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function upcomingInvoicesAsyncWithHttpInfo() + public function upcomingInvoicesAsyncWithHttpInfo(string $contentType = self::contentTypes['upcomingInvoices'][0]) { $returnType = 'mixed'; - $request = $this->upcomingInvoicesRequest(); + $request = $this->upcomingInvoicesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3861,6 +4867,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3889,13 +4898,15 @@ function ($exception) { /** * Create request for operation 'upcomingInvoices' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['upcomingInvoices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function upcomingInvoicesRequest() + public function upcomingInvoicesRequest(string $contentType = self::contentTypes['upcomingInvoices'][0]) { + $resourcePath = '/v2/billing/invoices/upcoming'; $formParams = []; $queryParams = []; @@ -3907,16 +4918,11 @@ public function upcomingInvoicesRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3934,12 +4940,12 @@ public function upcomingInvoicesRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3955,10 +4961,11 @@ public function upcomingInvoicesRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3969,14 +4976,15 @@ public function upcomingInvoicesRequest() * * Verify payment method * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyPaymentMethod'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTBillingVerifyPaymentMethodResponse|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function verifyPaymentMethod() + public function verifyPaymentMethod(string $contentType = self::contentTypes['verifyPaymentMethod'][0]) { - list($response) = $this->verifyPaymentMethodWithHttpInfo(); + list($response) = $this->verifyPaymentMethodWithHttpInfo($contentType); return $response; } @@ -3985,14 +4993,15 @@ public function verifyPaymentMethod() * * Verify payment method * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyPaymentMethod'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTBillingVerifyPaymentMethodResponse|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function verifyPaymentMethodWithHttpInfo() + public function verifyPaymentMethodWithHttpInfo(string $contentType = self::contentTypes['verifyPaymentMethod'][0]) { - $request = $this->verifyPaymentMethodRequest(); + $request = $this->verifyPaymentMethodRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -4035,6 +5044,21 @@ public function verifyPaymentMethodWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTBillingVerifyPaymentMethodResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4047,6 +5071,21 @@ public function verifyPaymentMethodWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4059,6 +5098,21 @@ public function verifyPaymentMethodWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4071,6 +5125,21 @@ public function verifyPaymentMethodWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4085,6 +5154,21 @@ public function verifyPaymentMethodWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4137,13 +5221,14 @@ public function verifyPaymentMethodWithHttpInfo() * * Verify payment method * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyPaymentMethod'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function verifyPaymentMethodAsync() + public function verifyPaymentMethodAsync(string $contentType = self::contentTypes['verifyPaymentMethod'][0]) { - return $this->verifyPaymentMethodAsyncWithHttpInfo() + return $this->verifyPaymentMethodAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -4156,14 +5241,15 @@ function ($response) { * * Verify payment method * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyPaymentMethod'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function verifyPaymentMethodAsyncWithHttpInfo() + public function verifyPaymentMethodAsyncWithHttpInfo(string $contentType = self::contentTypes['verifyPaymentMethod'][0]) { $returnType = '\OpenAPI\Client\Model\WTBillingVerifyPaymentMethodResponse'; - $request = $this->verifyPaymentMethodRequest(); + $request = $this->verifyPaymentMethodRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4173,6 +5259,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4201,13 +5290,15 @@ function ($exception) { /** * Create request for operation 'verifyPaymentMethod' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['verifyPaymentMethod'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function verifyPaymentMethodRequest() + public function verifyPaymentMethodRequest(string $contentType = self::contentTypes['verifyPaymentMethod'][0]) { + $resourcePath = '/v2/billing/paymentMethod'; $formParams = []; $queryParams = []; @@ -4219,16 +5310,11 @@ public function verifyPaymentMethodRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4246,12 +5332,12 @@ public function verifyPaymentMethodRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4267,10 +5353,11 @@ public function verifyPaymentMethodRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/ClubMembersPointsApi.php b/lib/Api/ClubMembersPointsApi.php index 5332f08..6d64bd6 100644 --- a/lib/Api/ClubMembersPointsApi.php +++ b/lib/Api/ClubMembersPointsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createMember' => [ + 'application/json', + ], + 'fetchMemberById' => [ + 'application/json', + ], + 'fetchMemberHistoryLog' => [ + 'application/json', + ], + 'fetchMemberRedemptionLog' => [ + 'application/json', + ], + 'fetchMembersByPage' => [ + 'application/json', + ], + 'fetchMembersCount' => [ + 'application/json', + ], + 'restoreMember' => [ + 'application/json', + ], + 'searchMembers' => [ + 'application/json', + ], + 'updateMember' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +156,15 @@ public function getConfig() * Archive member * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMember'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMember|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveMember($id) + public function archiveMember($id, string $contentType = self::contentTypes['archiveMember'][0]) { - list($response) = $this->archiveMemberWithHttpInfo($id); + list($response) = $this->archiveMemberWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +174,15 @@ public function archiveMember($id) * Archive member * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMember'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMember|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveMemberWithHttpInfo($id) + public function archiveMemberWithHttpInfo($id, string $contentType = self::contentTypes['archiveMember'][0]) { - $request = $this->archiveMemberRequest($id); + $request = $this->archiveMemberRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +225,21 @@ public function archiveMemberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMember' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +252,21 @@ public function archiveMemberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +279,21 @@ public function archiveMemberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +306,21 @@ public function archiveMemberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +335,21 @@ public function archiveMemberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +403,14 @@ public function archiveMemberWithHttpInfo($id) * Archive member * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveMemberAsync($id) + public function archiveMemberAsync($id, string $contentType = self::contentTypes['archiveMember'][0]) { - return $this->archiveMemberAsyncWithHttpInfo($id) + return $this->archiveMemberAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +424,15 @@ function ($response) { * Archive member * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveMemberAsyncWithHttpInfo($id) + public function archiveMemberAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveMember'][0]) { $returnType = '\OpenAPI\Client\Model\WTMember'; - $request = $this->archiveMemberRequest($id); + $request = $this->archiveMemberRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +442,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +474,14 @@ function ($exception) { * Create request for operation 'archiveMember' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveMemberRequest($id) + public function archiveMemberRequest($id, string $contentType = self::contentTypes['archiveMember'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +489,7 @@ public function archiveMemberRequest($id) ); } + $resourcePath = '/v2/membership/member/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +509,11 @@ public function archiveMemberRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +531,12 @@ public function archiveMemberRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +552,11 @@ public function archiveMemberRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +568,15 @@ public function archiveMemberRequest($id) * Create member * * @param \OpenAPI\Client\Model\WTMemberCreationParams $wt_member_creation_params wt_member_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMember'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMember|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError */ - public function createMember($wt_member_creation_params) + public function createMember($wt_member_creation_params, string $contentType = self::contentTypes['createMember'][0]) { - list($response) = $this->createMemberWithHttpInfo($wt_member_creation_params); + list($response) = $this->createMemberWithHttpInfo($wt_member_creation_params, $contentType); return $response; } @@ -470,14 +586,15 @@ public function createMember($wt_member_creation_params) * Create member * * @param \OpenAPI\Client\Model\WTMemberCreationParams $wt_member_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMember'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMember|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createMemberWithHttpInfo($wt_member_creation_params) + public function createMemberWithHttpInfo($wt_member_creation_params, string $contentType = self::contentTypes['createMember'][0]) { - $request = $this->createMemberRequest($wt_member_creation_params); + $request = $this->createMemberRequest($wt_member_creation_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +637,21 @@ public function createMemberWithHttpInfo($wt_member_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMember' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +664,21 @@ public function createMemberWithHttpInfo($wt_member_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +691,21 @@ public function createMemberWithHttpInfo($wt_member_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +718,21 @@ public function createMemberWithHttpInfo($wt_member_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -568,6 +745,21 @@ public function createMemberWithHttpInfo($wt_member_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantNotInitialized' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -580,6 +772,21 @@ public function createMemberWithHttpInfo($wt_member_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -594,6 +801,21 @@ public function createMemberWithHttpInfo($wt_member_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -663,13 +885,14 @@ public function createMemberWithHttpInfo($wt_member_creation_params) * Create member * * @param \OpenAPI\Client\Model\WTMemberCreationParams $wt_member_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createMemberAsync($wt_member_creation_params) + public function createMemberAsync($wt_member_creation_params, string $contentType = self::contentTypes['createMember'][0]) { - return $this->createMemberAsyncWithHttpInfo($wt_member_creation_params) + return $this->createMemberAsyncWithHttpInfo($wt_member_creation_params, $contentType) ->then( function ($response) { return $response[0]; @@ -683,14 +906,15 @@ function ($response) { * Create member * * @param \OpenAPI\Client\Model\WTMemberCreationParams $wt_member_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createMemberAsyncWithHttpInfo($wt_member_creation_params) + public function createMemberAsyncWithHttpInfo($wt_member_creation_params, string $contentType = self::contentTypes['createMember'][0]) { $returnType = '\OpenAPI\Client\Model\WTMember'; - $request = $this->createMemberRequest($wt_member_creation_params); + $request = $this->createMemberRequest($wt_member_creation_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -700,6 +924,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -729,12 +956,14 @@ function ($exception) { * Create request for operation 'createMember' * * @param \OpenAPI\Client\Model\WTMemberCreationParams $wt_member_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createMemberRequest($wt_member_creation_params) + public function createMemberRequest($wt_member_creation_params, string $contentType = self::contentTypes['createMember'][0]) { + // verify the required parameter 'wt_member_creation_params' is set if ($wt_member_creation_params === null || (is_array($wt_member_creation_params) && count($wt_member_creation_params) === 0)) { throw new \InvalidArgumentException( @@ -742,6 +971,7 @@ public function createMemberRequest($wt_member_creation_params) ); } + $resourcePath = '/v2/membership/member'; $formParams = []; $queryParams = []; @@ -753,21 +983,17 @@ public function createMemberRequest($wt_member_creation_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_member_creation_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_member_creation_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_member_creation_params)); } else { $httpBody = $wt_member_creation_params; } @@ -786,12 +1012,12 @@ public function createMemberRequest($wt_member_creation_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -807,10 +1033,11 @@ public function createMemberRequest($wt_member_creation_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -822,14 +1049,15 @@ public function createMemberRequest($wt_member_creation_params) * Fetch member * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMember|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMemberById($id) + public function fetchMemberById($id, string $contentType = self::contentTypes['fetchMemberById'][0]) { - list($response) = $this->fetchMemberByIdWithHttpInfo($id); + list($response) = $this->fetchMemberByIdWithHttpInfo($id, $contentType); return $response; } @@ -839,14 +1067,15 @@ public function fetchMemberById($id) * Fetch member * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMember|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMemberByIdWithHttpInfo($id) + public function fetchMemberByIdWithHttpInfo($id, string $contentType = self::contentTypes['fetchMemberById'][0]) { - $request = $this->fetchMemberByIdRequest($id); + $request = $this->fetchMemberByIdRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -889,6 +1118,21 @@ public function fetchMemberByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMember' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -901,6 +1145,21 @@ public function fetchMemberByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -913,6 +1172,21 @@ public function fetchMemberByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -925,6 +1199,21 @@ public function fetchMemberByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -939,6 +1228,21 @@ public function fetchMemberByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -992,13 +1296,14 @@ public function fetchMemberByIdWithHttpInfo($id) * Fetch member * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMemberByIdAsync($id) + public function fetchMemberByIdAsync($id, string $contentType = self::contentTypes['fetchMemberById'][0]) { - return $this->fetchMemberByIdAsyncWithHttpInfo($id) + return $this->fetchMemberByIdAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1012,14 +1317,15 @@ function ($response) { * Fetch member * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMemberByIdAsyncWithHttpInfo($id) + public function fetchMemberByIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchMemberById'][0]) { $returnType = '\OpenAPI\Client\Model\WTMember'; - $request = $this->fetchMemberByIdRequest($id); + $request = $this->fetchMemberByIdRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1029,6 +1335,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1058,12 +1367,14 @@ function ($exception) { * Create request for operation 'fetchMemberById' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMemberByIdRequest($id) + public function fetchMemberByIdRequest($id, string $contentType = self::contentTypes['fetchMemberById'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1071,6 +1382,7 @@ public function fetchMemberByIdRequest($id) ); } + $resourcePath = '/v2/membership/member/{id}'; $formParams = []; $queryParams = []; @@ -1090,16 +1402,11 @@ public function fetchMemberByIdRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1117,12 +1424,12 @@ public function fetchMemberByIdRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1138,10 +1445,11 @@ public function fetchMemberByIdRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1153,14 +1461,15 @@ public function fetchMemberByIdRequest($id) * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberHistoryLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MSMemberHistoryPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMemberHistoryLog($pagination_request_with_id_and_without_sort_options) + public function fetchMemberHistoryLog($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMemberHistoryLog'][0]) { - list($response) = $this->fetchMemberHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options); + list($response) = $this->fetchMemberHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType); return $response; } @@ -1170,14 +1479,15 @@ public function fetchMemberHistoryLog($pagination_request_with_id_and_without_so * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberHistoryLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MSMemberHistoryPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMemberHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMemberHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMemberHistoryLog'][0]) { - $request = $this->fetchMemberHistoryLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMemberHistoryLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); try { $options = $this->createHttpClientOption(); @@ -1220,6 +1530,21 @@ public function fetchMemberHistoryLogWithHttpInfo($pagination_request_with_id_an $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MSMemberHistoryPagination' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1232,6 +1557,21 @@ public function fetchMemberHistoryLogWithHttpInfo($pagination_request_with_id_an $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1244,6 +1584,21 @@ public function fetchMemberHistoryLogWithHttpInfo($pagination_request_with_id_an $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1256,6 +1611,21 @@ public function fetchMemberHistoryLogWithHttpInfo($pagination_request_with_id_an $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1270,6 +1640,21 @@ public function fetchMemberHistoryLogWithHttpInfo($pagination_request_with_id_an $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1323,13 +1708,14 @@ public function fetchMemberHistoryLogWithHttpInfo($pagination_request_with_id_an * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberHistoryLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMemberHistoryLogAsync($pagination_request_with_id_and_without_sort_options) + public function fetchMemberHistoryLogAsync($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMemberHistoryLog'][0]) { - return $this->fetchMemberHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + return $this->fetchMemberHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType) ->then( function ($response) { return $response[0]; @@ -1343,14 +1729,15 @@ function ($response) { * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberHistoryLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMemberHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMemberHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMemberHistoryLog'][0]) { $returnType = '\OpenAPI\Client\Model\MSMemberHistoryPagination'; - $request = $this->fetchMemberHistoryLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMemberHistoryLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1360,6 +1747,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1389,12 +1779,14 @@ function ($exception) { * Create request for operation 'fetchMemberHistoryLog' * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberHistoryLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMemberHistoryLogRequest($pagination_request_with_id_and_without_sort_options) + public function fetchMemberHistoryLogRequest($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMemberHistoryLog'][0]) { + // verify the required parameter 'pagination_request_with_id_and_without_sort_options' is set if ($pagination_request_with_id_and_without_sort_options === null || (is_array($pagination_request_with_id_and_without_sort_options) && count($pagination_request_with_id_and_without_sort_options) === 0)) { throw new \InvalidArgumentException( @@ -1402,6 +1794,7 @@ public function fetchMemberHistoryLogRequest($pagination_request_with_id_and_wit ); } + $resourcePath = '/v2/membership/member/history/log'; $formParams = []; $queryParams = []; @@ -1413,21 +1806,17 @@ public function fetchMemberHistoryLogRequest($pagination_request_with_id_and_wit - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pagination_request_with_id_and_without_sort_options)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); } else { $httpBody = $pagination_request_with_id_and_without_sort_options; } @@ -1446,12 +1835,12 @@ public function fetchMemberHistoryLogRequest($pagination_request_with_id_and_wit // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1467,10 +1856,11 @@ public function fetchMemberHistoryLogRequest($pagination_request_with_id_and_wit $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1482,14 +1872,15 @@ public function fetchMemberHistoryLogRequest($pagination_request_with_id_and_wit * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberRedemptionLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MSMemberRedemptionPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMemberRedemptionLog($pagination_request_with_id_and_without_sort_options) + public function fetchMemberRedemptionLog($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMemberRedemptionLog'][0]) { - list($response) = $this->fetchMemberRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options); + list($response) = $this->fetchMemberRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType); return $response; } @@ -1499,14 +1890,15 @@ public function fetchMemberRedemptionLog($pagination_request_with_id_and_without * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberRedemptionLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MSMemberRedemptionPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMemberRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMemberRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMemberRedemptionLog'][0]) { - $request = $this->fetchMemberRedemptionLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMemberRedemptionLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); try { $options = $this->createHttpClientOption(); @@ -1549,6 +1941,21 @@ public function fetchMemberRedemptionLogWithHttpInfo($pagination_request_with_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MSMemberRedemptionPagination' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1561,6 +1968,21 @@ public function fetchMemberRedemptionLogWithHttpInfo($pagination_request_with_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1573,6 +1995,21 @@ public function fetchMemberRedemptionLogWithHttpInfo($pagination_request_with_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1585,6 +2022,21 @@ public function fetchMemberRedemptionLogWithHttpInfo($pagination_request_with_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1599,6 +2051,21 @@ public function fetchMemberRedemptionLogWithHttpInfo($pagination_request_with_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1652,13 +2119,14 @@ public function fetchMemberRedemptionLogWithHttpInfo($pagination_request_with_id * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberRedemptionLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMemberRedemptionLogAsync($pagination_request_with_id_and_without_sort_options) + public function fetchMemberRedemptionLogAsync($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMemberRedemptionLog'][0]) { - return $this->fetchMemberRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + return $this->fetchMemberRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType) ->then( function ($response) { return $response[0]; @@ -1672,14 +2140,15 @@ function ($response) { * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberRedemptionLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMemberRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMemberRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMemberRedemptionLog'][0]) { $returnType = '\OpenAPI\Client\Model\MSMemberRedemptionPagination'; - $request = $this->fetchMemberRedemptionLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMemberRedemptionLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1689,6 +2158,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1718,12 +2190,14 @@ function ($exception) { * Create request for operation 'fetchMemberRedemptionLog' * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberRedemptionLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMemberRedemptionLogRequest($pagination_request_with_id_and_without_sort_options) + public function fetchMemberRedemptionLogRequest($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMemberRedemptionLog'][0]) { + // verify the required parameter 'pagination_request_with_id_and_without_sort_options' is set if ($pagination_request_with_id_and_without_sort_options === null || (is_array($pagination_request_with_id_and_without_sort_options) && count($pagination_request_with_id_and_without_sort_options) === 0)) { throw new \InvalidArgumentException( @@ -1731,6 +2205,7 @@ public function fetchMemberRedemptionLogRequest($pagination_request_with_id_and_ ); } + $resourcePath = '/v2/membership/member/redemption/log'; $formParams = []; $queryParams = []; @@ -1742,21 +2217,17 @@ public function fetchMemberRedemptionLogRequest($pagination_request_with_id_and_ - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pagination_request_with_id_and_without_sort_options)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); } else { $httpBody = $pagination_request_with_id_and_without_sort_options; } @@ -1775,12 +2246,12 @@ public function fetchMemberRedemptionLogRequest($pagination_request_with_id_and_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1796,10 +2267,11 @@ public function fetchMemberRedemptionLogRequest($pagination_request_with_id_and_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1811,14 +2283,15 @@ public function fetchMemberRedemptionLogRequest($pagination_request_with_id_and_ * Fetch members by page * * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptions $pagination_request_with_sort_options pagination_request_with_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembersByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMember[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMembersByPage($pagination_request_with_sort_options) + public function fetchMembersByPage($pagination_request_with_sort_options, string $contentType = self::contentTypes['fetchMembersByPage'][0]) { - list($response) = $this->fetchMembersByPageWithHttpInfo($pagination_request_with_sort_options); + list($response) = $this->fetchMembersByPageWithHttpInfo($pagination_request_with_sort_options, $contentType); return $response; } @@ -1828,14 +2301,15 @@ public function fetchMembersByPage($pagination_request_with_sort_options) * Fetch members by page * * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptions $pagination_request_with_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembersByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMember[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMembersByPageWithHttpInfo($pagination_request_with_sort_options) + public function fetchMembersByPageWithHttpInfo($pagination_request_with_sort_options, string $contentType = self::contentTypes['fetchMembersByPage'][0]) { - $request = $this->fetchMembersByPageRequest($pagination_request_with_sort_options); + $request = $this->fetchMembersByPageRequest($pagination_request_with_sort_options, $contentType); try { $options = $this->createHttpClientOption(); @@ -1878,6 +2352,21 @@ public function fetchMembersByPageWithHttpInfo($pagination_request_with_sort_opt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMember[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1890,6 +2379,21 @@ public function fetchMembersByPageWithHttpInfo($pagination_request_with_sort_opt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1902,6 +2406,21 @@ public function fetchMembersByPageWithHttpInfo($pagination_request_with_sort_opt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1914,6 +2433,21 @@ public function fetchMembersByPageWithHttpInfo($pagination_request_with_sort_opt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1928,6 +2462,21 @@ public function fetchMembersByPageWithHttpInfo($pagination_request_with_sort_opt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1981,13 +2530,14 @@ public function fetchMembersByPageWithHttpInfo($pagination_request_with_sort_opt * Fetch members by page * * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptions $pagination_request_with_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembersByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMembersByPageAsync($pagination_request_with_sort_options) + public function fetchMembersByPageAsync($pagination_request_with_sort_options, string $contentType = self::contentTypes['fetchMembersByPage'][0]) { - return $this->fetchMembersByPageAsyncWithHttpInfo($pagination_request_with_sort_options) + return $this->fetchMembersByPageAsyncWithHttpInfo($pagination_request_with_sort_options, $contentType) ->then( function ($response) { return $response[0]; @@ -2001,14 +2551,15 @@ function ($response) { * Fetch members by page * * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptions $pagination_request_with_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembersByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMembersByPageAsyncWithHttpInfo($pagination_request_with_sort_options) + public function fetchMembersByPageAsyncWithHttpInfo($pagination_request_with_sort_options, string $contentType = self::contentTypes['fetchMembersByPage'][0]) { $returnType = '\OpenAPI\Client\Model\WTMember[]'; - $request = $this->fetchMembersByPageRequest($pagination_request_with_sort_options); + $request = $this->fetchMembersByPageRequest($pagination_request_with_sort_options, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2018,6 +2569,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2047,12 +2601,14 @@ function ($exception) { * Create request for operation 'fetchMembersByPage' * * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptions $pagination_request_with_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembersByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMembersByPageRequest($pagination_request_with_sort_options) + public function fetchMembersByPageRequest($pagination_request_with_sort_options, string $contentType = self::contentTypes['fetchMembersByPage'][0]) { + // verify the required parameter 'pagination_request_with_sort_options' is set if ($pagination_request_with_sort_options === null || (is_array($pagination_request_with_sort_options) && count($pagination_request_with_sort_options) === 0)) { throw new \InvalidArgumentException( @@ -2060,6 +2616,7 @@ public function fetchMembersByPageRequest($pagination_request_with_sort_options) ); } + $resourcePath = '/v2/membership/member/page'; $formParams = []; $queryParams = []; @@ -2071,21 +2628,17 @@ public function fetchMembersByPageRequest($pagination_request_with_sort_options) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pagination_request_with_sort_options)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_sort_options)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_sort_options)); } else { $httpBody = $pagination_request_with_sort_options; } @@ -2104,12 +2657,12 @@ public function fetchMembersByPageRequest($pagination_request_with_sort_options) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2125,10 +2678,11 @@ public function fetchMembersByPageRequest($pagination_request_with_sort_options) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2139,14 +2693,15 @@ public function fetchMembersByPageRequest($pagination_request_with_sort_options) * * Count active members * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchMembersCount200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMembersCount() + public function fetchMembersCount(string $contentType = self::contentTypes['fetchMembersCount'][0]) { - list($response) = $this->fetchMembersCountWithHttpInfo(); + list($response) = $this->fetchMembersCountWithHttpInfo($contentType); return $response; } @@ -2155,14 +2710,15 @@ public function fetchMembersCount() * * Count active members * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchMembersCount200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMembersCountWithHttpInfo() + public function fetchMembersCountWithHttpInfo(string $contentType = self::contentTypes['fetchMembersCount'][0]) { - $request = $this->fetchMembersCountRequest(); + $request = $this->fetchMembersCountRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -2201,14 +2757,29 @@ public function fetchMembersCountWithHttpInfo() switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2003' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchMembersCount200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchMembersCount200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2003', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchMembersCount200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2217,6 +2788,21 @@ public function fetchMembersCountWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2229,6 +2815,21 @@ public function fetchMembersCountWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2241,6 +2842,21 @@ public function fetchMembersCountWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2250,11 +2866,26 @@ public function fetchMembersCountWithHttpInfo() ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; + $returnType = '\OpenAPI\Client\Model\FetchMembersCount200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2268,7 +2899,7 @@ public function fetchMembersCountWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2003', + '\OpenAPI\Client\Model\FetchMembersCount200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2307,13 +2938,14 @@ public function fetchMembersCountWithHttpInfo() * * Count active members * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMembersCountAsync() + public function fetchMembersCountAsync(string $contentType = self::contentTypes['fetchMembersCount'][0]) { - return $this->fetchMembersCountAsyncWithHttpInfo() + return $this->fetchMembersCountAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -2326,14 +2958,15 @@ function ($response) { * * Count active members * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMembersCountAsyncWithHttpInfo() + public function fetchMembersCountAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchMembersCount'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; - $request = $this->fetchMembersCountRequest(); + $returnType = '\OpenAPI\Client\Model\FetchMembersCount200Response'; + $request = $this->fetchMembersCountRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2343,6 +2976,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2371,13 +3007,15 @@ function ($exception) { /** * Create request for operation 'fetchMembersCount' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMembersCountRequest() + public function fetchMembersCountRequest(string $contentType = self::contentTypes['fetchMembersCount'][0]) { + $resourcePath = '/v2/membership/member/count'; $formParams = []; $queryParams = []; @@ -2389,16 +3027,11 @@ public function fetchMembersCountRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2416,12 +3049,12 @@ public function fetchMembersCountRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2437,10 +3070,11 @@ public function fetchMembersCountRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2452,14 +3086,15 @@ public function fetchMembersCountRequest() * Restore member * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMember'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMember|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreMember($id) + public function restoreMember($id, string $contentType = self::contentTypes['restoreMember'][0]) { - list($response) = $this->restoreMemberWithHttpInfo($id); + list($response) = $this->restoreMemberWithHttpInfo($id, $contentType); return $response; } @@ -2469,14 +3104,15 @@ public function restoreMember($id) * Restore member * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMember'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMember|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreMemberWithHttpInfo($id) + public function restoreMemberWithHttpInfo($id, string $contentType = self::contentTypes['restoreMember'][0]) { - $request = $this->restoreMemberRequest($id); + $request = $this->restoreMemberRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2519,6 +3155,21 @@ public function restoreMemberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMember' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2531,6 +3182,21 @@ public function restoreMemberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2543,6 +3209,21 @@ public function restoreMemberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2555,6 +3236,21 @@ public function restoreMemberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2569,6 +3265,21 @@ public function restoreMemberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2622,13 +3333,14 @@ public function restoreMemberWithHttpInfo($id) * Restore member * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreMemberAsync($id) + public function restoreMemberAsync($id, string $contentType = self::contentTypes['restoreMember'][0]) { - return $this->restoreMemberAsyncWithHttpInfo($id) + return $this->restoreMemberAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -2642,14 +3354,15 @@ function ($response) { * Restore member * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreMemberAsyncWithHttpInfo($id) + public function restoreMemberAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreMember'][0]) { $returnType = '\OpenAPI\Client\Model\WTMember'; - $request = $this->restoreMemberRequest($id); + $request = $this->restoreMemberRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2659,6 +3372,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2688,12 +3404,14 @@ function ($exception) { * Create request for operation 'restoreMember' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreMemberRequest($id) + public function restoreMemberRequest($id, string $contentType = self::contentTypes['restoreMember'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -2701,6 +3419,7 @@ public function restoreMemberRequest($id) ); } + $resourcePath = '/v2/membership/member/{id}'; $formParams = []; $queryParams = []; @@ -2720,16 +3439,11 @@ public function restoreMemberRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2747,12 +3461,12 @@ public function restoreMemberRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2768,10 +3482,11 @@ public function restoreMemberRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2783,14 +3498,15 @@ public function restoreMemberRequest($id) * Search for members * * @param \OpenAPI\Client\Model\MemberSearch $member_search member_search (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchMembers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PaginatedWTMembers|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function searchMembers($member_search) + public function searchMembers($member_search, string $contentType = self::contentTypes['searchMembers'][0]) { - list($response) = $this->searchMembersWithHttpInfo($member_search); + list($response) = $this->searchMembersWithHttpInfo($member_search, $contentType); return $response; } @@ -2800,14 +3516,15 @@ public function searchMembers($member_search) * Search for members * * @param \OpenAPI\Client\Model\MemberSearch $member_search (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchMembers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PaginatedWTMembers|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function searchMembersWithHttpInfo($member_search) + public function searchMembersWithHttpInfo($member_search, string $contentType = self::contentTypes['searchMembers'][0]) { - $request = $this->searchMembersRequest($member_search); + $request = $this->searchMembersRequest($member_search, $contentType); try { $options = $this->createHttpClientOption(); @@ -2850,6 +3567,21 @@ public function searchMembersWithHttpInfo($member_search) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PaginatedWTMembers' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2862,6 +3594,21 @@ public function searchMembersWithHttpInfo($member_search) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2874,6 +3621,21 @@ public function searchMembersWithHttpInfo($member_search) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2886,6 +3648,21 @@ public function searchMembersWithHttpInfo($member_search) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2900,6 +3677,21 @@ public function searchMembersWithHttpInfo($member_search) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2953,13 +3745,14 @@ public function searchMembersWithHttpInfo($member_search) * Search for members * * @param \OpenAPI\Client\Model\MemberSearch $member_search (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchMembersAsync($member_search) + public function searchMembersAsync($member_search, string $contentType = self::contentTypes['searchMembers'][0]) { - return $this->searchMembersAsyncWithHttpInfo($member_search) + return $this->searchMembersAsyncWithHttpInfo($member_search, $contentType) ->then( function ($response) { return $response[0]; @@ -2973,14 +3766,15 @@ function ($response) { * Search for members * * @param \OpenAPI\Client\Model\MemberSearch $member_search (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchMembersAsyncWithHttpInfo($member_search) + public function searchMembersAsyncWithHttpInfo($member_search, string $contentType = self::contentTypes['searchMembers'][0]) { $returnType = '\OpenAPI\Client\Model\PaginatedWTMembers'; - $request = $this->searchMembersRequest($member_search); + $request = $this->searchMembersRequest($member_search, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2990,6 +3784,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3019,12 +3816,14 @@ function ($exception) { * Create request for operation 'searchMembers' * * @param \OpenAPI\Client\Model\MemberSearch $member_search (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchMembersRequest($member_search) + public function searchMembersRequest($member_search, string $contentType = self::contentTypes['searchMembers'][0]) { + // verify the required parameter 'member_search' is set if ($member_search === null || (is_array($member_search) && count($member_search) === 0)) { throw new \InvalidArgumentException( @@ -3032,6 +3831,7 @@ public function searchMembersRequest($member_search) ); } + $resourcePath = '/v2/membership/member/search'; $formParams = []; $queryParams = []; @@ -3043,21 +3843,17 @@ public function searchMembersRequest($member_search) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($member_search)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($member_search)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($member_search)); } else { $httpBody = $member_search; } @@ -3076,12 +3872,12 @@ public function searchMembersRequest($member_search) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3097,10 +3893,11 @@ public function searchMembersRequest($member_search) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3112,15 +3909,16 @@ public function searchMembersRequest($member_search) * Update member * * @param mixed $id id (required) - * @param \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number (required) + * @param \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMember'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMember|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function updateMember($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number) + public function updateMember($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday, string $contentType = self::contentTypes['updateMember'][0]) { - list($response) = $this->updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number); + list($response) = $this->updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday, $contentType); return $response; } @@ -3130,15 +3928,16 @@ public function updateMember($id, $pick_wt_member_member_idor_first_name_or_last * Update member * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number (required) + * @param \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMember'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMember|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number) + public function updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday, string $contentType = self::contentTypes['updateMember'][0]) { - $request = $this->updateMemberRequest($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number); + $request = $this->updateMemberRequest($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday, $contentType); try { $options = $this->createHttpClientOption(); @@ -3181,6 +3980,21 @@ public function updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMember' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3193,6 +4007,21 @@ public function updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3205,6 +4034,21 @@ public function updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3217,6 +4061,21 @@ public function updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3229,6 +4088,21 @@ public function updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3241,6 +4115,21 @@ public function updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3255,6 +4144,21 @@ public function updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3324,14 +4228,15 @@ public function updateMemberWithHttpInfo($id, $pick_wt_member_member_idor_first_ * Update member * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number (required) + * @param \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateMemberAsync($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number) + public function updateMemberAsync($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday, string $contentType = self::contentTypes['updateMember'][0]) { - return $this->updateMemberAsyncWithHttpInfo($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number) + return $this->updateMemberAsyncWithHttpInfo($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday, $contentType) ->then( function ($response) { return $response[0]; @@ -3345,15 +4250,16 @@ function ($response) { * Update member * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number (required) + * @param \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateMemberAsyncWithHttpInfo($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number) + public function updateMemberAsyncWithHttpInfo($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday, string $contentType = self::contentTypes['updateMember'][0]) { $returnType = '\OpenAPI\Client\Model\WTMember'; - $request = $this->updateMemberRequest($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number); + $request = $this->updateMemberRequest($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3363,6 +4269,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3392,26 +4301,30 @@ function ($exception) { * Create request for operation 'updateMember' * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number (required) + * @param \OpenAPI\Client\Model\PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMember'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateMemberRequest($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number) + public function updateMemberRequest($id, $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday, string $contentType = self::contentTypes['updateMember'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateMember' ); } - // verify the required parameter 'pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number' is set - if ($pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number === null || (is_array($pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number) && count($pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number) === 0)) { + + // verify the required parameter 'pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday' is set + if ($pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday === null || (is_array($pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday) && count($pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number when calling updateMember' + 'Missing the required parameter $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday when calling updateMember' ); } + $resourcePath = '/v2/membership/member/{id}'; $formParams = []; $queryParams = []; @@ -3431,23 +4344,19 @@ public function updateMemberRequest($id, $pick_wt_member_member_idor_first_name_ } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number)); + if (isset($pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday)); } else { - $httpBody = $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number; + $httpBody = $pick_wt_member_member_idor_first_name_or_last_name_or_membership_tier_idor_points_accrued_or_mobile_number_or_email_or_birthday; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3464,12 +4373,12 @@ public function updateMemberRequest($id, $pick_wt_member_member_idor_first_name_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3485,10 +4394,11 @@ public function updateMemberRequest($id, $pick_wt_member_member_idor_first_name_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/ConfigurationApi.php b/lib/Api/ConfigurationApi.php index da43ea5..ed7c802 100644 --- a/lib/Api/ConfigurationApi.php +++ b/lib/Api/ConfigurationApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'saveMerchantCreditPaymentDesign' => [ + 'application/json', + ], + 'saveWalletRecord' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -119,28 +132,30 @@ public function getConfig() /** * Operation createPublicChatRoom * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPublicChatRoom'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createPublicChatRoom() + public function createPublicChatRoom(string $contentType = self::contentTypes['createPublicChatRoom'][0]) { - list($response) = $this->createPublicChatRoomWithHttpInfo(); + list($response) = $this->createPublicChatRoomWithHttpInfo($contentType); return $response; } /** * Operation createPublicChatRoomWithHttpInfo * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPublicChatRoom'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createPublicChatRoomWithHttpInfo() + public function createPublicChatRoomWithHttpInfo(string $contentType = self::contentTypes['createPublicChatRoom'][0]) { - $request = $this->createPublicChatRoomRequest(); + $request = $this->createPublicChatRoomRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -183,6 +198,21 @@ public function createPublicChatRoomWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -195,6 +225,21 @@ public function createPublicChatRoomWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -207,6 +252,21 @@ public function createPublicChatRoomWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -219,6 +279,21 @@ public function createPublicChatRoomWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -233,6 +308,21 @@ public function createPublicChatRoomWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -283,13 +373,14 @@ public function createPublicChatRoomWithHttpInfo() /** * Operation createPublicChatRoomAsync * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPublicChatRoom'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPublicChatRoomAsync() + public function createPublicChatRoomAsync(string $contentType = self::contentTypes['createPublicChatRoom'][0]) { - return $this->createPublicChatRoomAsyncWithHttpInfo() + return $this->createPublicChatRoomAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -300,14 +391,15 @@ function ($response) { /** * Operation createPublicChatRoomAsyncWithHttpInfo * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPublicChatRoom'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPublicChatRoomAsyncWithHttpInfo() + public function createPublicChatRoomAsyncWithHttpInfo(string $contentType = self::contentTypes['createPublicChatRoom'][0]) { $returnType = 'string'; - $request = $this->createPublicChatRoomRequest(); + $request = $this->createPublicChatRoomRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -317,6 +409,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -345,13 +440,15 @@ function ($exception) { /** * Create request for operation 'createPublicChatRoom' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPublicChatRoom'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createPublicChatRoomRequest() + public function createPublicChatRoomRequest(string $contentType = self::contentTypes['createPublicChatRoom'][0]) { + $resourcePath = '/v2/wallet/createPublicChatRoom'; $formParams = []; $queryParams = []; @@ -363,16 +460,11 @@ public function createPublicChatRoomRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -390,12 +482,12 @@ public function createPublicChatRoomRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -411,10 +503,11 @@ public function createPublicChatRoomRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -425,15 +518,16 @@ public function createPublicChatRoomRequest() * * Update wallet record * - * @param \OpenAPI\Client\Model\InlineObject3 $inline_object3 inline_object3 (required) + * @param \OpenAPI\Client\Model\SaveMerchantCreditPaymentDesignRequest $save_merchant_credit_payment_design_request save_merchant_credit_payment_design_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveMerchantCreditPaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function saveMerchantCreditPaymentDesign($inline_object3) + public function saveMerchantCreditPaymentDesign($save_merchant_credit_payment_design_request, string $contentType = self::contentTypes['saveMerchantCreditPaymentDesign'][0]) { - list($response) = $this->saveMerchantCreditPaymentDesignWithHttpInfo($inline_object3); + list($response) = $this->saveMerchantCreditPaymentDesignWithHttpInfo($save_merchant_credit_payment_design_request, $contentType); return $response; } @@ -442,15 +536,16 @@ public function saveMerchantCreditPaymentDesign($inline_object3) * * Update wallet record * - * @param \OpenAPI\Client\Model\InlineObject3 $inline_object3 (required) + * @param \OpenAPI\Client\Model\SaveMerchantCreditPaymentDesignRequest $save_merchant_credit_payment_design_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveMerchantCreditPaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function saveMerchantCreditPaymentDesignWithHttpInfo($inline_object3) + public function saveMerchantCreditPaymentDesignWithHttpInfo($save_merchant_credit_payment_design_request, string $contentType = self::contentTypes['saveMerchantCreditPaymentDesign'][0]) { - $request = $this->saveMerchantCreditPaymentDesignRequest($inline_object3); + $request = $this->saveMerchantCreditPaymentDesignRequest($save_merchant_credit_payment_design_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -493,6 +588,21 @@ public function saveMerchantCreditPaymentDesignWithHttpInfo($inline_object3) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -505,6 +615,21 @@ public function saveMerchantCreditPaymentDesignWithHttpInfo($inline_object3) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -517,6 +642,21 @@ public function saveMerchantCreditPaymentDesignWithHttpInfo($inline_object3) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -529,6 +669,21 @@ public function saveMerchantCreditPaymentDesignWithHttpInfo($inline_object3) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -543,6 +698,21 @@ public function saveMerchantCreditPaymentDesignWithHttpInfo($inline_object3) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -595,14 +765,15 @@ public function saveMerchantCreditPaymentDesignWithHttpInfo($inline_object3) * * Update wallet record * - * @param \OpenAPI\Client\Model\InlineObject3 $inline_object3 (required) + * @param \OpenAPI\Client\Model\SaveMerchantCreditPaymentDesignRequest $save_merchant_credit_payment_design_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveMerchantCreditPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveMerchantCreditPaymentDesignAsync($inline_object3) + public function saveMerchantCreditPaymentDesignAsync($save_merchant_credit_payment_design_request, string $contentType = self::contentTypes['saveMerchantCreditPaymentDesign'][0]) { - return $this->saveMerchantCreditPaymentDesignAsyncWithHttpInfo($inline_object3) + return $this->saveMerchantCreditPaymentDesignAsyncWithHttpInfo($save_merchant_credit_payment_design_request, $contentType) ->then( function ($response) { return $response[0]; @@ -615,15 +786,16 @@ function ($response) { * * Update wallet record * - * @param \OpenAPI\Client\Model\InlineObject3 $inline_object3 (required) + * @param \OpenAPI\Client\Model\SaveMerchantCreditPaymentDesignRequest $save_merchant_credit_payment_design_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveMerchantCreditPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveMerchantCreditPaymentDesignAsyncWithHttpInfo($inline_object3) + public function saveMerchantCreditPaymentDesignAsyncWithHttpInfo($save_merchant_credit_payment_design_request, string $contentType = self::contentTypes['saveMerchantCreditPaymentDesign'][0]) { $returnType = 'mixed'; - $request = $this->saveMerchantCreditPaymentDesignRequest($inline_object3); + $request = $this->saveMerchantCreditPaymentDesignRequest($save_merchant_credit_payment_design_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -633,6 +805,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -661,20 +836,23 @@ function ($exception) { /** * Create request for operation 'saveMerchantCreditPaymentDesign' * - * @param \OpenAPI\Client\Model\InlineObject3 $inline_object3 (required) + * @param \OpenAPI\Client\Model\SaveMerchantCreditPaymentDesignRequest $save_merchant_credit_payment_design_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveMerchantCreditPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function saveMerchantCreditPaymentDesignRequest($inline_object3) + public function saveMerchantCreditPaymentDesignRequest($save_merchant_credit_payment_design_request, string $contentType = self::contentTypes['saveMerchantCreditPaymentDesign'][0]) { - // verify the required parameter 'inline_object3' is set - if ($inline_object3 === null || (is_array($inline_object3) && count($inline_object3) === 0)) { + + // verify the required parameter 'save_merchant_credit_payment_design_request' is set + if ($save_merchant_credit_payment_design_request === null || (is_array($save_merchant_credit_payment_design_request) && count($save_merchant_credit_payment_design_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $inline_object3 when calling saveMerchantCreditPaymentDesign' + 'Missing the required parameter $save_merchant_credit_payment_design_request when calling saveMerchantCreditPaymentDesign' ); } + $resourcePath = '/v2/wallet/merchantCredit/paymentDesign'; $formParams = []; $queryParams = []; @@ -686,23 +864,19 @@ public function saveMerchantCreditPaymentDesignRequest($inline_object3) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($inline_object3)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($inline_object3)); + if (isset($save_merchant_credit_payment_design_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($save_merchant_credit_payment_design_request)); } else { - $httpBody = $inline_object3; + $httpBody = $save_merchant_credit_payment_design_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -719,12 +893,12 @@ public function saveMerchantCreditPaymentDesignRequest($inline_object3) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -740,10 +914,11 @@ public function saveMerchantCreditPaymentDesignRequest($inline_object3) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -755,14 +930,15 @@ public function saveMerchantCreditPaymentDesignRequest($inline_object3) * Update wallet record * * @param \OpenAPI\Client\Model\WTWalletConfigurationSaveWalletRecord $wt_wallet_configuration_save_wallet_record wt_wallet_configuration_save_wallet_record (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveWalletRecord'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WalletConfiguration|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function saveWalletRecord($wt_wallet_configuration_save_wallet_record) + public function saveWalletRecord($wt_wallet_configuration_save_wallet_record, string $contentType = self::contentTypes['saveWalletRecord'][0]) { - list($response) = $this->saveWalletRecordWithHttpInfo($wt_wallet_configuration_save_wallet_record); + list($response) = $this->saveWalletRecordWithHttpInfo($wt_wallet_configuration_save_wallet_record, $contentType); return $response; } @@ -772,14 +948,15 @@ public function saveWalletRecord($wt_wallet_configuration_save_wallet_record) * Update wallet record * * @param \OpenAPI\Client\Model\WTWalletConfigurationSaveWalletRecord $wt_wallet_configuration_save_wallet_record (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveWalletRecord'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WalletConfiguration|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function saveWalletRecordWithHttpInfo($wt_wallet_configuration_save_wallet_record) + public function saveWalletRecordWithHttpInfo($wt_wallet_configuration_save_wallet_record, string $contentType = self::contentTypes['saveWalletRecord'][0]) { - $request = $this->saveWalletRecordRequest($wt_wallet_configuration_save_wallet_record); + $request = $this->saveWalletRecordRequest($wt_wallet_configuration_save_wallet_record, $contentType); try { $options = $this->createHttpClientOption(); @@ -822,6 +999,21 @@ public function saveWalletRecordWithHttpInfo($wt_wallet_configuration_save_walle $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WalletConfiguration' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -834,6 +1026,21 @@ public function saveWalletRecordWithHttpInfo($wt_wallet_configuration_save_walle $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -846,6 +1053,21 @@ public function saveWalletRecordWithHttpInfo($wt_wallet_configuration_save_walle $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -858,6 +1080,21 @@ public function saveWalletRecordWithHttpInfo($wt_wallet_configuration_save_walle $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -872,6 +1109,21 @@ public function saveWalletRecordWithHttpInfo($wt_wallet_configuration_save_walle $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -925,13 +1177,14 @@ public function saveWalletRecordWithHttpInfo($wt_wallet_configuration_save_walle * Update wallet record * * @param \OpenAPI\Client\Model\WTWalletConfigurationSaveWalletRecord $wt_wallet_configuration_save_wallet_record (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveWalletRecord'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveWalletRecordAsync($wt_wallet_configuration_save_wallet_record) + public function saveWalletRecordAsync($wt_wallet_configuration_save_wallet_record, string $contentType = self::contentTypes['saveWalletRecord'][0]) { - return $this->saveWalletRecordAsyncWithHttpInfo($wt_wallet_configuration_save_wallet_record) + return $this->saveWalletRecordAsyncWithHttpInfo($wt_wallet_configuration_save_wallet_record, $contentType) ->then( function ($response) { return $response[0]; @@ -945,14 +1198,15 @@ function ($response) { * Update wallet record * * @param \OpenAPI\Client\Model\WTWalletConfigurationSaveWalletRecord $wt_wallet_configuration_save_wallet_record (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveWalletRecord'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveWalletRecordAsyncWithHttpInfo($wt_wallet_configuration_save_wallet_record) + public function saveWalletRecordAsyncWithHttpInfo($wt_wallet_configuration_save_wallet_record, string $contentType = self::contentTypes['saveWalletRecord'][0]) { $returnType = '\OpenAPI\Client\Model\WalletConfiguration'; - $request = $this->saveWalletRecordRequest($wt_wallet_configuration_save_wallet_record); + $request = $this->saveWalletRecordRequest($wt_wallet_configuration_save_wallet_record, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -962,6 +1216,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -991,12 +1248,14 @@ function ($exception) { * Create request for operation 'saveWalletRecord' * * @param \OpenAPI\Client\Model\WTWalletConfigurationSaveWalletRecord $wt_wallet_configuration_save_wallet_record (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveWalletRecord'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function saveWalletRecordRequest($wt_wallet_configuration_save_wallet_record) + public function saveWalletRecordRequest($wt_wallet_configuration_save_wallet_record, string $contentType = self::contentTypes['saveWalletRecord'][0]) { + // verify the required parameter 'wt_wallet_configuration_save_wallet_record' is set if ($wt_wallet_configuration_save_wallet_record === null || (is_array($wt_wallet_configuration_save_wallet_record) && count($wt_wallet_configuration_save_wallet_record) === 0)) { throw new \InvalidArgumentException( @@ -1004,6 +1263,7 @@ public function saveWalletRecordRequest($wt_wallet_configuration_save_wallet_rec ); } + $resourcePath = '/v2/wallet'; $formParams = []; $queryParams = []; @@ -1015,21 +1275,17 @@ public function saveWalletRecordRequest($wt_wallet_configuration_save_wallet_rec - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_wallet_configuration_save_wallet_record)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_wallet_configuration_save_wallet_record)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_wallet_configuration_save_wallet_record)); } else { $httpBody = $wt_wallet_configuration_save_wallet_record; } @@ -1048,12 +1304,12 @@ public function saveWalletRecordRequest($wt_wallet_configuration_save_wallet_rec // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1069,10 +1325,11 @@ public function saveWalletRecordRequest($wt_wallet_configuration_save_wallet_rec $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/CountriesApi.php b/lib/Api/CountriesApi.php index 5f0cf63..5d2ec3a 100644 --- a/lib/Api/CountriesApi.php +++ b/lib/Api/CountriesApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -121,14 +128,15 @@ public function getConfig() * * Fetch all countries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllCountries'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse20011[]|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchAllCountries200ResponseInner[]|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllCountries() + public function fetchAllCountries(string $contentType = self::contentTypes['fetchAllCountries'][0]) { - list($response) = $this->fetchAllCountriesWithHttpInfo(); + list($response) = $this->fetchAllCountriesWithHttpInfo($contentType); return $response; } @@ -137,14 +145,15 @@ public function fetchAllCountries() * * Fetch all countries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllCountries'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse20011[]|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchAllCountries200ResponseInner[]|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllCountriesWithHttpInfo() + public function fetchAllCountriesWithHttpInfo(string $contentType = self::contentTypes['fetchAllCountries'][0]) { - $request = $this->fetchAllCountriesRequest(); + $request = $this->fetchAllCountriesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -183,14 +192,29 @@ public function fetchAllCountriesWithHttpInfo() switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse20011[]' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchAllCountries200ResponseInner[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchAllCountries200ResponseInner[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse20011[]', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchAllCountries200ResponseInner[]', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -199,6 +223,21 @@ public function fetchAllCountriesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -208,11 +247,26 @@ public function fetchAllCountriesWithHttpInfo() ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse20011[]'; + $returnType = '\OpenAPI\Client\Model\FetchAllCountries200ResponseInner[]'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -226,7 +280,7 @@ public function fetchAllCountriesWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse20011[]', + '\OpenAPI\Client\Model\FetchAllCountries200ResponseInner[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -249,13 +303,14 @@ public function fetchAllCountriesWithHttpInfo() * * Fetch all countries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllCountries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllCountriesAsync() + public function fetchAllCountriesAsync(string $contentType = self::contentTypes['fetchAllCountries'][0]) { - return $this->fetchAllCountriesAsyncWithHttpInfo() + return $this->fetchAllCountriesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -268,14 +323,15 @@ function ($response) { * * Fetch all countries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllCountries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllCountriesAsyncWithHttpInfo() + public function fetchAllCountriesAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchAllCountries'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse20011[]'; - $request = $this->fetchAllCountriesRequest(); + $returnType = '\OpenAPI\Client\Model\FetchAllCountries200ResponseInner[]'; + $request = $this->fetchAllCountriesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -285,6 +341,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -313,13 +372,15 @@ function ($exception) { /** * Create request for operation 'fetchAllCountries' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllCountries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllCountriesRequest() + public function fetchAllCountriesRequest(string $contentType = self::contentTypes['fetchAllCountries'][0]) { + $resourcePath = '/system/countries/all'; $formParams = []; $queryParams = []; @@ -331,16 +392,11 @@ public function fetchAllCountriesRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -358,12 +414,12 @@ public function fetchAllCountriesRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -379,10 +435,11 @@ public function fetchAllCountriesRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/CustomerApi.php b/lib/Api/CustomerApi.php index 5b4f19d..597050f 100644 --- a/lib/Api/CustomerApi.php +++ b/lib/Api/CustomerApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'fetchAllVouchers' => [ + 'application/json', + ], + 'fetchExpiredVouchers' => [ + 'application/json', + ], + 'fetchRedeemedVouchers' => [ + 'application/json', + ], + 'fetchRefundedVouchers' => [ + 'application/json', + ], + 'fetchUpcomingVouchers' => [ + 'application/json', + ], + 'fetchWalletViewsForSession' => [ + 'application/json', + ], + 'searchByMemberID' => [ + 'application/json', + ], + 'searchByPhoneNumber' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -123,14 +154,15 @@ public function getConfig() * * @param string $member_id member_id (optional) * @param string $cell_phone_number cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchActiveVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchActiveVouchers($member_id = null, $cell_phone_number = null) + public function fetchActiveVouchers($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchActiveVouchers'][0]) { - list($response) = $this->fetchActiveVouchersWithHttpInfo($member_id, $cell_phone_number); + list($response) = $this->fetchActiveVouchersWithHttpInfo($member_id, $cell_phone_number, $contentType); return $response; } @@ -141,14 +173,15 @@ public function fetchActiveVouchers($member_id = null, $cell_phone_number = null * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchActiveVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchActiveVouchersWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchActiveVouchersWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchActiveVouchers'][0]) { - $request = $this->fetchActiveVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchActiveVouchersRequest($member_id, $cell_phone_number, $contentType); try { $options = $this->createHttpClientOption(); @@ -191,6 +224,21 @@ public function fetchActiveVouchersWithHttpInfo($member_id = null, $cell_phone_n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -203,6 +251,21 @@ public function fetchActiveVouchersWithHttpInfo($member_id = null, $cell_phone_n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -215,6 +278,21 @@ public function fetchActiveVouchersWithHttpInfo($member_id = null, $cell_phone_n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -227,6 +305,21 @@ public function fetchActiveVouchersWithHttpInfo($member_id = null, $cell_phone_n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -241,6 +334,21 @@ public function fetchActiveVouchersWithHttpInfo($member_id = null, $cell_phone_n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -295,13 +403,14 @@ public function fetchActiveVouchersWithHttpInfo($member_id = null, $cell_phone_n * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchActiveVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchActiveVouchersAsync($member_id = null, $cell_phone_number = null) + public function fetchActiveVouchersAsync($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchActiveVouchers'][0]) { - return $this->fetchActiveVouchersAsyncWithHttpInfo($member_id, $cell_phone_number) + return $this->fetchActiveVouchersAsyncWithHttpInfo($member_id, $cell_phone_number, $contentType) ->then( function ($response) { return $response[0]; @@ -316,14 +425,15 @@ function ($response) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchActiveVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchActiveVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchActiveVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchActiveVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucher[]'; - $request = $this->fetchActiveVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchActiveVouchersRequest($member_id, $cell_phone_number, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -333,6 +443,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -363,13 +476,17 @@ function ($exception) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchActiveVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchActiveVouchersRequest($member_id = null, $cell_phone_number = null) + public function fetchActiveVouchersRequest($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchActiveVouchers'][0]) { + + + $resourcePath = '/v2/customer/vouchers/active'; $formParams = []; $queryParams = []; @@ -378,41 +495,32 @@ public function fetchActiveVouchersRequest($member_id = null, $cell_phone_number $multipart = false; // query params - if ($member_id !== null) { - if('form' === 'form' && is_array($member_id)) { - foreach($member_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['memberID'] = $member_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $member_id, + 'memberID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cell_phone_number !== null) { - if('form' === 'form' && is_array($cell_phone_number)) { - foreach($cell_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cellPhoneNumber'] = $cell_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cell_phone_number, + 'cellPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -430,12 +538,12 @@ public function fetchActiveVouchersRequest($member_id = null, $cell_phone_number // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -451,10 +559,11 @@ public function fetchActiveVouchersRequest($member_id = null, $cell_phone_number $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -467,14 +576,15 @@ public function fetchActiveVouchersRequest($member_id = null, $cell_phone_number * * @param string $member_id member_id (optional) * @param string $cell_phone_number cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllVouchers($member_id = null, $cell_phone_number = null) + public function fetchAllVouchers($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchAllVouchers'][0]) { - list($response) = $this->fetchAllVouchersWithHttpInfo($member_id, $cell_phone_number); + list($response) = $this->fetchAllVouchersWithHttpInfo($member_id, $cell_phone_number, $contentType); return $response; } @@ -485,14 +595,15 @@ public function fetchAllVouchers($member_id = null, $cell_phone_number = null) * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllVouchersWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchAllVouchersWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchAllVouchers'][0]) { - $request = $this->fetchAllVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchAllVouchersRequest($member_id, $cell_phone_number, $contentType); try { $options = $this->createHttpClientOption(); @@ -535,6 +646,21 @@ public function fetchAllVouchersWithHttpInfo($member_id = null, $cell_phone_numb $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -547,6 +673,21 @@ public function fetchAllVouchersWithHttpInfo($member_id = null, $cell_phone_numb $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -559,6 +700,21 @@ public function fetchAllVouchersWithHttpInfo($member_id = null, $cell_phone_numb $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -571,6 +727,21 @@ public function fetchAllVouchersWithHttpInfo($member_id = null, $cell_phone_numb $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -585,6 +756,21 @@ public function fetchAllVouchersWithHttpInfo($member_id = null, $cell_phone_numb $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -639,13 +825,14 @@ public function fetchAllVouchersWithHttpInfo($member_id = null, $cell_phone_numb * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllVouchersAsync($member_id = null, $cell_phone_number = null) + public function fetchAllVouchersAsync($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchAllVouchers'][0]) { - return $this->fetchAllVouchersAsyncWithHttpInfo($member_id, $cell_phone_number) + return $this->fetchAllVouchersAsyncWithHttpInfo($member_id, $cell_phone_number, $contentType) ->then( function ($response) { return $response[0]; @@ -660,14 +847,15 @@ function ($response) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchAllVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchAllVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucher[]'; - $request = $this->fetchAllVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchAllVouchersRequest($member_id, $cell_phone_number, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -677,6 +865,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -707,13 +898,17 @@ function ($exception) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllVouchersRequest($member_id = null, $cell_phone_number = null) + public function fetchAllVouchersRequest($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchAllVouchers'][0]) { + + + $resourcePath = '/v2/customer/vouchers/all'; $formParams = []; $queryParams = []; @@ -722,41 +917,32 @@ public function fetchAllVouchersRequest($member_id = null, $cell_phone_number = $multipart = false; // query params - if ($member_id !== null) { - if('form' === 'form' && is_array($member_id)) { - foreach($member_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['memberID'] = $member_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $member_id, + 'memberID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cell_phone_number !== null) { - if('form' === 'form' && is_array($cell_phone_number)) { - foreach($cell_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cellPhoneNumber'] = $cell_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cell_phone_number, + 'cellPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -774,12 +960,12 @@ public function fetchAllVouchersRequest($member_id = null, $cell_phone_number = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -795,10 +981,11 @@ public function fetchAllVouchersRequest($member_id = null, $cell_phone_number = $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -811,14 +998,15 @@ public function fetchAllVouchersRequest($member_id = null, $cell_phone_number = * * @param string $member_id member_id (optional) * @param string $cell_phone_number cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchExpiredVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchExpiredVouchers($member_id = null, $cell_phone_number = null) + public function fetchExpiredVouchers($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchExpiredVouchers'][0]) { - list($response) = $this->fetchExpiredVouchersWithHttpInfo($member_id, $cell_phone_number); + list($response) = $this->fetchExpiredVouchersWithHttpInfo($member_id, $cell_phone_number, $contentType); return $response; } @@ -829,14 +1017,15 @@ public function fetchExpiredVouchers($member_id = null, $cell_phone_number = nul * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchExpiredVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchExpiredVouchersWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchExpiredVouchersWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchExpiredVouchers'][0]) { - $request = $this->fetchExpiredVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchExpiredVouchersRequest($member_id, $cell_phone_number, $contentType); try { $options = $this->createHttpClientOption(); @@ -879,6 +1068,21 @@ public function fetchExpiredVouchersWithHttpInfo($member_id = null, $cell_phone_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -891,6 +1095,21 @@ public function fetchExpiredVouchersWithHttpInfo($member_id = null, $cell_phone_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -903,6 +1122,21 @@ public function fetchExpiredVouchersWithHttpInfo($member_id = null, $cell_phone_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -915,6 +1149,21 @@ public function fetchExpiredVouchersWithHttpInfo($member_id = null, $cell_phone_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -929,6 +1178,21 @@ public function fetchExpiredVouchersWithHttpInfo($member_id = null, $cell_phone_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -983,13 +1247,14 @@ public function fetchExpiredVouchersWithHttpInfo($member_id = null, $cell_phone_ * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchExpiredVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchExpiredVouchersAsync($member_id = null, $cell_phone_number = null) + public function fetchExpiredVouchersAsync($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchExpiredVouchers'][0]) { - return $this->fetchExpiredVouchersAsyncWithHttpInfo($member_id, $cell_phone_number) + return $this->fetchExpiredVouchersAsyncWithHttpInfo($member_id, $cell_phone_number, $contentType) ->then( function ($response) { return $response[0]; @@ -1004,14 +1269,15 @@ function ($response) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchExpiredVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchExpiredVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchExpiredVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchExpiredVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucher[]'; - $request = $this->fetchExpiredVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchExpiredVouchersRequest($member_id, $cell_phone_number, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1021,6 +1287,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1051,13 +1320,17 @@ function ($exception) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchExpiredVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchExpiredVouchersRequest($member_id = null, $cell_phone_number = null) + public function fetchExpiredVouchersRequest($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchExpiredVouchers'][0]) { + + + $resourcePath = '/v2/customer/vouchers/expired'; $formParams = []; $queryParams = []; @@ -1066,41 +1339,32 @@ public function fetchExpiredVouchersRequest($member_id = null, $cell_phone_numbe $multipart = false; // query params - if ($member_id !== null) { - if('form' === 'form' && is_array($member_id)) { - foreach($member_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['memberID'] = $member_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $member_id, + 'memberID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cell_phone_number !== null) { - if('form' === 'form' && is_array($cell_phone_number)) { - foreach($cell_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cellPhoneNumber'] = $cell_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cell_phone_number, + 'cellPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1118,12 +1382,12 @@ public function fetchExpiredVouchersRequest($member_id = null, $cell_phone_numbe // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1139,10 +1403,11 @@ public function fetchExpiredVouchersRequest($member_id = null, $cell_phone_numbe $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1155,14 +1420,15 @@ public function fetchExpiredVouchersRequest($member_id = null, $cell_phone_numbe * * @param string $member_id member_id (optional) * @param string $cell_phone_number cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchRedeemedVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchRedeemedVouchers($member_id = null, $cell_phone_number = null) + public function fetchRedeemedVouchers($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchRedeemedVouchers'][0]) { - list($response) = $this->fetchRedeemedVouchersWithHttpInfo($member_id, $cell_phone_number); + list($response) = $this->fetchRedeemedVouchersWithHttpInfo($member_id, $cell_phone_number, $contentType); return $response; } @@ -1173,14 +1439,15 @@ public function fetchRedeemedVouchers($member_id = null, $cell_phone_number = nu * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchRedeemedVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchRedeemedVouchersWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchRedeemedVouchersWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchRedeemedVouchers'][0]) { - $request = $this->fetchRedeemedVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchRedeemedVouchersRequest($member_id, $cell_phone_number, $contentType); try { $options = $this->createHttpClientOption(); @@ -1223,6 +1490,21 @@ public function fetchRedeemedVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1235,6 +1517,21 @@ public function fetchRedeemedVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1247,6 +1544,21 @@ public function fetchRedeemedVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1259,6 +1571,21 @@ public function fetchRedeemedVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1273,6 +1600,21 @@ public function fetchRedeemedVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1327,13 +1669,14 @@ public function fetchRedeemedVouchersWithHttpInfo($member_id = null, $cell_phone * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchRedeemedVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchRedeemedVouchersAsync($member_id = null, $cell_phone_number = null) + public function fetchRedeemedVouchersAsync($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchRedeemedVouchers'][0]) { - return $this->fetchRedeemedVouchersAsyncWithHttpInfo($member_id, $cell_phone_number) + return $this->fetchRedeemedVouchersAsyncWithHttpInfo($member_id, $cell_phone_number, $contentType) ->then( function ($response) { return $response[0]; @@ -1348,14 +1691,15 @@ function ($response) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchRedeemedVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchRedeemedVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchRedeemedVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchRedeemedVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucher[]'; - $request = $this->fetchRedeemedVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchRedeemedVouchersRequest($member_id, $cell_phone_number, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1365,6 +1709,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1395,13 +1742,17 @@ function ($exception) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchRedeemedVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchRedeemedVouchersRequest($member_id = null, $cell_phone_number = null) + public function fetchRedeemedVouchersRequest($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchRedeemedVouchers'][0]) { + + + $resourcePath = '/v2/customer/vouchers/redeemed'; $formParams = []; $queryParams = []; @@ -1410,41 +1761,32 @@ public function fetchRedeemedVouchersRequest($member_id = null, $cell_phone_numb $multipart = false; // query params - if ($member_id !== null) { - if('form' === 'form' && is_array($member_id)) { - foreach($member_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['memberID'] = $member_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $member_id, + 'memberID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cell_phone_number !== null) { - if('form' === 'form' && is_array($cell_phone_number)) { - foreach($cell_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cellPhoneNumber'] = $cell_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cell_phone_number, + 'cellPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1462,12 +1804,12 @@ public function fetchRedeemedVouchersRequest($member_id = null, $cell_phone_numb // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1483,10 +1825,11 @@ public function fetchRedeemedVouchersRequest($member_id = null, $cell_phone_numb $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1499,14 +1842,15 @@ public function fetchRedeemedVouchersRequest($member_id = null, $cell_phone_numb * * @param string $member_id member_id (optional) * @param string $cell_phone_number cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchRefundedVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchRefundedVouchers($member_id = null, $cell_phone_number = null) + public function fetchRefundedVouchers($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchRefundedVouchers'][0]) { - list($response) = $this->fetchRefundedVouchersWithHttpInfo($member_id, $cell_phone_number); + list($response) = $this->fetchRefundedVouchersWithHttpInfo($member_id, $cell_phone_number, $contentType); return $response; } @@ -1517,14 +1861,15 @@ public function fetchRefundedVouchers($member_id = null, $cell_phone_number = nu * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchRefundedVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchRefundedVouchersWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchRefundedVouchersWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchRefundedVouchers'][0]) { - $request = $this->fetchRefundedVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchRefundedVouchersRequest($member_id, $cell_phone_number, $contentType); try { $options = $this->createHttpClientOption(); @@ -1567,6 +1912,21 @@ public function fetchRefundedVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1579,6 +1939,21 @@ public function fetchRefundedVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1591,6 +1966,21 @@ public function fetchRefundedVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1603,6 +1993,21 @@ public function fetchRefundedVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1617,6 +2022,21 @@ public function fetchRefundedVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1671,13 +2091,14 @@ public function fetchRefundedVouchersWithHttpInfo($member_id = null, $cell_phone * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchRefundedVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchRefundedVouchersAsync($member_id = null, $cell_phone_number = null) + public function fetchRefundedVouchersAsync($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchRefundedVouchers'][0]) { - return $this->fetchRefundedVouchersAsyncWithHttpInfo($member_id, $cell_phone_number) + return $this->fetchRefundedVouchersAsyncWithHttpInfo($member_id, $cell_phone_number, $contentType) ->then( function ($response) { return $response[0]; @@ -1692,14 +2113,15 @@ function ($response) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchRefundedVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchRefundedVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchRefundedVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchRefundedVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucher[]'; - $request = $this->fetchRefundedVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchRefundedVouchersRequest($member_id, $cell_phone_number, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1709,6 +2131,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1739,13 +2164,17 @@ function ($exception) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchRefundedVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchRefundedVouchersRequest($member_id = null, $cell_phone_number = null) + public function fetchRefundedVouchersRequest($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchRefundedVouchers'][0]) { + + + $resourcePath = '/v2/customer/vouchers/refunded'; $formParams = []; $queryParams = []; @@ -1754,41 +2183,32 @@ public function fetchRefundedVouchersRequest($member_id = null, $cell_phone_numb $multipart = false; // query params - if ($member_id !== null) { - if('form' === 'form' && is_array($member_id)) { - foreach($member_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['memberID'] = $member_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $member_id, + 'memberID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cell_phone_number !== null) { - if('form' === 'form' && is_array($cell_phone_number)) { - foreach($cell_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cellPhoneNumber'] = $cell_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cell_phone_number, + 'cellPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1806,12 +2226,12 @@ public function fetchRefundedVouchersRequest($member_id = null, $cell_phone_numb // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1827,10 +2247,11 @@ public function fetchRefundedVouchersRequest($member_id = null, $cell_phone_numb $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1843,14 +2264,15 @@ public function fetchRefundedVouchersRequest($member_id = null, $cell_phone_numb * * @param string $member_id member_id (optional) * @param string $cell_phone_number cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchUpcomingVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchUpcomingVouchers($member_id = null, $cell_phone_number = null) + public function fetchUpcomingVouchers($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchUpcomingVouchers'][0]) { - list($response) = $this->fetchUpcomingVouchersWithHttpInfo($member_id, $cell_phone_number); + list($response) = $this->fetchUpcomingVouchersWithHttpInfo($member_id, $cell_phone_number, $contentType); return $response; } @@ -1861,14 +2283,15 @@ public function fetchUpcomingVouchers($member_id = null, $cell_phone_number = nu * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchUpcomingVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchUpcomingVouchersWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchUpcomingVouchersWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchUpcomingVouchers'][0]) { - $request = $this->fetchUpcomingVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchUpcomingVouchersRequest($member_id, $cell_phone_number, $contentType); try { $options = $this->createHttpClientOption(); @@ -1911,6 +2334,21 @@ public function fetchUpcomingVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1923,6 +2361,21 @@ public function fetchUpcomingVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1935,6 +2388,21 @@ public function fetchUpcomingVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1947,6 +2415,21 @@ public function fetchUpcomingVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1961,6 +2444,21 @@ public function fetchUpcomingVouchersWithHttpInfo($member_id = null, $cell_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2015,13 +2513,14 @@ public function fetchUpcomingVouchersWithHttpInfo($member_id = null, $cell_phone * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchUpcomingVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchUpcomingVouchersAsync($member_id = null, $cell_phone_number = null) + public function fetchUpcomingVouchersAsync($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchUpcomingVouchers'][0]) { - return $this->fetchUpcomingVouchersAsyncWithHttpInfo($member_id, $cell_phone_number) + return $this->fetchUpcomingVouchersAsyncWithHttpInfo($member_id, $cell_phone_number, $contentType) ->then( function ($response) { return $response[0]; @@ -2036,14 +2535,15 @@ function ($response) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchUpcomingVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchUpcomingVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null) + public function fetchUpcomingVouchersAsyncWithHttpInfo($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchUpcomingVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucher[]'; - $request = $this->fetchUpcomingVouchersRequest($member_id, $cell_phone_number); + $request = $this->fetchUpcomingVouchersRequest($member_id, $cell_phone_number, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2053,6 +2553,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2083,13 +2586,17 @@ function ($exception) { * * @param string $member_id (optional) * @param string $cell_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchUpcomingVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchUpcomingVouchersRequest($member_id = null, $cell_phone_number = null) + public function fetchUpcomingVouchersRequest($member_id = null, $cell_phone_number = null, string $contentType = self::contentTypes['fetchUpcomingVouchers'][0]) { + + + $resourcePath = '/v2/customer/vouchers/upcoming'; $formParams = []; $queryParams = []; @@ -2098,41 +2605,32 @@ public function fetchUpcomingVouchersRequest($member_id = null, $cell_phone_numb $multipart = false; // query params - if ($member_id !== null) { - if('form' === 'form' && is_array($member_id)) { - foreach($member_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['memberID'] = $member_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $member_id, + 'memberID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($cell_phone_number !== null) { - if('form' === 'form' && is_array($cell_phone_number)) { - foreach($cell_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['cellPhoneNumber'] = $cell_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cell_phone_number, + 'cellPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2150,12 +2648,12 @@ public function fetchUpcomingVouchersRequest($member_id = null, $cell_phone_numb // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2171,10 +2669,11 @@ public function fetchUpcomingVouchersRequest($member_id = null, $cell_phone_numb $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2186,14 +2685,15 @@ public function fetchUpcomingVouchersRequest($member_id = null, $cell_phone_numb * Fetch Wallet Views for Session * * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletViewsForSession'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchWalletViewsForSession($id) + public function fetchWalletViewsForSession($id, string $contentType = self::contentTypes['fetchWalletViewsForSession'][0]) { - list($response) = $this->fetchWalletViewsForSessionWithHttpInfo($id); + list($response) = $this->fetchWalletViewsForSessionWithHttpInfo($id, $contentType); return $response; } @@ -2203,14 +2703,15 @@ public function fetchWalletViewsForSession($id) * Fetch Wallet Views for Session * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletViewsForSession'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchWalletViewsForSessionWithHttpInfo($id) + public function fetchWalletViewsForSessionWithHttpInfo($id, string $contentType = self::contentTypes['fetchWalletViewsForSession'][0]) { - $request = $this->fetchWalletViewsForSessionRequest($id); + $request = $this->fetchWalletViewsForSessionRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2253,6 +2754,21 @@ public function fetchWalletViewsForSessionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WalletPageView[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2265,6 +2781,21 @@ public function fetchWalletViewsForSessionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2277,6 +2808,21 @@ public function fetchWalletViewsForSessionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2289,6 +2835,21 @@ public function fetchWalletViewsForSessionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2303,6 +2864,21 @@ public function fetchWalletViewsForSessionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2356,13 +2932,14 @@ public function fetchWalletViewsForSessionWithHttpInfo($id) * Fetch Wallet Views for Session * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletViewsForSession'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletViewsForSessionAsync($id) + public function fetchWalletViewsForSessionAsync($id, string $contentType = self::contentTypes['fetchWalletViewsForSession'][0]) { - return $this->fetchWalletViewsForSessionAsyncWithHttpInfo($id) + return $this->fetchWalletViewsForSessionAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -2376,14 +2953,15 @@ function ($response) { * Fetch Wallet Views for Session * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletViewsForSession'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletViewsForSessionAsyncWithHttpInfo($id) + public function fetchWalletViewsForSessionAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchWalletViewsForSession'][0]) { $returnType = '\OpenAPI\Client\Model\WalletPageView[]'; - $request = $this->fetchWalletViewsForSessionRequest($id); + $request = $this->fetchWalletViewsForSessionRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2393,6 +2971,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2422,12 +3003,14 @@ function ($exception) { * Create request for operation 'fetchWalletViewsForSession' * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletViewsForSession'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchWalletViewsForSessionRequest($id) + public function fetchWalletViewsForSessionRequest($id, string $contentType = self::contentTypes['fetchWalletViewsForSession'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -2435,6 +3018,7 @@ public function fetchWalletViewsForSessionRequest($id) ); } + $resourcePath = '/v2/customer/walletViews/session/{id}'; $formParams = []; $queryParams = []; @@ -2454,16 +3038,11 @@ public function fetchWalletViewsForSessionRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2481,12 +3060,12 @@ public function fetchWalletViewsForSessionRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2502,10 +3081,11 @@ public function fetchWalletViewsForSessionRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2517,14 +3097,15 @@ public function fetchWalletViewsForSessionRequest($id) * Find members with memberID * * @param \OpenAPI\Client\Model\WTCustomerSearchByMemberID $wt_customer_search_by_member_id wt_customer_search_by_member_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByMemberID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function searchByMemberID($wt_customer_search_by_member_id) + public function searchByMemberID($wt_customer_search_by_member_id, string $contentType = self::contentTypes['searchByMemberID'][0]) { - list($response) = $this->searchByMemberIDWithHttpInfo($wt_customer_search_by_member_id); + list($response) = $this->searchByMemberIDWithHttpInfo($wt_customer_search_by_member_id, $contentType); return $response; } @@ -2534,14 +3115,15 @@ public function searchByMemberID($wt_customer_search_by_member_id) * Find members with memberID * * @param \OpenAPI\Client\Model\WTCustomerSearchByMemberID $wt_customer_search_by_member_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByMemberID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function searchByMemberIDWithHttpInfo($wt_customer_search_by_member_id) + public function searchByMemberIDWithHttpInfo($wt_customer_search_by_member_id, string $contentType = self::contentTypes['searchByMemberID'][0]) { - $request = $this->searchByMemberIDRequest($wt_customer_search_by_member_id); + $request = $this->searchByMemberIDRequest($wt_customer_search_by_member_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2584,6 +3166,21 @@ public function searchByMemberIDWithHttpInfo($wt_customer_search_by_member_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2596,6 +3193,21 @@ public function searchByMemberIDWithHttpInfo($wt_customer_search_by_member_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2608,6 +3220,21 @@ public function searchByMemberIDWithHttpInfo($wt_customer_search_by_member_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2620,6 +3247,21 @@ public function searchByMemberIDWithHttpInfo($wt_customer_search_by_member_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2634,6 +3276,21 @@ public function searchByMemberIDWithHttpInfo($wt_customer_search_by_member_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2687,13 +3344,14 @@ public function searchByMemberIDWithHttpInfo($wt_customer_search_by_member_id) * Find members with memberID * * @param \OpenAPI\Client\Model\WTCustomerSearchByMemberID $wt_customer_search_by_member_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByMemberID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchByMemberIDAsync($wt_customer_search_by_member_id) + public function searchByMemberIDAsync($wt_customer_search_by_member_id, string $contentType = self::contentTypes['searchByMemberID'][0]) { - return $this->searchByMemberIDAsyncWithHttpInfo($wt_customer_search_by_member_id) + return $this->searchByMemberIDAsyncWithHttpInfo($wt_customer_search_by_member_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2707,14 +3365,15 @@ function ($response) { * Find members with memberID * * @param \OpenAPI\Client\Model\WTCustomerSearchByMemberID $wt_customer_search_by_member_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByMemberID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchByMemberIDAsyncWithHttpInfo($wt_customer_search_by_member_id) + public function searchByMemberIDAsyncWithHttpInfo($wt_customer_search_by_member_id, string $contentType = self::contentTypes['searchByMemberID'][0]) { $returnType = 'mixed'; - $request = $this->searchByMemberIDRequest($wt_customer_search_by_member_id); + $request = $this->searchByMemberIDRequest($wt_customer_search_by_member_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2724,6 +3383,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2753,12 +3415,14 @@ function ($exception) { * Create request for operation 'searchByMemberID' * * @param \OpenAPI\Client\Model\WTCustomerSearchByMemberID $wt_customer_search_by_member_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByMemberID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchByMemberIDRequest($wt_customer_search_by_member_id) + public function searchByMemberIDRequest($wt_customer_search_by_member_id, string $contentType = self::contentTypes['searchByMemberID'][0]) { + // verify the required parameter 'wt_customer_search_by_member_id' is set if ($wt_customer_search_by_member_id === null || (is_array($wt_customer_search_by_member_id) && count($wt_customer_search_by_member_id) === 0)) { throw new \InvalidArgumentException( @@ -2766,6 +3430,7 @@ public function searchByMemberIDRequest($wt_customer_search_by_member_id) ); } + $resourcePath = '/v2/customer/search/memberID'; $formParams = []; $queryParams = []; @@ -2777,21 +3442,17 @@ public function searchByMemberIDRequest($wt_customer_search_by_member_id) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_customer_search_by_member_id)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_customer_search_by_member_id)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_customer_search_by_member_id)); } else { $httpBody = $wt_customer_search_by_member_id; } @@ -2810,12 +3471,12 @@ public function searchByMemberIDRequest($wt_customer_search_by_member_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2831,10 +3492,11 @@ public function searchByMemberIDRequest($wt_customer_search_by_member_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2846,14 +3508,15 @@ public function searchByMemberIDRequest($wt_customer_search_by_member_id) * Find members with phone number * * @param \OpenAPI\Client\Model\WTCustomerSearchByPhoneNumber $wt_customer_search_by_phone_number wt_customer_search_by_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function searchByPhoneNumber($wt_customer_search_by_phone_number) + public function searchByPhoneNumber($wt_customer_search_by_phone_number, string $contentType = self::contentTypes['searchByPhoneNumber'][0]) { - list($response) = $this->searchByPhoneNumberWithHttpInfo($wt_customer_search_by_phone_number); + list($response) = $this->searchByPhoneNumberWithHttpInfo($wt_customer_search_by_phone_number, $contentType); return $response; } @@ -2863,14 +3526,15 @@ public function searchByPhoneNumber($wt_customer_search_by_phone_number) * Find members with phone number * * @param \OpenAPI\Client\Model\WTCustomerSearchByPhoneNumber $wt_customer_search_by_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function searchByPhoneNumberWithHttpInfo($wt_customer_search_by_phone_number) + public function searchByPhoneNumberWithHttpInfo($wt_customer_search_by_phone_number, string $contentType = self::contentTypes['searchByPhoneNumber'][0]) { - $request = $this->searchByPhoneNumberRequest($wt_customer_search_by_phone_number); + $request = $this->searchByPhoneNumberRequest($wt_customer_search_by_phone_number, $contentType); try { $options = $this->createHttpClientOption(); @@ -2913,6 +3577,21 @@ public function searchByPhoneNumberWithHttpInfo($wt_customer_search_by_phone_num $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2925,6 +3604,21 @@ public function searchByPhoneNumberWithHttpInfo($wt_customer_search_by_phone_num $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2937,6 +3631,21 @@ public function searchByPhoneNumberWithHttpInfo($wt_customer_search_by_phone_num $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2949,6 +3658,21 @@ public function searchByPhoneNumberWithHttpInfo($wt_customer_search_by_phone_num $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2963,6 +3687,21 @@ public function searchByPhoneNumberWithHttpInfo($wt_customer_search_by_phone_num $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3016,13 +3755,14 @@ public function searchByPhoneNumberWithHttpInfo($wt_customer_search_by_phone_num * Find members with phone number * * @param \OpenAPI\Client\Model\WTCustomerSearchByPhoneNumber $wt_customer_search_by_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchByPhoneNumberAsync($wt_customer_search_by_phone_number) + public function searchByPhoneNumberAsync($wt_customer_search_by_phone_number, string $contentType = self::contentTypes['searchByPhoneNumber'][0]) { - return $this->searchByPhoneNumberAsyncWithHttpInfo($wt_customer_search_by_phone_number) + return $this->searchByPhoneNumberAsyncWithHttpInfo($wt_customer_search_by_phone_number, $contentType) ->then( function ($response) { return $response[0]; @@ -3036,14 +3776,15 @@ function ($response) { * Find members with phone number * * @param \OpenAPI\Client\Model\WTCustomerSearchByPhoneNumber $wt_customer_search_by_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchByPhoneNumberAsyncWithHttpInfo($wt_customer_search_by_phone_number) + public function searchByPhoneNumberAsyncWithHttpInfo($wt_customer_search_by_phone_number, string $contentType = self::contentTypes['searchByPhoneNumber'][0]) { $returnType = 'mixed'; - $request = $this->searchByPhoneNumberRequest($wt_customer_search_by_phone_number); + $request = $this->searchByPhoneNumberRequest($wt_customer_search_by_phone_number, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3053,6 +3794,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3082,12 +3826,14 @@ function ($exception) { * Create request for operation 'searchByPhoneNumber' * * @param \OpenAPI\Client\Model\WTCustomerSearchByPhoneNumber $wt_customer_search_by_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchByPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchByPhoneNumberRequest($wt_customer_search_by_phone_number) + public function searchByPhoneNumberRequest($wt_customer_search_by_phone_number, string $contentType = self::contentTypes['searchByPhoneNumber'][0]) { + // verify the required parameter 'wt_customer_search_by_phone_number' is set if ($wt_customer_search_by_phone_number === null || (is_array($wt_customer_search_by_phone_number) && count($wt_customer_search_by_phone_number) === 0)) { throw new \InvalidArgumentException( @@ -3095,6 +3841,7 @@ public function searchByPhoneNumberRequest($wt_customer_search_by_phone_number) ); } + $resourcePath = '/v2/customer/search/phoneNumber'; $formParams = []; $queryParams = []; @@ -3106,21 +3853,17 @@ public function searchByPhoneNumberRequest($wt_customer_search_by_phone_number) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_customer_search_by_phone_number)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_customer_search_by_phone_number)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_customer_search_by_phone_number)); } else { $httpBody = $wt_customer_search_by_phone_number; } @@ -3139,12 +3882,12 @@ public function searchByPhoneNumberRequest($wt_customer_search_by_phone_number) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3160,10 +3903,11 @@ public function searchByPhoneNumberRequest($wt_customer_search_by_phone_number) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/DashboardApi.php b/lib/Api/DashboardApi.php index 1ca0ab0..f9a01fd 100644 --- a/lib/Api/DashboardApi.php +++ b/lib/Api/DashboardApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'fetchDashboardActiveStaticVouchersCount' => [ + 'application/json', + ], + 'fetchDashboardAppleWalletSubscribersCount' => [ + 'application/json', + ], + 'fetchDashboardEmployeesCount' => [ + 'application/json', + ], + 'fetchDashboardMembersCount' => [ + 'application/json', + ], + 'fetchDashboardMembershipTiersCount' => [ + 'application/json', + ], + 'fetchDashboardNewsArticlesCount' => [ + 'application/json', + ], + 'fetchDashboardOptInListsCount' => [ + 'application/json', + ], + 'fetchDashboardOptInSourcesCount' => [ + 'application/json', + ], + 'fetchDashboardOutboundSMSCount' => [ + 'application/json', + ], + 'fetchDashboardPOSMachinesCount' => [ + 'application/json', + ], + 'fetchDashboardPOSTransactionsCount' => [ + 'application/json', + ], + 'fetchDashboardPerformancesCount' => [ + 'application/json', + ], + 'fetchDashboardPhoneNumbersCount' => [ + 'application/json', + ], + 'fetchDashboardRedemptionsCount' => [ + 'application/json', + ], + 'fetchDashboardRefundsCount' => [ + 'application/json', + ], + 'fetchDashboardWalletPageViewsCount' => [ + 'application/json', + ], + 'fetchDashboardWidgetsCatalog' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -123,14 +181,15 @@ public function getConfig() * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardActiveStaticVoucherCampaignsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardActiveStaticVoucherCampaignsCount($start_date_time, $end_date_time) + public function fetchDashboardActiveStaticVoucherCampaignsCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardActiveStaticVoucherCampaignsCount'][0]) { - list($response) = $this->fetchDashboardActiveStaticVoucherCampaignsCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardActiveStaticVoucherCampaignsCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -141,14 +200,15 @@ public function fetchDashboardActiveStaticVoucherCampaignsCount($start_date_time * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardActiveStaticVoucherCampaignsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardActiveStaticVoucherCampaignsCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardActiveStaticVoucherCampaignsCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardActiveStaticVoucherCampaignsCount'][0]) { - $request = $this->fetchDashboardActiveStaticVoucherCampaignsCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardActiveStaticVoucherCampaignsCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -191,6 +251,21 @@ public function fetchDashboardActiveStaticVoucherCampaignsCountWithHttpInfo($sta $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -203,6 +278,21 @@ public function fetchDashboardActiveStaticVoucherCampaignsCountWithHttpInfo($sta $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -215,6 +305,21 @@ public function fetchDashboardActiveStaticVoucherCampaignsCountWithHttpInfo($sta $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -227,6 +332,21 @@ public function fetchDashboardActiveStaticVoucherCampaignsCountWithHttpInfo($sta $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -241,6 +361,21 @@ public function fetchDashboardActiveStaticVoucherCampaignsCountWithHttpInfo($sta $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -295,13 +430,14 @@ public function fetchDashboardActiveStaticVoucherCampaignsCountWithHttpInfo($sta * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardActiveStaticVoucherCampaignsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardActiveStaticVoucherCampaignsCountAsync($start_date_time, $end_date_time) + public function fetchDashboardActiveStaticVoucherCampaignsCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardActiveStaticVoucherCampaignsCount'][0]) { - return $this->fetchDashboardActiveStaticVoucherCampaignsCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardActiveStaticVoucherCampaignsCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -316,14 +452,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardActiveStaticVoucherCampaignsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardActiveStaticVoucherCampaignsCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardActiveStaticVoucherCampaignsCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardActiveStaticVoucherCampaignsCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardActiveStaticVoucherCampaignsCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardActiveStaticVoucherCampaignsCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -333,6 +470,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -363,18 +503,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardActiveStaticVoucherCampaignsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardActiveStaticVoucherCampaignsCountRequest($start_date_time, $end_date_time) + public function fetchDashboardActiveStaticVoucherCampaignsCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardActiveStaticVoucherCampaignsCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardActiveStaticVoucherCampaignsCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -382,6 +525,7 @@ public function fetchDashboardActiveStaticVoucherCampaignsCountRequest($start_da ); } + $resourcePath = '/v2/dashboard/count/staticVoucherCampaigns/active'; $formParams = []; $queryParams = []; @@ -390,41 +534,32 @@ public function fetchDashboardActiveStaticVoucherCampaignsCountRequest($start_da $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -442,12 +577,12 @@ public function fetchDashboardActiveStaticVoucherCampaignsCountRequest($start_da // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -463,10 +598,11 @@ public function fetchDashboardActiveStaticVoucherCampaignsCountRequest($start_da $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -479,14 +615,15 @@ public function fetchDashboardActiveStaticVoucherCampaignsCountRequest($start_da * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardActiveStaticVouchersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardActiveStaticVouchersCount($start_date_time, $end_date_time) + public function fetchDashboardActiveStaticVouchersCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardActiveStaticVouchersCount'][0]) { - list($response) = $this->fetchDashboardActiveStaticVouchersCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardActiveStaticVouchersCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -497,14 +634,15 @@ public function fetchDashboardActiveStaticVouchersCount($start_date_time, $end_d * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardActiveStaticVouchersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardActiveStaticVouchersCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardActiveStaticVouchersCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardActiveStaticVouchersCount'][0]) { - $request = $this->fetchDashboardActiveStaticVouchersCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardActiveStaticVouchersCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -547,6 +685,21 @@ public function fetchDashboardActiveStaticVouchersCountWithHttpInfo($start_date_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -559,6 +712,21 @@ public function fetchDashboardActiveStaticVouchersCountWithHttpInfo($start_date_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -571,6 +739,21 @@ public function fetchDashboardActiveStaticVouchersCountWithHttpInfo($start_date_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -583,6 +766,21 @@ public function fetchDashboardActiveStaticVouchersCountWithHttpInfo($start_date_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -597,6 +795,21 @@ public function fetchDashboardActiveStaticVouchersCountWithHttpInfo($start_date_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -651,13 +864,14 @@ public function fetchDashboardActiveStaticVouchersCountWithHttpInfo($start_date_ * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardActiveStaticVouchersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardActiveStaticVouchersCountAsync($start_date_time, $end_date_time) + public function fetchDashboardActiveStaticVouchersCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardActiveStaticVouchersCount'][0]) { - return $this->fetchDashboardActiveStaticVouchersCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardActiveStaticVouchersCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -672,14 +886,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardActiveStaticVouchersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardActiveStaticVouchersCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardActiveStaticVouchersCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardActiveStaticVouchersCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardActiveStaticVouchersCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardActiveStaticVouchersCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -689,6 +904,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -719,18 +937,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardActiveStaticVouchersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardActiveStaticVouchersCountRequest($start_date_time, $end_date_time) + public function fetchDashboardActiveStaticVouchersCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardActiveStaticVouchersCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardActiveStaticVouchersCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -738,6 +959,7 @@ public function fetchDashboardActiveStaticVouchersCountRequest($start_date_time, ); } + $resourcePath = '/v2/dashboard/count/staticVouchers/active'; $formParams = []; $queryParams = []; @@ -746,41 +968,32 @@ public function fetchDashboardActiveStaticVouchersCountRequest($start_date_time, $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -798,12 +1011,12 @@ public function fetchDashboardActiveStaticVouchersCountRequest($start_date_time, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -819,10 +1032,11 @@ public function fetchDashboardActiveStaticVouchersCountRequest($start_date_time, $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -835,14 +1049,15 @@ public function fetchDashboardActiveStaticVouchersCountRequest($start_date_time, * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardAppleWalletSubscribersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardAppleWalletSubscribersCount($start_date_time, $end_date_time) + public function fetchDashboardAppleWalletSubscribersCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardAppleWalletSubscribersCount'][0]) { - list($response) = $this->fetchDashboardAppleWalletSubscribersCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardAppleWalletSubscribersCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -853,14 +1068,15 @@ public function fetchDashboardAppleWalletSubscribersCount($start_date_time, $end * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardAppleWalletSubscribersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardAppleWalletSubscribersCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardAppleWalletSubscribersCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardAppleWalletSubscribersCount'][0]) { - $request = $this->fetchDashboardAppleWalletSubscribersCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardAppleWalletSubscribersCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -903,6 +1119,21 @@ public function fetchDashboardAppleWalletSubscribersCountWithHttpInfo($start_dat $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -915,6 +1146,21 @@ public function fetchDashboardAppleWalletSubscribersCountWithHttpInfo($start_dat $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -927,6 +1173,21 @@ public function fetchDashboardAppleWalletSubscribersCountWithHttpInfo($start_dat $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -939,6 +1200,21 @@ public function fetchDashboardAppleWalletSubscribersCountWithHttpInfo($start_dat $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -953,6 +1229,21 @@ public function fetchDashboardAppleWalletSubscribersCountWithHttpInfo($start_dat $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1007,13 +1298,14 @@ public function fetchDashboardAppleWalletSubscribersCountWithHttpInfo($start_dat * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardAppleWalletSubscribersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardAppleWalletSubscribersCountAsync($start_date_time, $end_date_time) + public function fetchDashboardAppleWalletSubscribersCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardAppleWalletSubscribersCount'][0]) { - return $this->fetchDashboardAppleWalletSubscribersCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardAppleWalletSubscribersCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -1028,14 +1320,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardAppleWalletSubscribersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardAppleWalletSubscribersCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardAppleWalletSubscribersCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardAppleWalletSubscribersCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardAppleWalletSubscribersCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardAppleWalletSubscribersCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1045,6 +1338,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1075,18 +1371,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardAppleWalletSubscribersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardAppleWalletSubscribersCountRequest($start_date_time, $end_date_time) + public function fetchDashboardAppleWalletSubscribersCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardAppleWalletSubscribersCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardAppleWalletSubscribersCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -1094,6 +1393,7 @@ public function fetchDashboardAppleWalletSubscribersCountRequest($start_date_tim ); } + $resourcePath = '/v2/dashboard/count/appleWallet/subscribers'; $formParams = []; $queryParams = []; @@ -1102,41 +1402,32 @@ public function fetchDashboardAppleWalletSubscribersCountRequest($start_date_tim $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1154,12 +1445,12 @@ public function fetchDashboardAppleWalletSubscribersCountRequest($start_date_tim // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1175,10 +1466,11 @@ public function fetchDashboardAppleWalletSubscribersCountRequest($start_date_tim $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1191,14 +1483,15 @@ public function fetchDashboardAppleWalletSubscribersCountRequest($start_date_tim * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardEmployeesCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardEmployeesCount($start_date_time, $end_date_time) + public function fetchDashboardEmployeesCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardEmployeesCount'][0]) { - list($response) = $this->fetchDashboardEmployeesCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardEmployeesCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -1209,14 +1502,15 @@ public function fetchDashboardEmployeesCount($start_date_time, $end_date_time) * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardEmployeesCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardEmployeesCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardEmployeesCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardEmployeesCount'][0]) { - $request = $this->fetchDashboardEmployeesCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardEmployeesCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -1259,6 +1553,21 @@ public function fetchDashboardEmployeesCountWithHttpInfo($start_date_time, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1271,6 +1580,21 @@ public function fetchDashboardEmployeesCountWithHttpInfo($start_date_time, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1283,6 +1607,21 @@ public function fetchDashboardEmployeesCountWithHttpInfo($start_date_time, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1295,6 +1634,21 @@ public function fetchDashboardEmployeesCountWithHttpInfo($start_date_time, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1309,6 +1663,21 @@ public function fetchDashboardEmployeesCountWithHttpInfo($start_date_time, $end_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1363,13 +1732,14 @@ public function fetchDashboardEmployeesCountWithHttpInfo($start_date_time, $end_ * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardEmployeesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardEmployeesCountAsync($start_date_time, $end_date_time) + public function fetchDashboardEmployeesCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardEmployeesCount'][0]) { - return $this->fetchDashboardEmployeesCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardEmployeesCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -1384,14 +1754,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardEmployeesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardEmployeesCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardEmployeesCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardEmployeesCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardEmployeesCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardEmployeesCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1401,6 +1772,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1431,18 +1805,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardEmployeesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardEmployeesCountRequest($start_date_time, $end_date_time) + public function fetchDashboardEmployeesCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardEmployeesCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardEmployeesCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -1450,6 +1827,7 @@ public function fetchDashboardEmployeesCountRequest($start_date_time, $end_date_ ); } + $resourcePath = '/v2/dashboard/count/employees'; $formParams = []; $queryParams = []; @@ -1458,41 +1836,32 @@ public function fetchDashboardEmployeesCountRequest($start_date_time, $end_date_ $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1510,12 +1879,12 @@ public function fetchDashboardEmployeesCountRequest($start_date_time, $end_date_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1531,10 +1900,11 @@ public function fetchDashboardEmployeesCountRequest($start_date_time, $end_date_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1547,14 +1917,15 @@ public function fetchDashboardEmployeesCountRequest($start_date_time, $end_date_ * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardMembersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardMembersCount($start_date_time, $end_date_time) + public function fetchDashboardMembersCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardMembersCount'][0]) { - list($response) = $this->fetchDashboardMembersCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardMembersCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -1565,14 +1936,15 @@ public function fetchDashboardMembersCount($start_date_time, $end_date_time) * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardMembersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardMembersCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardMembersCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardMembersCount'][0]) { - $request = $this->fetchDashboardMembersCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardMembersCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -1615,6 +1987,21 @@ public function fetchDashboardMembersCountWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1627,6 +2014,21 @@ public function fetchDashboardMembersCountWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1639,6 +2041,21 @@ public function fetchDashboardMembersCountWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1651,6 +2068,21 @@ public function fetchDashboardMembersCountWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1665,6 +2097,21 @@ public function fetchDashboardMembersCountWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1719,13 +2166,14 @@ public function fetchDashboardMembersCountWithHttpInfo($start_date_time, $end_da * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardMembersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardMembersCountAsync($start_date_time, $end_date_time) + public function fetchDashboardMembersCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardMembersCount'][0]) { - return $this->fetchDashboardMembersCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardMembersCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -1740,14 +2188,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardMembersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardMembersCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardMembersCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardMembersCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardMembersCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardMembersCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1757,6 +2206,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1787,18 +2239,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardMembersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardMembersCountRequest($start_date_time, $end_date_time) + public function fetchDashboardMembersCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardMembersCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardMembersCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -1806,6 +2261,7 @@ public function fetchDashboardMembersCountRequest($start_date_time, $end_date_ti ); } + $resourcePath = '/v2/dashboard/count/members'; $formParams = []; $queryParams = []; @@ -1814,41 +2270,32 @@ public function fetchDashboardMembersCountRequest($start_date_time, $end_date_ti $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1866,12 +2313,12 @@ public function fetchDashboardMembersCountRequest($start_date_time, $end_date_ti // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1887,10 +2334,11 @@ public function fetchDashboardMembersCountRequest($start_date_time, $end_date_ti $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1903,14 +2351,15 @@ public function fetchDashboardMembersCountRequest($start_date_time, $end_date_ti * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardMembershipTiersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardMembershipTiersCount($start_date_time, $end_date_time) + public function fetchDashboardMembershipTiersCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardMembershipTiersCount'][0]) { - list($response) = $this->fetchDashboardMembershipTiersCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardMembershipTiersCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -1921,14 +2370,15 @@ public function fetchDashboardMembershipTiersCount($start_date_time, $end_date_t * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardMembershipTiersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardMembershipTiersCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardMembershipTiersCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardMembershipTiersCount'][0]) { - $request = $this->fetchDashboardMembershipTiersCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardMembershipTiersCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -1971,6 +2421,21 @@ public function fetchDashboardMembershipTiersCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1983,6 +2448,21 @@ public function fetchDashboardMembershipTiersCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1995,6 +2475,21 @@ public function fetchDashboardMembershipTiersCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2007,6 +2502,21 @@ public function fetchDashboardMembershipTiersCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2021,6 +2531,21 @@ public function fetchDashboardMembershipTiersCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2075,13 +2600,14 @@ public function fetchDashboardMembershipTiersCountWithHttpInfo($start_date_time, * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardMembershipTiersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardMembershipTiersCountAsync($start_date_time, $end_date_time) + public function fetchDashboardMembershipTiersCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardMembershipTiersCount'][0]) { - return $this->fetchDashboardMembershipTiersCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardMembershipTiersCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -2096,14 +2622,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardMembershipTiersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardMembershipTiersCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardMembershipTiersCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardMembershipTiersCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardMembershipTiersCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardMembershipTiersCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2113,6 +2640,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2143,18 +2673,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardMembershipTiersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardMembershipTiersCountRequest($start_date_time, $end_date_time) + public function fetchDashboardMembershipTiersCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardMembershipTiersCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardMembershipTiersCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -2162,6 +2695,7 @@ public function fetchDashboardMembershipTiersCountRequest($start_date_time, $end ); } + $resourcePath = '/v2/dashboard/count/membershipTiers'; $formParams = []; $queryParams = []; @@ -2170,41 +2704,32 @@ public function fetchDashboardMembershipTiersCountRequest($start_date_time, $end $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2222,12 +2747,12 @@ public function fetchDashboardMembershipTiersCountRequest($start_date_time, $end // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2243,10 +2768,11 @@ public function fetchDashboardMembershipTiersCountRequest($start_date_time, $end $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2259,14 +2785,15 @@ public function fetchDashboardMembershipTiersCountRequest($start_date_time, $end * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardNewsArticlesCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardNewsArticlesCount($start_date_time, $end_date_time) + public function fetchDashboardNewsArticlesCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardNewsArticlesCount'][0]) { - list($response) = $this->fetchDashboardNewsArticlesCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardNewsArticlesCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -2277,14 +2804,15 @@ public function fetchDashboardNewsArticlesCount($start_date_time, $end_date_time * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardNewsArticlesCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardNewsArticlesCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardNewsArticlesCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardNewsArticlesCount'][0]) { - $request = $this->fetchDashboardNewsArticlesCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardNewsArticlesCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -2327,6 +2855,21 @@ public function fetchDashboardNewsArticlesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2339,6 +2882,21 @@ public function fetchDashboardNewsArticlesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2351,6 +2909,21 @@ public function fetchDashboardNewsArticlesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2363,6 +2936,21 @@ public function fetchDashboardNewsArticlesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2377,6 +2965,21 @@ public function fetchDashboardNewsArticlesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2431,13 +3034,14 @@ public function fetchDashboardNewsArticlesCountWithHttpInfo($start_date_time, $e * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardNewsArticlesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardNewsArticlesCountAsync($start_date_time, $end_date_time) + public function fetchDashboardNewsArticlesCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardNewsArticlesCount'][0]) { - return $this->fetchDashboardNewsArticlesCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardNewsArticlesCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -2452,14 +3056,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardNewsArticlesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardNewsArticlesCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardNewsArticlesCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardNewsArticlesCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardNewsArticlesCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardNewsArticlesCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2469,6 +3074,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2499,18 +3107,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardNewsArticlesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardNewsArticlesCountRequest($start_date_time, $end_date_time) + public function fetchDashboardNewsArticlesCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardNewsArticlesCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardNewsArticlesCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -2518,6 +3129,7 @@ public function fetchDashboardNewsArticlesCountRequest($start_date_time, $end_da ); } + $resourcePath = '/v2/dashboard/count/newsArticles'; $formParams = []; $queryParams = []; @@ -2526,41 +3138,32 @@ public function fetchDashboardNewsArticlesCountRequest($start_date_time, $end_da $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2578,12 +3181,12 @@ public function fetchDashboardNewsArticlesCountRequest($start_date_time, $end_da // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2599,10 +3202,11 @@ public function fetchDashboardNewsArticlesCountRequest($start_date_time, $end_da $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2615,14 +3219,15 @@ public function fetchDashboardNewsArticlesCountRequest($start_date_time, $end_da * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOptInListsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardOptInListsCount($start_date_time, $end_date_time) + public function fetchDashboardOptInListsCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOptInListsCount'][0]) { - list($response) = $this->fetchDashboardOptInListsCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardOptInListsCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -2633,14 +3238,15 @@ public function fetchDashboardOptInListsCount($start_date_time, $end_date_time) * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOptInListsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardOptInListsCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardOptInListsCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOptInListsCount'][0]) { - $request = $this->fetchDashboardOptInListsCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardOptInListsCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -2683,6 +3289,21 @@ public function fetchDashboardOptInListsCountWithHttpInfo($start_date_time, $end $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2695,6 +3316,21 @@ public function fetchDashboardOptInListsCountWithHttpInfo($start_date_time, $end $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2707,6 +3343,21 @@ public function fetchDashboardOptInListsCountWithHttpInfo($start_date_time, $end $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2719,6 +3370,21 @@ public function fetchDashboardOptInListsCountWithHttpInfo($start_date_time, $end $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2733,6 +3399,21 @@ public function fetchDashboardOptInListsCountWithHttpInfo($start_date_time, $end $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2787,13 +3468,14 @@ public function fetchDashboardOptInListsCountWithHttpInfo($start_date_time, $end * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOptInListsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardOptInListsCountAsync($start_date_time, $end_date_time) + public function fetchDashboardOptInListsCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOptInListsCount'][0]) { - return $this->fetchDashboardOptInListsCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardOptInListsCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -2808,14 +3490,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOptInListsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardOptInListsCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardOptInListsCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOptInListsCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardOptInListsCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardOptInListsCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2825,6 +3508,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2855,18 +3541,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOptInListsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardOptInListsCountRequest($start_date_time, $end_date_time) + public function fetchDashboardOptInListsCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOptInListsCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardOptInListsCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -2874,6 +3563,7 @@ public function fetchDashboardOptInListsCountRequest($start_date_time, $end_date ); } + $resourcePath = '/v2/dashboard/count/optInLists'; $formParams = []; $queryParams = []; @@ -2882,41 +3572,32 @@ public function fetchDashboardOptInListsCountRequest($start_date_time, $end_date $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2934,12 +3615,12 @@ public function fetchDashboardOptInListsCountRequest($start_date_time, $end_date // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2955,10 +3636,11 @@ public function fetchDashboardOptInListsCountRequest($start_date_time, $end_date $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2971,14 +3653,15 @@ public function fetchDashboardOptInListsCountRequest($start_date_time, $end_date * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOptInSourcesCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardOptInSourcesCount($start_date_time, $end_date_time) + public function fetchDashboardOptInSourcesCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOptInSourcesCount'][0]) { - list($response) = $this->fetchDashboardOptInSourcesCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardOptInSourcesCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -2989,14 +3672,15 @@ public function fetchDashboardOptInSourcesCount($start_date_time, $end_date_time * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOptInSourcesCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardOptInSourcesCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardOptInSourcesCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOptInSourcesCount'][0]) { - $request = $this->fetchDashboardOptInSourcesCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardOptInSourcesCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -3039,6 +3723,21 @@ public function fetchDashboardOptInSourcesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3051,6 +3750,21 @@ public function fetchDashboardOptInSourcesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3063,6 +3777,21 @@ public function fetchDashboardOptInSourcesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3075,6 +3804,21 @@ public function fetchDashboardOptInSourcesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3089,6 +3833,21 @@ public function fetchDashboardOptInSourcesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3143,13 +3902,14 @@ public function fetchDashboardOptInSourcesCountWithHttpInfo($start_date_time, $e * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOptInSourcesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardOptInSourcesCountAsync($start_date_time, $end_date_time) + public function fetchDashboardOptInSourcesCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOptInSourcesCount'][0]) { - return $this->fetchDashboardOptInSourcesCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardOptInSourcesCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -3164,14 +3924,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOptInSourcesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardOptInSourcesCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardOptInSourcesCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOptInSourcesCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardOptInSourcesCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardOptInSourcesCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3181,6 +3942,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3211,18 +3975,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOptInSourcesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardOptInSourcesCountRequest($start_date_time, $end_date_time) + public function fetchDashboardOptInSourcesCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOptInSourcesCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardOptInSourcesCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -3230,6 +3997,7 @@ public function fetchDashboardOptInSourcesCountRequest($start_date_time, $end_da ); } + $resourcePath = '/v2/dashboard/count/optInSources'; $formParams = []; $queryParams = []; @@ -3238,41 +4006,32 @@ public function fetchDashboardOptInSourcesCountRequest($start_date_time, $end_da $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3290,12 +4049,12 @@ public function fetchDashboardOptInSourcesCountRequest($start_date_time, $end_da // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3311,10 +4070,11 @@ public function fetchDashboardOptInSourcesCountRequest($start_date_time, $end_da $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3327,14 +4087,15 @@ public function fetchDashboardOptInSourcesCountRequest($start_date_time, $end_da * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOutboundSMSCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardOutboundSMSCount($start_date_time, $end_date_time) + public function fetchDashboardOutboundSMSCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOutboundSMSCount'][0]) { - list($response) = $this->fetchDashboardOutboundSMSCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardOutboundSMSCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -3345,14 +4106,15 @@ public function fetchDashboardOutboundSMSCount($start_date_time, $end_date_time) * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOutboundSMSCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardOutboundSMSCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardOutboundSMSCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOutboundSMSCount'][0]) { - $request = $this->fetchDashboardOutboundSMSCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardOutboundSMSCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -3395,6 +4157,21 @@ public function fetchDashboardOutboundSMSCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3407,6 +4184,21 @@ public function fetchDashboardOutboundSMSCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3419,6 +4211,21 @@ public function fetchDashboardOutboundSMSCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3431,6 +4238,21 @@ public function fetchDashboardOutboundSMSCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3445,6 +4267,21 @@ public function fetchDashboardOutboundSMSCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3499,13 +4336,14 @@ public function fetchDashboardOutboundSMSCountWithHttpInfo($start_date_time, $en * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOutboundSMSCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardOutboundSMSCountAsync($start_date_time, $end_date_time) + public function fetchDashboardOutboundSMSCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOutboundSMSCount'][0]) { - return $this->fetchDashboardOutboundSMSCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardOutboundSMSCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -3520,14 +4358,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOutboundSMSCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardOutboundSMSCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardOutboundSMSCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOutboundSMSCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardOutboundSMSCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardOutboundSMSCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3537,6 +4376,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3567,18 +4409,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardOutboundSMSCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardOutboundSMSCountRequest($start_date_time, $end_date_time) + public function fetchDashboardOutboundSMSCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardOutboundSMSCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardOutboundSMSCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -3586,6 +4431,7 @@ public function fetchDashboardOutboundSMSCountRequest($start_date_time, $end_dat ); } + $resourcePath = '/v2/dashboard/count/sms/outbound'; $formParams = []; $queryParams = []; @@ -3594,41 +4440,32 @@ public function fetchDashboardOutboundSMSCountRequest($start_date_time, $end_dat $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3646,12 +4483,12 @@ public function fetchDashboardOutboundSMSCountRequest($start_date_time, $end_dat // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3667,10 +4504,11 @@ public function fetchDashboardOutboundSMSCountRequest($start_date_time, $end_dat $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3683,14 +4521,15 @@ public function fetchDashboardOutboundSMSCountRequest($start_date_time, $end_dat * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPOSMachinesCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardPOSMachinesCount($start_date_time, $end_date_time) + public function fetchDashboardPOSMachinesCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPOSMachinesCount'][0]) { - list($response) = $this->fetchDashboardPOSMachinesCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardPOSMachinesCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -3701,14 +4540,15 @@ public function fetchDashboardPOSMachinesCount($start_date_time, $end_date_time) * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPOSMachinesCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardPOSMachinesCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardPOSMachinesCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPOSMachinesCount'][0]) { - $request = $this->fetchDashboardPOSMachinesCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardPOSMachinesCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -3751,6 +4591,21 @@ public function fetchDashboardPOSMachinesCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3763,6 +4618,21 @@ public function fetchDashboardPOSMachinesCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3775,6 +4645,21 @@ public function fetchDashboardPOSMachinesCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3787,6 +4672,21 @@ public function fetchDashboardPOSMachinesCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3801,6 +4701,21 @@ public function fetchDashboardPOSMachinesCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3855,13 +4770,14 @@ public function fetchDashboardPOSMachinesCountWithHttpInfo($start_date_time, $en * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPOSMachinesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardPOSMachinesCountAsync($start_date_time, $end_date_time) + public function fetchDashboardPOSMachinesCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPOSMachinesCount'][0]) { - return $this->fetchDashboardPOSMachinesCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardPOSMachinesCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -3876,14 +4792,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPOSMachinesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardPOSMachinesCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardPOSMachinesCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPOSMachinesCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardPOSMachinesCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardPOSMachinesCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3893,6 +4810,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3923,18 +4843,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPOSMachinesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardPOSMachinesCountRequest($start_date_time, $end_date_time) + public function fetchDashboardPOSMachinesCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPOSMachinesCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardPOSMachinesCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -3942,6 +4865,7 @@ public function fetchDashboardPOSMachinesCountRequest($start_date_time, $end_dat ); } + $resourcePath = '/v2/dashboard/count/pos/machines'; $formParams = []; $queryParams = []; @@ -3950,41 +4874,32 @@ public function fetchDashboardPOSMachinesCountRequest($start_date_time, $end_dat $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4002,12 +4917,12 @@ public function fetchDashboardPOSMachinesCountRequest($start_date_time, $end_dat // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4023,10 +4938,11 @@ public function fetchDashboardPOSMachinesCountRequest($start_date_time, $end_dat $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4039,14 +4955,15 @@ public function fetchDashboardPOSMachinesCountRequest($start_date_time, $end_dat * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPOSTransactionsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardPOSTransactionsCount($start_date_time, $end_date_time) + public function fetchDashboardPOSTransactionsCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPOSTransactionsCount'][0]) { - list($response) = $this->fetchDashboardPOSTransactionsCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardPOSTransactionsCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -4057,14 +4974,15 @@ public function fetchDashboardPOSTransactionsCount($start_date_time, $end_date_t * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPOSTransactionsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardPOSTransactionsCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardPOSTransactionsCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPOSTransactionsCount'][0]) { - $request = $this->fetchDashboardPOSTransactionsCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardPOSTransactionsCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -4107,6 +5025,21 @@ public function fetchDashboardPOSTransactionsCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4119,6 +5052,21 @@ public function fetchDashboardPOSTransactionsCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4131,6 +5079,21 @@ public function fetchDashboardPOSTransactionsCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4143,6 +5106,21 @@ public function fetchDashboardPOSTransactionsCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4157,6 +5135,21 @@ public function fetchDashboardPOSTransactionsCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4211,13 +5204,14 @@ public function fetchDashboardPOSTransactionsCountWithHttpInfo($start_date_time, * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPOSTransactionsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardPOSTransactionsCountAsync($start_date_time, $end_date_time) + public function fetchDashboardPOSTransactionsCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPOSTransactionsCount'][0]) { - return $this->fetchDashboardPOSTransactionsCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardPOSTransactionsCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -4232,14 +5226,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPOSTransactionsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardPOSTransactionsCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardPOSTransactionsCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPOSTransactionsCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardPOSTransactionsCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardPOSTransactionsCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4249,6 +5244,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4279,18 +5277,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPOSTransactionsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardPOSTransactionsCountRequest($start_date_time, $end_date_time) + public function fetchDashboardPOSTransactionsCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPOSTransactionsCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardPOSTransactionsCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -4298,6 +5299,7 @@ public function fetchDashboardPOSTransactionsCountRequest($start_date_time, $end ); } + $resourcePath = '/v2/dashboard/count/pos/transactions'; $formParams = []; $queryParams = []; @@ -4306,41 +5308,32 @@ public function fetchDashboardPOSTransactionsCountRequest($start_date_time, $end $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4358,12 +5351,12 @@ public function fetchDashboardPOSTransactionsCountRequest($start_date_time, $end // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4379,10 +5372,11 @@ public function fetchDashboardPOSTransactionsCountRequest($start_date_time, $end $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4395,14 +5389,15 @@ public function fetchDashboardPOSTransactionsCountRequest($start_date_time, $end * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPerformancesCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardPerformancesCount($start_date_time, $end_date_time) + public function fetchDashboardPerformancesCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPerformancesCount'][0]) { - list($response) = $this->fetchDashboardPerformancesCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardPerformancesCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -4413,14 +5408,15 @@ public function fetchDashboardPerformancesCount($start_date_time, $end_date_time * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPerformancesCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardPerformancesCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardPerformancesCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPerformancesCount'][0]) { - $request = $this->fetchDashboardPerformancesCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardPerformancesCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -4463,6 +5459,21 @@ public function fetchDashboardPerformancesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4475,6 +5486,21 @@ public function fetchDashboardPerformancesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4487,6 +5513,21 @@ public function fetchDashboardPerformancesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4499,6 +5540,21 @@ public function fetchDashboardPerformancesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4513,6 +5569,21 @@ public function fetchDashboardPerformancesCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4567,13 +5638,14 @@ public function fetchDashboardPerformancesCountWithHttpInfo($start_date_time, $e * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPerformancesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardPerformancesCountAsync($start_date_time, $end_date_time) + public function fetchDashboardPerformancesCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPerformancesCount'][0]) { - return $this->fetchDashboardPerformancesCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardPerformancesCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -4588,14 +5660,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPerformancesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardPerformancesCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardPerformancesCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPerformancesCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardPerformancesCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardPerformancesCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4605,6 +5678,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4635,18 +5711,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPerformancesCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardPerformancesCountRequest($start_date_time, $end_date_time) + public function fetchDashboardPerformancesCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPerformancesCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardPerformancesCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -4654,6 +5733,7 @@ public function fetchDashboardPerformancesCountRequest($start_date_time, $end_da ); } + $resourcePath = '/v2/dashboard/count/performances'; $formParams = []; $queryParams = []; @@ -4662,41 +5742,32 @@ public function fetchDashboardPerformancesCountRequest($start_date_time, $end_da $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4714,12 +5785,12 @@ public function fetchDashboardPerformancesCountRequest($start_date_time, $end_da // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4735,10 +5806,11 @@ public function fetchDashboardPerformancesCountRequest($start_date_time, $end_da $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4751,14 +5823,15 @@ public function fetchDashboardPerformancesCountRequest($start_date_time, $end_da * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPhoneNumbersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardPhoneNumbersCount($start_date_time, $end_date_time) + public function fetchDashboardPhoneNumbersCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPhoneNumbersCount'][0]) { - list($response) = $this->fetchDashboardPhoneNumbersCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardPhoneNumbersCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -4769,14 +5842,15 @@ public function fetchDashboardPhoneNumbersCount($start_date_time, $end_date_time * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPhoneNumbersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardPhoneNumbersCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardPhoneNumbersCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPhoneNumbersCount'][0]) { - $request = $this->fetchDashboardPhoneNumbersCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardPhoneNumbersCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -4819,6 +5893,21 @@ public function fetchDashboardPhoneNumbersCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4831,6 +5920,21 @@ public function fetchDashboardPhoneNumbersCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4843,6 +5947,21 @@ public function fetchDashboardPhoneNumbersCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4855,6 +5974,21 @@ public function fetchDashboardPhoneNumbersCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4869,6 +6003,21 @@ public function fetchDashboardPhoneNumbersCountWithHttpInfo($start_date_time, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4923,13 +6072,14 @@ public function fetchDashboardPhoneNumbersCountWithHttpInfo($start_date_time, $e * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPhoneNumbersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardPhoneNumbersCountAsync($start_date_time, $end_date_time) + public function fetchDashboardPhoneNumbersCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPhoneNumbersCount'][0]) { - return $this->fetchDashboardPhoneNumbersCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardPhoneNumbersCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -4944,14 +6094,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPhoneNumbersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardPhoneNumbersCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardPhoneNumbersCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPhoneNumbersCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardPhoneNumbersCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardPhoneNumbersCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4961,6 +6112,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4991,18 +6145,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardPhoneNumbersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardPhoneNumbersCountRequest($start_date_time, $end_date_time) + public function fetchDashboardPhoneNumbersCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardPhoneNumbersCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardPhoneNumbersCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -5010,6 +6167,7 @@ public function fetchDashboardPhoneNumbersCountRequest($start_date_time, $end_da ); } + $resourcePath = '/v2/dashboard/count/phoneNumbers'; $formParams = []; $queryParams = []; @@ -5018,41 +6176,32 @@ public function fetchDashboardPhoneNumbersCountRequest($start_date_time, $end_da $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5070,12 +6219,12 @@ public function fetchDashboardPhoneNumbersCountRequest($start_date_time, $end_da // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5091,10 +6240,11 @@ public function fetchDashboardPhoneNumbersCountRequest($start_date_time, $end_da $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5107,14 +6257,15 @@ public function fetchDashboardPhoneNumbersCountRequest($start_date_time, $end_da * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardRedemptionsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardRedemptionsCount($start_date_time, $end_date_time) + public function fetchDashboardRedemptionsCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardRedemptionsCount'][0]) { - list($response) = $this->fetchDashboardRedemptionsCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardRedemptionsCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -5125,14 +6276,15 @@ public function fetchDashboardRedemptionsCount($start_date_time, $end_date_time) * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardRedemptionsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardRedemptionsCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardRedemptionsCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardRedemptionsCount'][0]) { - $request = $this->fetchDashboardRedemptionsCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardRedemptionsCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -5175,6 +6327,21 @@ public function fetchDashboardRedemptionsCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5187,6 +6354,21 @@ public function fetchDashboardRedemptionsCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5199,6 +6381,21 @@ public function fetchDashboardRedemptionsCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5211,6 +6408,21 @@ public function fetchDashboardRedemptionsCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5225,6 +6437,21 @@ public function fetchDashboardRedemptionsCountWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5279,13 +6506,14 @@ public function fetchDashboardRedemptionsCountWithHttpInfo($start_date_time, $en * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardRedemptionsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardRedemptionsCountAsync($start_date_time, $end_date_time) + public function fetchDashboardRedemptionsCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardRedemptionsCount'][0]) { - return $this->fetchDashboardRedemptionsCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardRedemptionsCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -5300,14 +6528,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardRedemptionsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardRedemptionsCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardRedemptionsCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardRedemptionsCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardRedemptionsCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardRedemptionsCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5317,6 +6546,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5347,18 +6579,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardRedemptionsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardRedemptionsCountRequest($start_date_time, $end_date_time) + public function fetchDashboardRedemptionsCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardRedemptionsCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardRedemptionsCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -5366,6 +6601,7 @@ public function fetchDashboardRedemptionsCountRequest($start_date_time, $end_dat ); } + $resourcePath = '/v2/dashboard/count/pos/redemptions'; $formParams = []; $queryParams = []; @@ -5374,41 +6610,32 @@ public function fetchDashboardRedemptionsCountRequest($start_date_time, $end_dat $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5426,12 +6653,12 @@ public function fetchDashboardRedemptionsCountRequest($start_date_time, $end_dat // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5447,10 +6674,11 @@ public function fetchDashboardRedemptionsCountRequest($start_date_time, $end_dat $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5463,14 +6691,15 @@ public function fetchDashboardRedemptionsCountRequest($start_date_time, $end_dat * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardRefundsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardRefundsCount($start_date_time, $end_date_time) + public function fetchDashboardRefundsCount($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardRefundsCount'][0]) { - list($response) = $this->fetchDashboardRefundsCountWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchDashboardRefundsCountWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -5481,14 +6710,15 @@ public function fetchDashboardRefundsCount($start_date_time, $end_date_time) * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardRefundsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardRefundsCountWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardRefundsCountWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardRefundsCount'][0]) { - $request = $this->fetchDashboardRefundsCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardRefundsCountRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -5531,6 +6761,21 @@ public function fetchDashboardRefundsCountWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5543,6 +6788,21 @@ public function fetchDashboardRefundsCountWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5555,6 +6815,21 @@ public function fetchDashboardRefundsCountWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5567,6 +6842,21 @@ public function fetchDashboardRefundsCountWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5581,6 +6871,21 @@ public function fetchDashboardRefundsCountWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5635,13 +6940,14 @@ public function fetchDashboardRefundsCountWithHttpInfo($start_date_time, $end_da * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardRefundsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardRefundsCountAsync($start_date_time, $end_date_time) + public function fetchDashboardRefundsCountAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardRefundsCount'][0]) { - return $this->fetchDashboardRefundsCountAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchDashboardRefundsCountAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -5656,14 +6962,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardRefundsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardRefundsCountAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchDashboardRefundsCountAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardRefundsCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardRefundsCountRequest($start_date_time, $end_date_time); + $request = $this->fetchDashboardRefundsCountRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5673,6 +6980,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5703,18 +7013,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardRefundsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardRefundsCountRequest($start_date_time, $end_date_time) + public function fetchDashboardRefundsCountRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchDashboardRefundsCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardRefundsCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -5722,6 +7035,7 @@ public function fetchDashboardRefundsCountRequest($start_date_time, $end_date_ti ); } + $resourcePath = '/v2/dashboard/count/pos/refunds'; $formParams = []; $queryParams = []; @@ -5730,41 +7044,32 @@ public function fetchDashboardRefundsCountRequest($start_date_time, $end_date_ti $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5782,12 +7087,12 @@ public function fetchDashboardRefundsCountRequest($start_date_time, $end_date_ti // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5803,10 +7108,11 @@ public function fetchDashboardRefundsCountRequest($start_date_time, $end_date_ti $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5820,14 +7126,15 @@ public function fetchDashboardRefundsCountRequest($start_date_time, $end_date_ti * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) * @param string $wallet_object_prefix wallet_object_prefix (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardWalletPageViewsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardWalletPageViewsCount($start_date_time, $end_date_time, $wallet_object_prefix = null) + public function fetchDashboardWalletPageViewsCount($start_date_time, $end_date_time, $wallet_object_prefix = null, string $contentType = self::contentTypes['fetchDashboardWalletPageViewsCount'][0]) { - list($response) = $this->fetchDashboardWalletPageViewsCountWithHttpInfo($start_date_time, $end_date_time, $wallet_object_prefix); + list($response) = $this->fetchDashboardWalletPageViewsCountWithHttpInfo($start_date_time, $end_date_time, $wallet_object_prefix, $contentType); return $response; } @@ -5839,14 +7146,15 @@ public function fetchDashboardWalletPageViewsCount($start_date_time, $end_date_t * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) * @param string $wallet_object_prefix (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardWalletPageViewsCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardWalletPageViewsCountWithHttpInfo($start_date_time, $end_date_time, $wallet_object_prefix = null) + public function fetchDashboardWalletPageViewsCountWithHttpInfo($start_date_time, $end_date_time, $wallet_object_prefix = null, string $contentType = self::contentTypes['fetchDashboardWalletPageViewsCount'][0]) { - $request = $this->fetchDashboardWalletPageViewsCountRequest($start_date_time, $end_date_time, $wallet_object_prefix); + $request = $this->fetchDashboardWalletPageViewsCountRequest($start_date_time, $end_date_time, $wallet_object_prefix, $contentType); try { $options = $this->createHttpClientOption(); @@ -5889,6 +7197,21 @@ public function fetchDashboardWalletPageViewsCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5901,6 +7224,21 @@ public function fetchDashboardWalletPageViewsCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5913,6 +7251,21 @@ public function fetchDashboardWalletPageViewsCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5925,6 +7278,21 @@ public function fetchDashboardWalletPageViewsCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5939,6 +7307,21 @@ public function fetchDashboardWalletPageViewsCountWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5994,13 +7377,14 @@ public function fetchDashboardWalletPageViewsCountWithHttpInfo($start_date_time, * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) * @param string $wallet_object_prefix (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardWalletPageViewsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardWalletPageViewsCountAsync($start_date_time, $end_date_time, $wallet_object_prefix = null) + public function fetchDashboardWalletPageViewsCountAsync($start_date_time, $end_date_time, $wallet_object_prefix = null, string $contentType = self::contentTypes['fetchDashboardWalletPageViewsCount'][0]) { - return $this->fetchDashboardWalletPageViewsCountAsyncWithHttpInfo($start_date_time, $end_date_time, $wallet_object_prefix) + return $this->fetchDashboardWalletPageViewsCountAsyncWithHttpInfo($start_date_time, $end_date_time, $wallet_object_prefix, $contentType) ->then( function ($response) { return $response[0]; @@ -6016,14 +7400,15 @@ function ($response) { * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) * @param string $wallet_object_prefix (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardWalletPageViewsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardWalletPageViewsCountAsyncWithHttpInfo($start_date_time, $end_date_time, $wallet_object_prefix = null) + public function fetchDashboardWalletPageViewsCountAsyncWithHttpInfo($start_date_time, $end_date_time, $wallet_object_prefix = null, string $contentType = self::contentTypes['fetchDashboardWalletPageViewsCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->fetchDashboardWalletPageViewsCountRequest($start_date_time, $end_date_time, $wallet_object_prefix); + $request = $this->fetchDashboardWalletPageViewsCountRequest($start_date_time, $end_date_time, $wallet_object_prefix, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6033,6 +7418,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6064,18 +7452,21 @@ function ($exception) { * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) * @param string $wallet_object_prefix (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardWalletPageViewsCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardWalletPageViewsCountRequest($start_date_time, $end_date_time, $wallet_object_prefix = null) + public function fetchDashboardWalletPageViewsCountRequest($start_date_time, $end_date_time, $wallet_object_prefix = null, string $contentType = self::contentTypes['fetchDashboardWalletPageViewsCount'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchDashboardWalletPageViewsCount' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -6083,6 +7474,8 @@ public function fetchDashboardWalletPageViewsCountRequest($start_date_time, $end ); } + + $resourcePath = '/v2/dashboard/count/wallet/pageViews'; $formParams = []; $queryParams = []; @@ -6091,52 +7484,41 @@ public function fetchDashboardWalletPageViewsCountRequest($start_date_time, $end $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($wallet_object_prefix !== null) { - if('form' === 'form' && is_array($wallet_object_prefix)) { - foreach($wallet_object_prefix as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['walletObjectPrefix'] = $wallet_object_prefix; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $wallet_object_prefix, + 'walletObjectPrefix', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6154,12 +7536,12 @@ public function fetchDashboardWalletPageViewsCountRequest($start_date_time, $end // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6175,10 +7557,11 @@ public function fetchDashboardWalletPageViewsCountRequest($start_date_time, $end $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6189,14 +7572,15 @@ public function fetchDashboardWalletPageViewsCountRequest($start_date_time, $end * * Fetch widgets catalog * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardWidgetsCatalog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DashboardWidget[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDashboardWidgetsCatalog() + public function fetchDashboardWidgetsCatalog(string $contentType = self::contentTypes['fetchDashboardWidgetsCatalog'][0]) { - list($response) = $this->fetchDashboardWidgetsCatalogWithHttpInfo(); + list($response) = $this->fetchDashboardWidgetsCatalogWithHttpInfo($contentType); return $response; } @@ -6205,14 +7589,15 @@ public function fetchDashboardWidgetsCatalog() * * Fetch widgets catalog * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardWidgetsCatalog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DashboardWidget[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDashboardWidgetsCatalogWithHttpInfo() + public function fetchDashboardWidgetsCatalogWithHttpInfo(string $contentType = self::contentTypes['fetchDashboardWidgetsCatalog'][0]) { - $request = $this->fetchDashboardWidgetsCatalogRequest(); + $request = $this->fetchDashboardWidgetsCatalogRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -6255,6 +7640,21 @@ public function fetchDashboardWidgetsCatalogWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DashboardWidget[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6267,6 +7667,21 @@ public function fetchDashboardWidgetsCatalogWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6279,6 +7694,21 @@ public function fetchDashboardWidgetsCatalogWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6291,6 +7721,21 @@ public function fetchDashboardWidgetsCatalogWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6305,6 +7750,21 @@ public function fetchDashboardWidgetsCatalogWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6357,13 +7817,14 @@ public function fetchDashboardWidgetsCatalogWithHttpInfo() * * Fetch widgets catalog * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardWidgetsCatalog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardWidgetsCatalogAsync() + public function fetchDashboardWidgetsCatalogAsync(string $contentType = self::contentTypes['fetchDashboardWidgetsCatalog'][0]) { - return $this->fetchDashboardWidgetsCatalogAsyncWithHttpInfo() + return $this->fetchDashboardWidgetsCatalogAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -6376,14 +7837,15 @@ function ($response) { * * Fetch widgets catalog * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardWidgetsCatalog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDashboardWidgetsCatalogAsyncWithHttpInfo() + public function fetchDashboardWidgetsCatalogAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchDashboardWidgetsCatalog'][0]) { $returnType = '\OpenAPI\Client\Model\DashboardWidget[]'; - $request = $this->fetchDashboardWidgetsCatalogRequest(); + $request = $this->fetchDashboardWidgetsCatalogRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6393,6 +7855,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6421,13 +7886,15 @@ function ($exception) { /** * Create request for operation 'fetchDashboardWidgetsCatalog' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDashboardWidgetsCatalog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDashboardWidgetsCatalogRequest() + public function fetchDashboardWidgetsCatalogRequest(string $contentType = self::contentTypes['fetchDashboardWidgetsCatalog'][0]) { + $resourcePath = '/v2/dashboard/widgets'; $formParams = []; $queryParams = []; @@ -6439,16 +7906,11 @@ public function fetchDashboardWidgetsCatalogRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6466,12 +7928,12 @@ public function fetchDashboardWidgetsCatalogRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6487,10 +7949,11 @@ public function fetchDashboardWidgetsCatalogRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/DiningApi.php b/lib/Api/DiningApi.php index 51ee082..98e09ec 100644 --- a/lib/Api/DiningApi.php +++ b/lib/Api/DiningApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createDining' => [ + 'application/json', + ], + 'fetchAllDining' => [ + 'application/json', + ], + 'restoreDining' => [ + 'application/json', + ], + 'updateDining' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive dining * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDining'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Dining|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveDining($id) + public function archiveDining($id, string $contentType = self::contentTypes['archiveDining'][0]) { - list($response) = $this->archiveDiningWithHttpInfo($id); + list($response) = $this->archiveDiningWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveDining($id) * Archive dining * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDining'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Dining|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveDiningWithHttpInfo($id) + public function archiveDiningWithHttpInfo($id, string $contentType = self::contentTypes['archiveDining'][0]) { - $request = $this->archiveDiningRequest($id); + $request = $this->archiveDiningRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveDiningWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Dining' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveDiningWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveDiningWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveDiningWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveDiningWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveDiningWithHttpInfo($id) * Archive dining * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveDiningAsync($id) + public function archiveDiningAsync($id, string $contentType = self::contentTypes['archiveDining'][0]) { - return $this->archiveDiningAsyncWithHttpInfo($id) + return $this->archiveDiningAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive dining * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveDiningAsyncWithHttpInfo($id) + public function archiveDiningAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveDining'][0]) { $returnType = '\OpenAPI\Client\Model\Dining'; - $request = $this->archiveDiningRequest($id); + $request = $this->archiveDiningRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveDining' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveDiningRequest($id) + public function archiveDiningRequest($id, string $contentType = self::contentTypes['archiveDining'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveDiningRequest($id) ); } + $resourcePath = '/v2/dining/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveDiningRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveDiningRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveDiningRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveDiningRequest($id) * Create dining * * @param \OpenAPI\Client\Model\WTDiningCreateParams $wt_dining_create_params wt_dining_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDining'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Dining|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createDining($wt_dining_create_params) + public function createDining($wt_dining_create_params, string $contentType = self::contentTypes['createDining'][0]) { - list($response) = $this->createDiningWithHttpInfo($wt_dining_create_params); + list($response) = $this->createDiningWithHttpInfo($wt_dining_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createDining($wt_dining_create_params) * Create dining * * @param \OpenAPI\Client\Model\WTDiningCreateParams $wt_dining_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDining'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Dining|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createDiningWithHttpInfo($wt_dining_create_params) + public function createDiningWithHttpInfo($wt_dining_create_params, string $contentType = self::contentTypes['createDining'][0]) { - $request = $this->createDiningRequest($wt_dining_create_params); + $request = $this->createDiningRequest($wt_dining_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createDiningWithHttpInfo($wt_dining_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Dining' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createDiningWithHttpInfo($wt_dining_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createDiningWithHttpInfo($wt_dining_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createDiningWithHttpInfo($wt_dining_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createDiningWithHttpInfo($wt_dining_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createDiningWithHttpInfo($wt_dining_create_params) * Create dining * * @param \OpenAPI\Client\Model\WTDiningCreateParams $wt_dining_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createDiningAsync($wt_dining_create_params) + public function createDiningAsync($wt_dining_create_params, string $contentType = self::contentTypes['createDining'][0]) { - return $this->createDiningAsyncWithHttpInfo($wt_dining_create_params) + return $this->createDiningAsyncWithHttpInfo($wt_dining_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create dining * * @param \OpenAPI\Client\Model\WTDiningCreateParams $wt_dining_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createDiningAsyncWithHttpInfo($wt_dining_create_params) + public function createDiningAsyncWithHttpInfo($wt_dining_create_params, string $contentType = self::contentTypes['createDining'][0]) { $returnType = '\OpenAPI\Client\Model\Dining'; - $request = $this->createDiningRequest($wt_dining_create_params); + $request = $this->createDiningRequest($wt_dining_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createDining' * * @param \OpenAPI\Client\Model\WTDiningCreateParams $wt_dining_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createDiningRequest($wt_dining_create_params) + public function createDiningRequest($wt_dining_create_params, string $contentType = self::contentTypes['createDining'][0]) { + // verify the required parameter 'wt_dining_create_params' is set if ($wt_dining_create_params === null || (is_array($wt_dining_create_params) && count($wt_dining_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createDiningRequest($wt_dining_create_params) ); } + $resourcePath = '/v2/dining'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createDiningRequest($wt_dining_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_dining_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_dining_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_dining_create_params)); } else { $httpBody = $wt_dining_create_params; } @@ -746,12 +927,12 @@ public function createDiningRequest($wt_dining_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createDiningRequest($wt_dining_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createDiningRequest($wt_dining_create_params) * Fetch all dining * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllDining'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllDining($is_archive_included = null) + public function fetchAllDining($is_archive_included = null, string $contentType = self::contentTypes['fetchAllDining'][0]) { - list($response) = $this->fetchAllDiningWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllDiningWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllDining($is_archive_included = null) * Fetch all dining * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllDining'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllDiningWithHttpInfo($is_archive_included = null) + public function fetchAllDiningWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllDining'][0]) { - $request = $this->fetchAllDiningRequest($is_archive_included); + $request = $this->fetchAllDiningRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllDiningWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllDiningWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllDiningWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllDiningWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllDiningWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllDiningWithHttpInfo($is_archive_included = null) * Fetch all dining * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllDiningAsync($is_archive_included = null) + public function fetchAllDiningAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllDining'][0]) { - return $this->fetchAllDiningAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllDiningAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all dining * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllDiningAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllDiningAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllDining'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllDiningRequest($is_archive_included); + $request = $this->fetchAllDiningRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllDining' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllDiningRequest($is_archive_included = null) + public function fetchAllDiningRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllDining'][0]) { + + $resourcePath = '/v2/dining/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllDiningRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllDiningRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllDiningRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllDiningRequest($is_archive_included = null) * Restore dining * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDining'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Dining|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreDining($id) + public function restoreDining($id, string $contentType = self::contentTypes['restoreDining'][0]) { - list($response) = $this->restoreDiningWithHttpInfo($id); + list($response) = $this->restoreDiningWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restoreDining($id) * Restore dining * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDining'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Dining|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreDiningWithHttpInfo($id) + public function restoreDiningWithHttpInfo($id, string $contentType = self::contentTypes['restoreDining'][0]) { - $request = $this->restoreDiningRequest($id); + $request = $this->restoreDiningRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restoreDiningWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Dining' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restoreDiningWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restoreDiningWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restoreDiningWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restoreDiningWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restoreDiningWithHttpInfo($id) * Restore dining * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreDiningAsync($id) + public function restoreDiningAsync($id, string $contentType = self::contentTypes['restoreDining'][0]) { - return $this->restoreDiningAsyncWithHttpInfo($id) + return $this->restoreDiningAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore dining * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreDiningAsyncWithHttpInfo($id) + public function restoreDiningAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreDining'][0]) { $returnType = '\OpenAPI\Client\Model\Dining'; - $request = $this->restoreDiningRequest($id); + $request = $this->restoreDiningRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restoreDining' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreDiningRequest($id) + public function restoreDiningRequest($id, string $contentType = self::contentTypes['restoreDining'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restoreDiningRequest($id) ); } + $resourcePath = '/v2/dining/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restoreDiningRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restoreDiningRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restoreDiningRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restoreDiningRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTDiningUpdateParams $wt_dining_update_params wt_dining_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDining'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Dining|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateDining($id, $wt_dining_update_params) + public function updateDining($id, $wt_dining_update_params, string $contentType = self::contentTypes['updateDining'][0]) { - list($response) = $this->updateDiningWithHttpInfo($id, $wt_dining_update_params); + list($response) = $this->updateDiningWithHttpInfo($id, $wt_dining_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateDining($id, $wt_dining_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTDiningUpdateParams $wt_dining_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDining'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Dining|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateDiningWithHttpInfo($id, $wt_dining_update_params) + public function updateDiningWithHttpInfo($id, $wt_dining_update_params, string $contentType = self::contentTypes['updateDining'][0]) { - $request = $this->updateDiningRequest($id, $wt_dining_update_params); + $request = $this->updateDiningRequest($id, $wt_dining_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateDiningWithHttpInfo($id, $wt_dining_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Dining' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateDiningWithHttpInfo($id, $wt_dining_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateDiningWithHttpInfo($id, $wt_dining_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateDiningWithHttpInfo($id, $wt_dining_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateDiningWithHttpInfo($id, $wt_dining_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateDiningWithHttpInfo($id, $wt_dining_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTDiningUpdateParams $wt_dining_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateDiningAsync($id, $wt_dining_update_params) + public function updateDiningAsync($id, $wt_dining_update_params, string $contentType = self::contentTypes['updateDining'][0]) { - return $this->updateDiningAsyncWithHttpInfo($id, $wt_dining_update_params) + return $this->updateDiningAsyncWithHttpInfo($id, $wt_dining_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTDiningUpdateParams $wt_dining_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateDiningAsyncWithHttpInfo($id, $wt_dining_update_params) + public function updateDiningAsyncWithHttpInfo($id, $wt_dining_update_params, string $contentType = self::contentTypes['updateDining'][0]) { $returnType = '\OpenAPI\Client\Model\Dining'; - $request = $this->updateDiningRequest($id, $wt_dining_update_params); + $request = $this->updateDiningRequest($id, $wt_dining_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTDiningUpdateParams $wt_dining_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDining'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateDiningRequest($id, $wt_dining_update_params) + public function updateDiningRequest($id, $wt_dining_update_params, string $contentType = self::contentTypes['updateDining'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateDining' ); } + // verify the required parameter 'wt_dining_update_params' is set if ($wt_dining_update_params === null || (is_array($wt_dining_update_params) && count($wt_dining_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateDiningRequest($id, $wt_dining_update_params) ); } + $resourcePath = '/v2/dining/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateDiningRequest($id, $wt_dining_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_dining_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_dining_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_dining_update_params)); } else { $httpBody = $wt_dining_update_params; } @@ -1753,12 +2177,12 @@ public function updateDiningRequest($id, $wt_dining_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateDiningRequest($id, $wt_dining_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/DynamicVouchersApi.php b/lib/Api/DynamicVouchersApi.php index a2987ae..43f6b7a 100644 --- a/lib/Api/DynamicVouchersApi.php +++ b/lib/Api/DynamicVouchersApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createDynamicVoucher' => [ + 'application/json', + ], + 'fetchAllDynamicVouchers' => [ + 'application/json', + ], + 'fetchDynamicVoucherById' => [ + 'application/json', + ], + 'fetchDynamicVoucherRedemptions' => [ + 'application/json', + ], + 'fetchReachStatsOfAllDynamicVouchers' => [ + 'application/json', + ], + 'fetchReachStatsOfIndividualDynamicVoucher' => [ + 'application/json', + ], + 'restoreDynamicVoucherCampaign' => [ + 'application/json', + ], + 'saveDynamicVoucher' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +153,15 @@ public function getConfig() * Archive dynamic voucher campaign * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDynamicVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DynamicVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveDynamicVoucherCampaign($campaign_id) + public function archiveDynamicVoucherCampaign($campaign_id, string $contentType = self::contentTypes['archiveDynamicVoucherCampaign'][0]) { - list($response) = $this->archiveDynamicVoucherCampaignWithHttpInfo($campaign_id); + list($response) = $this->archiveDynamicVoucherCampaignWithHttpInfo($campaign_id, $contentType); return $response; } @@ -139,14 +171,15 @@ public function archiveDynamicVoucherCampaign($campaign_id) * Archive dynamic voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDynamicVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DynamicVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveDynamicVoucherCampaignWithHttpInfo($campaign_id) + public function archiveDynamicVoucherCampaignWithHttpInfo($campaign_id, string $contentType = self::contentTypes['archiveDynamicVoucherCampaign'][0]) { - $request = $this->archiveDynamicVoucherCampaignRequest($campaign_id); + $request = $this->archiveDynamicVoucherCampaignRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +222,21 @@ public function archiveDynamicVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DynamicVoucher' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +249,21 @@ public function archiveDynamicVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +276,21 @@ public function archiveDynamicVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +303,21 @@ public function archiveDynamicVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +332,21 @@ public function archiveDynamicVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +400,14 @@ public function archiveDynamicVoucherCampaignWithHttpInfo($campaign_id) * Archive dynamic voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDynamicVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveDynamicVoucherCampaignAsync($campaign_id) + public function archiveDynamicVoucherCampaignAsync($campaign_id, string $contentType = self::contentTypes['archiveDynamicVoucherCampaign'][0]) { - return $this->archiveDynamicVoucherCampaignAsyncWithHttpInfo($campaign_id) + return $this->archiveDynamicVoucherCampaignAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +421,15 @@ function ($response) { * Archive dynamic voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDynamicVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveDynamicVoucherCampaignAsyncWithHttpInfo($campaign_id) + public function archiveDynamicVoucherCampaignAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['archiveDynamicVoucherCampaign'][0]) { $returnType = '\OpenAPI\Client\Model\DynamicVoucher'; - $request = $this->archiveDynamicVoucherCampaignRequest($campaign_id); + $request = $this->archiveDynamicVoucherCampaignRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +439,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +471,14 @@ function ($exception) { * Create request for operation 'archiveDynamicVoucherCampaign' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveDynamicVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveDynamicVoucherCampaignRequest($campaign_id) + public function archiveDynamicVoucherCampaignRequest($campaign_id, string $contentType = self::contentTypes['archiveDynamicVoucherCampaign'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +486,7 @@ public function archiveDynamicVoucherCampaignRequest($campaign_id) ); } + $resourcePath = '/v2/payment/dynamicVoucher/{campaignID}'; $formParams = []; $queryParams = []; @@ -390,16 +506,11 @@ public function archiveDynamicVoucherCampaignRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +528,12 @@ public function archiveDynamicVoucherCampaignRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +549,11 @@ public function archiveDynamicVoucherCampaignRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +565,15 @@ public function archiveDynamicVoucherCampaignRequest($campaign_id) * Create dynamic voucher * * @param \OpenAPI\Client\Model\WTDynamicVoucherCreateParams $wt_dynamic_voucher_create_params wt_dynamic_voucher_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDynamicVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTDynamicVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError */ - public function createDynamicVoucher($wt_dynamic_voucher_create_params) + public function createDynamicVoucher($wt_dynamic_voucher_create_params, string $contentType = self::contentTypes['createDynamicVoucher'][0]) { - list($response) = $this->createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_params); + list($response) = $this->createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_params, $contentType); return $response; } @@ -470,14 +583,15 @@ public function createDynamicVoucher($wt_dynamic_voucher_create_params) * Create dynamic voucher * * @param \OpenAPI\Client\Model\WTDynamicVoucherCreateParams $wt_dynamic_voucher_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDynamicVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTDynamicVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_params) + public function createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_params, string $contentType = self::contentTypes['createDynamicVoucher'][0]) { - $request = $this->createDynamicVoucherRequest($wt_dynamic_voucher_create_params); + $request = $this->createDynamicVoucherRequest($wt_dynamic_voucher_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +634,21 @@ public function createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_para $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTDynamicVoucher' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +661,21 @@ public function createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_para $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +688,21 @@ public function createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_para $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +715,21 @@ public function createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_para $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -568,6 +742,21 @@ public function createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_para $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantNotInitialized' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -580,6 +769,21 @@ public function createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_para $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -594,6 +798,21 @@ public function createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_para $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -663,13 +882,14 @@ public function createDynamicVoucherWithHttpInfo($wt_dynamic_voucher_create_para * Create dynamic voucher * * @param \OpenAPI\Client\Model\WTDynamicVoucherCreateParams $wt_dynamic_voucher_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createDynamicVoucherAsync($wt_dynamic_voucher_create_params) + public function createDynamicVoucherAsync($wt_dynamic_voucher_create_params, string $contentType = self::contentTypes['createDynamicVoucher'][0]) { - return $this->createDynamicVoucherAsyncWithHttpInfo($wt_dynamic_voucher_create_params) + return $this->createDynamicVoucherAsyncWithHttpInfo($wt_dynamic_voucher_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -683,14 +903,15 @@ function ($response) { * Create dynamic voucher * * @param \OpenAPI\Client\Model\WTDynamicVoucherCreateParams $wt_dynamic_voucher_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createDynamicVoucherAsyncWithHttpInfo($wt_dynamic_voucher_create_params) + public function createDynamicVoucherAsyncWithHttpInfo($wt_dynamic_voucher_create_params, string $contentType = self::contentTypes['createDynamicVoucher'][0]) { $returnType = '\OpenAPI\Client\Model\WTDynamicVoucher'; - $request = $this->createDynamicVoucherRequest($wt_dynamic_voucher_create_params); + $request = $this->createDynamicVoucherRequest($wt_dynamic_voucher_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -700,6 +921,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -729,12 +953,14 @@ function ($exception) { * Create request for operation 'createDynamicVoucher' * * @param \OpenAPI\Client\Model\WTDynamicVoucherCreateParams $wt_dynamic_voucher_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createDynamicVoucherRequest($wt_dynamic_voucher_create_params) + public function createDynamicVoucherRequest($wt_dynamic_voucher_create_params, string $contentType = self::contentTypes['createDynamicVoucher'][0]) { + // verify the required parameter 'wt_dynamic_voucher_create_params' is set if ($wt_dynamic_voucher_create_params === null || (is_array($wt_dynamic_voucher_create_params) && count($wt_dynamic_voucher_create_params) === 0)) { throw new \InvalidArgumentException( @@ -742,6 +968,7 @@ public function createDynamicVoucherRequest($wt_dynamic_voucher_create_params) ); } + $resourcePath = '/v2/payment/dynamicVoucher'; $formParams = []; $queryParams = []; @@ -753,21 +980,17 @@ public function createDynamicVoucherRequest($wt_dynamic_voucher_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_dynamic_voucher_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_dynamic_voucher_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_dynamic_voucher_create_params)); } else { $httpBody = $wt_dynamic_voucher_create_params; } @@ -786,12 +1009,12 @@ public function createDynamicVoucherRequest($wt_dynamic_voucher_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -807,10 +1030,11 @@ public function createDynamicVoucherRequest($wt_dynamic_voucher_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -822,14 +1046,15 @@ public function createDynamicVoucherRequest($wt_dynamic_voucher_create_params) * Fetch all active dynamic vouchers * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllDynamicVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTDynamicVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllDynamicVouchers($is_archive_included = null) + public function fetchAllDynamicVouchers($is_archive_included = null, string $contentType = self::contentTypes['fetchAllDynamicVouchers'][0]) { - list($response) = $this->fetchAllDynamicVouchersWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllDynamicVouchersWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -839,14 +1064,15 @@ public function fetchAllDynamicVouchers($is_archive_included = null) * Fetch all active dynamic vouchers * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllDynamicVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTDynamicVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllDynamicVouchersWithHttpInfo($is_archive_included = null) + public function fetchAllDynamicVouchersWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllDynamicVouchers'][0]) { - $request = $this->fetchAllDynamicVouchersRequest($is_archive_included); + $request = $this->fetchAllDynamicVouchersRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -889,6 +1115,21 @@ public function fetchAllDynamicVouchersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTDynamicVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -901,6 +1142,21 @@ public function fetchAllDynamicVouchersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -913,6 +1169,21 @@ public function fetchAllDynamicVouchersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -925,6 +1196,21 @@ public function fetchAllDynamicVouchersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -939,6 +1225,21 @@ public function fetchAllDynamicVouchersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -992,13 +1293,14 @@ public function fetchAllDynamicVouchersWithHttpInfo($is_archive_included = null) * Fetch all active dynamic vouchers * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllDynamicVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllDynamicVouchersAsync($is_archive_included = null) + public function fetchAllDynamicVouchersAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllDynamicVouchers'][0]) { - return $this->fetchAllDynamicVouchersAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllDynamicVouchersAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -1012,14 +1314,15 @@ function ($response) { * Fetch all active dynamic vouchers * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllDynamicVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllDynamicVouchersAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllDynamicVouchersAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllDynamicVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\WTDynamicVoucher[]'; - $request = $this->fetchAllDynamicVouchersRequest($is_archive_included); + $request = $this->fetchAllDynamicVouchersRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1029,6 +1332,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1058,13 +1364,16 @@ function ($exception) { * Create request for operation 'fetchAllDynamicVouchers' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllDynamicVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllDynamicVouchersRequest($is_archive_included = null) + public function fetchAllDynamicVouchersRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllDynamicVouchers'][0]) { + + $resourcePath = '/v2/payment/dynamicVoucher/all'; $formParams = []; $queryParams = []; @@ -1073,30 +1382,23 @@ public function fetchAllDynamicVouchersRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1114,12 +1416,12 @@ public function fetchAllDynamicVouchersRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1135,10 +1437,11 @@ public function fetchAllDynamicVouchersRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1150,14 +1453,15 @@ public function fetchAllDynamicVouchersRequest($is_archive_included = null) * Fetch dynamic voucher * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTDynamicVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDynamicVoucherById($id) + public function fetchDynamicVoucherById($id, string $contentType = self::contentTypes['fetchDynamicVoucherById'][0]) { - list($response) = $this->fetchDynamicVoucherByIdWithHttpInfo($id); + list($response) = $this->fetchDynamicVoucherByIdWithHttpInfo($id, $contentType); return $response; } @@ -1167,14 +1471,15 @@ public function fetchDynamicVoucherById($id) * Fetch dynamic voucher * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTDynamicVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDynamicVoucherByIdWithHttpInfo($id) + public function fetchDynamicVoucherByIdWithHttpInfo($id, string $contentType = self::contentTypes['fetchDynamicVoucherById'][0]) { - $request = $this->fetchDynamicVoucherByIdRequest($id); + $request = $this->fetchDynamicVoucherByIdRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1217,6 +1522,21 @@ public function fetchDynamicVoucherByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTDynamicVoucher' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1229,6 +1549,21 @@ public function fetchDynamicVoucherByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1241,6 +1576,21 @@ public function fetchDynamicVoucherByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1253,6 +1603,21 @@ public function fetchDynamicVoucherByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1267,6 +1632,21 @@ public function fetchDynamicVoucherByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1320,13 +1700,14 @@ public function fetchDynamicVoucherByIdWithHttpInfo($id) * Fetch dynamic voucher * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDynamicVoucherByIdAsync($id) + public function fetchDynamicVoucherByIdAsync($id, string $contentType = self::contentTypes['fetchDynamicVoucherById'][0]) { - return $this->fetchDynamicVoucherByIdAsyncWithHttpInfo($id) + return $this->fetchDynamicVoucherByIdAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1340,14 +1721,15 @@ function ($response) { * Fetch dynamic voucher * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDynamicVoucherByIdAsyncWithHttpInfo($id) + public function fetchDynamicVoucherByIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchDynamicVoucherById'][0]) { $returnType = '\OpenAPI\Client\Model\WTDynamicVoucher'; - $request = $this->fetchDynamicVoucherByIdRequest($id); + $request = $this->fetchDynamicVoucherByIdRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1357,6 +1739,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1386,12 +1771,14 @@ function ($exception) { * Create request for operation 'fetchDynamicVoucherById' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDynamicVoucherByIdRequest($id) + public function fetchDynamicVoucherByIdRequest($id, string $contentType = self::contentTypes['fetchDynamicVoucherById'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1399,6 +1786,7 @@ public function fetchDynamicVoucherByIdRequest($id) ); } + $resourcePath = '/v2/payment/dynamicVoucher/{id}'; $formParams = []; $queryParams = []; @@ -1418,16 +1806,11 @@ public function fetchDynamicVoucherByIdRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1445,12 +1828,12 @@ public function fetchDynamicVoucherByIdRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1466,10 +1849,11 @@ public function fetchDynamicVoucherByIdRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1481,14 +1865,15 @@ public function fetchDynamicVoucherByIdRequest($id) * Fetch redemptions * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTDynamicVoucherRedemption[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDynamicVoucherRedemptions($id) + public function fetchDynamicVoucherRedemptions($id, string $contentType = self::contentTypes['fetchDynamicVoucherRedemptions'][0]) { - list($response) = $this->fetchDynamicVoucherRedemptionsWithHttpInfo($id); + list($response) = $this->fetchDynamicVoucherRedemptionsWithHttpInfo($id, $contentType); return $response; } @@ -1498,14 +1883,15 @@ public function fetchDynamicVoucherRedemptions($id) * Fetch redemptions * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTDynamicVoucherRedemption[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDynamicVoucherRedemptionsWithHttpInfo($id) + public function fetchDynamicVoucherRedemptionsWithHttpInfo($id, string $contentType = self::contentTypes['fetchDynamicVoucherRedemptions'][0]) { - $request = $this->fetchDynamicVoucherRedemptionsRequest($id); + $request = $this->fetchDynamicVoucherRedemptionsRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1548,6 +1934,21 @@ public function fetchDynamicVoucherRedemptionsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTDynamicVoucherRedemption[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1961,21 @@ public function fetchDynamicVoucherRedemptionsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1572,6 +1988,21 @@ public function fetchDynamicVoucherRedemptionsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1584,6 +2015,21 @@ public function fetchDynamicVoucherRedemptionsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1598,6 +2044,21 @@ public function fetchDynamicVoucherRedemptionsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1651,13 +2112,14 @@ public function fetchDynamicVoucherRedemptionsWithHttpInfo($id) * Fetch redemptions * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDynamicVoucherRedemptionsAsync($id) + public function fetchDynamicVoucherRedemptionsAsync($id, string $contentType = self::contentTypes['fetchDynamicVoucherRedemptions'][0]) { - return $this->fetchDynamicVoucherRedemptionsAsyncWithHttpInfo($id) + return $this->fetchDynamicVoucherRedemptionsAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1671,14 +2133,15 @@ function ($response) { * Fetch redemptions * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDynamicVoucherRedemptionsAsyncWithHttpInfo($id) + public function fetchDynamicVoucherRedemptionsAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchDynamicVoucherRedemptions'][0]) { $returnType = '\OpenAPI\Client\Model\WTDynamicVoucherRedemption[]'; - $request = $this->fetchDynamicVoucherRedemptionsRequest($id); + $request = $this->fetchDynamicVoucherRedemptionsRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1688,6 +2151,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1717,12 +2183,14 @@ function ($exception) { * Create request for operation 'fetchDynamicVoucherRedemptions' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDynamicVoucherRedemptionsRequest($id) + public function fetchDynamicVoucherRedemptionsRequest($id, string $contentType = self::contentTypes['fetchDynamicVoucherRedemptions'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1730,6 +2198,7 @@ public function fetchDynamicVoucherRedemptionsRequest($id) ); } + $resourcePath = '/v2/payment/dynamicVoucher/redemptions/{id}'; $formParams = []; $queryParams = []; @@ -1749,16 +2218,11 @@ public function fetchDynamicVoucherRedemptionsRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1776,12 +2240,12 @@ public function fetchDynamicVoucherRedemptionsRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1797,10 +2261,11 @@ public function fetchDynamicVoucherRedemptionsRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1813,14 +2278,15 @@ public function fetchDynamicVoucherRedemptionsRequest($id) * * @param \DateTime $broadcast_scheduled_start_at broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllDynamicVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchReachStatsOfAllDynamicVouchers($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllDynamicVouchers($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllDynamicVouchers'][0]) { - list($response) = $this->fetchReachStatsOfAllDynamicVouchersWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + list($response) = $this->fetchReachStatsOfAllDynamicVouchersWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $response; } @@ -1831,14 +2297,15 @@ public function fetchReachStatsOfAllDynamicVouchers($broadcast_scheduled_start_a * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllDynamicVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchReachStatsOfAllDynamicVouchersWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllDynamicVouchersWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllDynamicVouchers'][0]) { - $request = $this->fetchReachStatsOfAllDynamicVouchersRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfAllDynamicVouchersRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); try { $options = $this->createHttpClientOption(); @@ -1881,6 +2348,21 @@ public function fetchReachStatsOfAllDynamicVouchersWithHttpInfo($broadcast_sched $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ReachPerformanceStats' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1893,6 +2375,21 @@ public function fetchReachStatsOfAllDynamicVouchersWithHttpInfo($broadcast_sched $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1905,6 +2402,21 @@ public function fetchReachStatsOfAllDynamicVouchersWithHttpInfo($broadcast_sched $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1917,6 +2429,21 @@ public function fetchReachStatsOfAllDynamicVouchersWithHttpInfo($broadcast_sched $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1931,6 +2458,21 @@ public function fetchReachStatsOfAllDynamicVouchersWithHttpInfo($broadcast_sched $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1985,13 +2527,14 @@ public function fetchReachStatsOfAllDynamicVouchersWithHttpInfo($broadcast_sched * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllDynamicVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfAllDynamicVouchersAsync($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllDynamicVouchersAsync($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllDynamicVouchers'][0]) { - return $this->fetchReachStatsOfAllDynamicVouchersAsyncWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at) + return $this->fetchReachStatsOfAllDynamicVouchersAsyncWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType) ->then( function ($response) { return $response[0]; @@ -2006,14 +2549,15 @@ function ($response) { * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllDynamicVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfAllDynamicVouchersAsyncWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllDynamicVouchersAsyncWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllDynamicVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\ReachPerformanceStats'; - $request = $this->fetchReachStatsOfAllDynamicVouchersRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfAllDynamicVouchersRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2023,6 +2567,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2053,13 +2600,17 @@ function ($exception) { * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllDynamicVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchReachStatsOfAllDynamicVouchersRequest($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllDynamicVouchersRequest($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllDynamicVouchers'][0]) { + + + $resourcePath = '/v2/payment/dynamicVoucher/reach/all'; $formParams = []; $queryParams = []; @@ -2068,41 +2619,32 @@ public function fetchReachStatsOfAllDynamicVouchersRequest($broadcast_scheduled_ $multipart = false; // query params - if ($broadcast_scheduled_start_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_start_at)) { - foreach($broadcast_scheduled_start_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledStartAt'] = $broadcast_scheduled_start_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_start_at, + 'broadcastScheduledStartAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($broadcast_scheduled_end_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_end_at)) { - foreach($broadcast_scheduled_end_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledEndAt'] = $broadcast_scheduled_end_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_end_at, + 'broadcastScheduledEndAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2120,12 +2662,12 @@ public function fetchReachStatsOfAllDynamicVouchersRequest($broadcast_scheduled_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2141,10 +2683,11 @@ public function fetchReachStatsOfAllDynamicVouchersRequest($broadcast_scheduled_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2158,14 +2701,15 @@ public function fetchReachStatsOfAllDynamicVouchersRequest($broadcast_scheduled_ * @param mixed $dynamic_voucher_id dynamic_voucher_id (required) * @param \DateTime $broadcast_scheduled_start_at broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualDynamicVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchReachStatsOfIndividualDynamicVoucher($dynamic_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualDynamicVoucher($dynamic_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualDynamicVoucher'][0]) { - list($response) = $this->fetchReachStatsOfIndividualDynamicVoucherWithHttpInfo($dynamic_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + list($response) = $this->fetchReachStatsOfIndividualDynamicVoucherWithHttpInfo($dynamic_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $response; } @@ -2177,14 +2721,15 @@ public function fetchReachStatsOfIndividualDynamicVoucher($dynamic_voucher_id, $ * @param mixed $dynamic_voucher_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualDynamicVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchReachStatsOfIndividualDynamicVoucherWithHttpInfo($dynamic_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualDynamicVoucherWithHttpInfo($dynamic_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualDynamicVoucher'][0]) { - $request = $this->fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); try { $options = $this->createHttpClientOption(); @@ -2227,6 +2772,21 @@ public function fetchReachStatsOfIndividualDynamicVoucherWithHttpInfo($dynamic_v $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ReachPerformanceStats' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2239,6 +2799,21 @@ public function fetchReachStatsOfIndividualDynamicVoucherWithHttpInfo($dynamic_v $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2251,6 +2826,21 @@ public function fetchReachStatsOfIndividualDynamicVoucherWithHttpInfo($dynamic_v $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2263,6 +2853,21 @@ public function fetchReachStatsOfIndividualDynamicVoucherWithHttpInfo($dynamic_v $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2277,6 +2882,21 @@ public function fetchReachStatsOfIndividualDynamicVoucherWithHttpInfo($dynamic_v $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2332,13 +2952,14 @@ public function fetchReachStatsOfIndividualDynamicVoucherWithHttpInfo($dynamic_v * @param mixed $dynamic_voucher_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfIndividualDynamicVoucherAsync($dynamic_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualDynamicVoucherAsync($dynamic_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualDynamicVoucher'][0]) { - return $this->fetchReachStatsOfIndividualDynamicVoucherAsyncWithHttpInfo($dynamic_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at) + return $this->fetchReachStatsOfIndividualDynamicVoucherAsyncWithHttpInfo($dynamic_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType) ->then( function ($response) { return $response[0]; @@ -2354,14 +2975,15 @@ function ($response) { * @param mixed $dynamic_voucher_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfIndividualDynamicVoucherAsyncWithHttpInfo($dynamic_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualDynamicVoucherAsyncWithHttpInfo($dynamic_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualDynamicVoucher'][0]) { $returnType = '\OpenAPI\Client\Model\ReachPerformanceStats'; - $request = $this->fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2371,6 +2993,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2402,12 +3027,14 @@ function ($exception) { * @param mixed $dynamic_voucher_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualDynamicVoucher'][0]) { + // verify the required parameter 'dynamic_voucher_id' is set if ($dynamic_voucher_id === null || (is_array($dynamic_voucher_id) && count($dynamic_voucher_id) === 0)) { throw new \InvalidArgumentException( @@ -2415,6 +3042,9 @@ public function fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_vouche ); } + + + $resourcePath = '/v2/payment/dynamicVoucher/reach/{dynamicVoucherID}'; $formParams = []; $queryParams = []; @@ -2423,27 +3053,23 @@ public function fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_vouche $multipart = false; // query params - if ($broadcast_scheduled_start_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_start_at)) { - foreach($broadcast_scheduled_start_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledStartAt'] = $broadcast_scheduled_start_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_start_at, + 'broadcastScheduledStartAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($broadcast_scheduled_end_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_end_at)) { - foreach($broadcast_scheduled_end_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledEndAt'] = $broadcast_scheduled_end_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_end_at, + 'broadcastScheduledEndAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -2456,16 +3082,11 @@ public function fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_vouche } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2483,12 +3104,12 @@ public function fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_vouche // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2504,10 +3125,11 @@ public function fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_vouche $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2519,14 +3141,15 @@ public function fetchReachStatsOfIndividualDynamicVoucherRequest($dynamic_vouche * Restore dynamic voucher campaign * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDynamicVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DynamicVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreDynamicVoucherCampaign($campaign_id) + public function restoreDynamicVoucherCampaign($campaign_id, string $contentType = self::contentTypes['restoreDynamicVoucherCampaign'][0]) { - list($response) = $this->restoreDynamicVoucherCampaignWithHttpInfo($campaign_id); + list($response) = $this->restoreDynamicVoucherCampaignWithHttpInfo($campaign_id, $contentType); return $response; } @@ -2536,14 +3159,15 @@ public function restoreDynamicVoucherCampaign($campaign_id) * Restore dynamic voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDynamicVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DynamicVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreDynamicVoucherCampaignWithHttpInfo($campaign_id) + public function restoreDynamicVoucherCampaignWithHttpInfo($campaign_id, string $contentType = self::contentTypes['restoreDynamicVoucherCampaign'][0]) { - $request = $this->restoreDynamicVoucherCampaignRequest($campaign_id); + $request = $this->restoreDynamicVoucherCampaignRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2586,6 +3210,21 @@ public function restoreDynamicVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DynamicVoucher' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2598,6 +3237,21 @@ public function restoreDynamicVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2610,6 +3264,21 @@ public function restoreDynamicVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2622,6 +3291,21 @@ public function restoreDynamicVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2636,6 +3320,21 @@ public function restoreDynamicVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2689,13 +3388,14 @@ public function restoreDynamicVoucherCampaignWithHttpInfo($campaign_id) * Restore dynamic voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDynamicVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreDynamicVoucherCampaignAsync($campaign_id) + public function restoreDynamicVoucherCampaignAsync($campaign_id, string $contentType = self::contentTypes['restoreDynamicVoucherCampaign'][0]) { - return $this->restoreDynamicVoucherCampaignAsyncWithHttpInfo($campaign_id) + return $this->restoreDynamicVoucherCampaignAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2709,14 +3409,15 @@ function ($response) { * Restore dynamic voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDynamicVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreDynamicVoucherCampaignAsyncWithHttpInfo($campaign_id) + public function restoreDynamicVoucherCampaignAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['restoreDynamicVoucherCampaign'][0]) { $returnType = '\OpenAPI\Client\Model\DynamicVoucher'; - $request = $this->restoreDynamicVoucherCampaignRequest($campaign_id); + $request = $this->restoreDynamicVoucherCampaignRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2726,6 +3427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2755,12 +3459,14 @@ function ($exception) { * Create request for operation 'restoreDynamicVoucherCampaign' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreDynamicVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreDynamicVoucherCampaignRequest($campaign_id) + public function restoreDynamicVoucherCampaignRequest($campaign_id, string $contentType = self::contentTypes['restoreDynamicVoucherCampaign'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -2768,6 +3474,7 @@ public function restoreDynamicVoucherCampaignRequest($campaign_id) ); } + $resourcePath = '/v2/payment/dynamicVoucher/{campaignID}'; $formParams = []; $queryParams = []; @@ -2787,16 +3494,11 @@ public function restoreDynamicVoucherCampaignRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2814,12 +3516,12 @@ public function restoreDynamicVoucherCampaignRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2835,10 +3537,11 @@ public function restoreDynamicVoucherCampaignRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2851,14 +3554,15 @@ public function restoreDynamicVoucherCampaignRequest($campaign_id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTDynamicVoucherUpdateParams $wt_dynamic_voucher_update_params wt_dynamic_voucher_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveDynamicVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTDynamicVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function saveDynamicVoucher($id, $wt_dynamic_voucher_update_params) + public function saveDynamicVoucher($id, $wt_dynamic_voucher_update_params, string $contentType = self::contentTypes['saveDynamicVoucher'][0]) { - list($response) = $this->saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_params); + list($response) = $this->saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_params, $contentType); return $response; } @@ -2869,14 +3573,15 @@ public function saveDynamicVoucher($id, $wt_dynamic_voucher_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTDynamicVoucherUpdateParams $wt_dynamic_voucher_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveDynamicVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTDynamicVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_params) + public function saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_params, string $contentType = self::contentTypes['saveDynamicVoucher'][0]) { - $request = $this->saveDynamicVoucherRequest($id, $wt_dynamic_voucher_update_params); + $request = $this->saveDynamicVoucherRequest($id, $wt_dynamic_voucher_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -2919,6 +3624,21 @@ public function saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTDynamicVoucher' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2931,6 +3651,21 @@ public function saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2943,6 +3678,21 @@ public function saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2955,6 +3705,21 @@ public function saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2967,6 +3732,21 @@ public function saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2979,6 +3759,21 @@ public function saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2993,6 +3788,21 @@ public function saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3063,13 +3873,14 @@ public function saveDynamicVoucherWithHttpInfo($id, $wt_dynamic_voucher_update_p * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTDynamicVoucherUpdateParams $wt_dynamic_voucher_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveDynamicVoucherAsync($id, $wt_dynamic_voucher_update_params) + public function saveDynamicVoucherAsync($id, $wt_dynamic_voucher_update_params, string $contentType = self::contentTypes['saveDynamicVoucher'][0]) { - return $this->saveDynamicVoucherAsyncWithHttpInfo($id, $wt_dynamic_voucher_update_params) + return $this->saveDynamicVoucherAsyncWithHttpInfo($id, $wt_dynamic_voucher_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -3084,14 +3895,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTDynamicVoucherUpdateParams $wt_dynamic_voucher_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveDynamicVoucherAsyncWithHttpInfo($id, $wt_dynamic_voucher_update_params) + public function saveDynamicVoucherAsyncWithHttpInfo($id, $wt_dynamic_voucher_update_params, string $contentType = self::contentTypes['saveDynamicVoucher'][0]) { $returnType = '\OpenAPI\Client\Model\WTDynamicVoucher'; - $request = $this->saveDynamicVoucherRequest($id, $wt_dynamic_voucher_update_params); + $request = $this->saveDynamicVoucherRequest($id, $wt_dynamic_voucher_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3101,6 +3913,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3131,18 +3946,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTDynamicVoucherUpdateParams $wt_dynamic_voucher_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function saveDynamicVoucherRequest($id, $wt_dynamic_voucher_update_params) + public function saveDynamicVoucherRequest($id, $wt_dynamic_voucher_update_params, string $contentType = self::contentTypes['saveDynamicVoucher'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling saveDynamicVoucher' ); } + // verify the required parameter 'wt_dynamic_voucher_update_params' is set if ($wt_dynamic_voucher_update_params === null || (is_array($wt_dynamic_voucher_update_params) && count($wt_dynamic_voucher_update_params) === 0)) { throw new \InvalidArgumentException( @@ -3150,6 +3968,7 @@ public function saveDynamicVoucherRequest($id, $wt_dynamic_voucher_update_params ); } + $resourcePath = '/v2/payment/dynamicVoucher/{id}'; $formParams = []; $queryParams = []; @@ -3169,21 +3988,17 @@ public function saveDynamicVoucherRequest($id, $wt_dynamic_voucher_update_params } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_dynamic_voucher_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_dynamic_voucher_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_dynamic_voucher_update_params)); } else { $httpBody = $wt_dynamic_voucher_update_params; } @@ -3202,12 +4017,12 @@ public function saveDynamicVoucherRequest($id, $wt_dynamic_voucher_update_params // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3223,10 +4038,11 @@ public function saveDynamicVoucherRequest($id, $wt_dynamic_voucher_update_params $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/EmailSubscriberApi.php b/lib/Api/EmailSubscriberApi.php index 3685349..e25ba9b 100644 --- a/lib/Api/EmailSubscriberApi.php +++ b/lib/Api/EmailSubscriberApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createEmailSubscriber' => [ + 'application/json', + ], + 'fetchAllEmailSubscribers' => [ + 'application/json', + ], + 'restoreEmailSubscriber' => [ + 'application/json', + ], + 'updateEmailSubscriber' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive email subscriber * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveEmailSubscriber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmailSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveEmailSubscriber($id) + public function archiveEmailSubscriber($id, string $contentType = self::contentTypes['archiveEmailSubscriber'][0]) { - list($response) = $this->archiveEmailSubscriberWithHttpInfo($id); + list($response) = $this->archiveEmailSubscriberWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveEmailSubscriber($id) * Archive email subscriber * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveEmailSubscriber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmailSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveEmailSubscriberWithHttpInfo($id) + public function archiveEmailSubscriberWithHttpInfo($id, string $contentType = self::contentTypes['archiveEmailSubscriber'][0]) { - $request = $this->archiveEmailSubscriberRequest($id); + $request = $this->archiveEmailSubscriberRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveEmailSubscriberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EmailSubscriber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveEmailSubscriberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveEmailSubscriberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveEmailSubscriberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveEmailSubscriberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveEmailSubscriberWithHttpInfo($id) * Archive email subscriber * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveEmailSubscriberAsync($id) + public function archiveEmailSubscriberAsync($id, string $contentType = self::contentTypes['archiveEmailSubscriber'][0]) { - return $this->archiveEmailSubscriberAsyncWithHttpInfo($id) + return $this->archiveEmailSubscriberAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive email subscriber * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveEmailSubscriberAsyncWithHttpInfo($id) + public function archiveEmailSubscriberAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveEmailSubscriber'][0]) { $returnType = '\OpenAPI\Client\Model\EmailSubscriber'; - $request = $this->archiveEmailSubscriberRequest($id); + $request = $this->archiveEmailSubscriberRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveEmailSubscriber' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveEmailSubscriberRequest($id) + public function archiveEmailSubscriberRequest($id, string $contentType = self::contentTypes['archiveEmailSubscriber'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveEmailSubscriberRequest($id) ); } + $resourcePath = '/v2/emailSubscriber/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveEmailSubscriberRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveEmailSubscriberRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveEmailSubscriberRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveEmailSubscriberRequest($id) * Create email subscriber * * @param \OpenAPI\Client\Model\WTEmailSubscriberCreateParams $wt_email_subscriber_create_params wt_email_subscriber_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmailSubscriber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmailSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createEmailSubscriber($wt_email_subscriber_create_params) + public function createEmailSubscriber($wt_email_subscriber_create_params, string $contentType = self::contentTypes['createEmailSubscriber'][0]) { - list($response) = $this->createEmailSubscriberWithHttpInfo($wt_email_subscriber_create_params); + list($response) = $this->createEmailSubscriberWithHttpInfo($wt_email_subscriber_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createEmailSubscriber($wt_email_subscriber_create_params) * Create email subscriber * * @param \OpenAPI\Client\Model\WTEmailSubscriberCreateParams $wt_email_subscriber_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmailSubscriber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmailSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createEmailSubscriberWithHttpInfo($wt_email_subscriber_create_params) + public function createEmailSubscriberWithHttpInfo($wt_email_subscriber_create_params, string $contentType = self::contentTypes['createEmailSubscriber'][0]) { - $request = $this->createEmailSubscriberRequest($wt_email_subscriber_create_params); + $request = $this->createEmailSubscriberRequest($wt_email_subscriber_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createEmailSubscriberWithHttpInfo($wt_email_subscriber_create_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EmailSubscriber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createEmailSubscriberWithHttpInfo($wt_email_subscriber_create_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createEmailSubscriberWithHttpInfo($wt_email_subscriber_create_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createEmailSubscriberWithHttpInfo($wt_email_subscriber_create_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createEmailSubscriberWithHttpInfo($wt_email_subscriber_create_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createEmailSubscriberWithHttpInfo($wt_email_subscriber_create_pa * Create email subscriber * * @param \OpenAPI\Client\Model\WTEmailSubscriberCreateParams $wt_email_subscriber_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEmailSubscriberAsync($wt_email_subscriber_create_params) + public function createEmailSubscriberAsync($wt_email_subscriber_create_params, string $contentType = self::contentTypes['createEmailSubscriber'][0]) { - return $this->createEmailSubscriberAsyncWithHttpInfo($wt_email_subscriber_create_params) + return $this->createEmailSubscriberAsyncWithHttpInfo($wt_email_subscriber_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create email subscriber * * @param \OpenAPI\Client\Model\WTEmailSubscriberCreateParams $wt_email_subscriber_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEmailSubscriberAsyncWithHttpInfo($wt_email_subscriber_create_params) + public function createEmailSubscriberAsyncWithHttpInfo($wt_email_subscriber_create_params, string $contentType = self::contentTypes['createEmailSubscriber'][0]) { $returnType = '\OpenAPI\Client\Model\EmailSubscriber'; - $request = $this->createEmailSubscriberRequest($wt_email_subscriber_create_params); + $request = $this->createEmailSubscriberRequest($wt_email_subscriber_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createEmailSubscriber' * * @param \OpenAPI\Client\Model\WTEmailSubscriberCreateParams $wt_email_subscriber_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createEmailSubscriberRequest($wt_email_subscriber_create_params) + public function createEmailSubscriberRequest($wt_email_subscriber_create_params, string $contentType = self::contentTypes['createEmailSubscriber'][0]) { + // verify the required parameter 'wt_email_subscriber_create_params' is set if ($wt_email_subscriber_create_params === null || (is_array($wt_email_subscriber_create_params) && count($wt_email_subscriber_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createEmailSubscriberRequest($wt_email_subscriber_create_params) ); } + $resourcePath = '/v2/emailSubscriber'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createEmailSubscriberRequest($wt_email_subscriber_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_email_subscriber_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_email_subscriber_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_email_subscriber_create_params)); } else { $httpBody = $wt_email_subscriber_create_params; } @@ -746,12 +927,12 @@ public function createEmailSubscriberRequest($wt_email_subscriber_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createEmailSubscriberRequest($wt_email_subscriber_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -784,14 +966,15 @@ public function createEmailSubscriberRequest($wt_email_subscriber_create_params) * @param \DateTime $start_date_time start_date_time (optional) * @param \DateTime $end_date_time end_date_time (optional) * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllEmailSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllEmailSubscribers($start_date_time = null, $end_date_time = null, $is_archive_included = null) + public function fetchAllEmailSubscribers($start_date_time = null, $end_date_time = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllEmailSubscribers'][0]) { - list($response) = $this->fetchAllEmailSubscribersWithHttpInfo($start_date_time, $end_date_time, $is_archive_included); + list($response) = $this->fetchAllEmailSubscribersWithHttpInfo($start_date_time, $end_date_time, $is_archive_included, $contentType); return $response; } @@ -803,14 +986,15 @@ public function fetchAllEmailSubscribers($start_date_time = null, $end_date_time * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllEmailSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllEmailSubscribersWithHttpInfo($start_date_time = null, $end_date_time = null, $is_archive_included = null) + public function fetchAllEmailSubscribersWithHttpInfo($start_date_time = null, $end_date_time = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllEmailSubscribers'][0]) { - $request = $this->fetchAllEmailSubscribersRequest($start_date_time, $end_date_time, $is_archive_included); + $request = $this->fetchAllEmailSubscribersRequest($start_date_time, $end_date_time, $is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -853,6 +1037,21 @@ public function fetchAllEmailSubscribersWithHttpInfo($start_date_time = null, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -865,6 +1064,21 @@ public function fetchAllEmailSubscribersWithHttpInfo($start_date_time = null, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -877,6 +1091,21 @@ public function fetchAllEmailSubscribersWithHttpInfo($start_date_time = null, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -889,6 +1118,21 @@ public function fetchAllEmailSubscribersWithHttpInfo($start_date_time = null, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -903,6 +1147,21 @@ public function fetchAllEmailSubscribersWithHttpInfo($start_date_time = null, $e $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -958,13 +1217,14 @@ public function fetchAllEmailSubscribersWithHttpInfo($start_date_time = null, $e * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllEmailSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllEmailSubscribersAsync($start_date_time = null, $end_date_time = null, $is_archive_included = null) + public function fetchAllEmailSubscribersAsync($start_date_time = null, $end_date_time = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllEmailSubscribers'][0]) { - return $this->fetchAllEmailSubscribersAsyncWithHttpInfo($start_date_time, $end_date_time, $is_archive_included) + return $this->fetchAllEmailSubscribersAsyncWithHttpInfo($start_date_time, $end_date_time, $is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -980,14 +1240,15 @@ function ($response) { * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllEmailSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllEmailSubscribersAsyncWithHttpInfo($start_date_time = null, $end_date_time = null, $is_archive_included = null) + public function fetchAllEmailSubscribersAsyncWithHttpInfo($start_date_time = null, $end_date_time = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllEmailSubscribers'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllEmailSubscribersRequest($start_date_time, $end_date_time, $is_archive_included); + $request = $this->fetchAllEmailSubscribersRequest($start_date_time, $end_date_time, $is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -997,6 +1258,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1028,13 +1292,18 @@ function ($exception) { * @param \DateTime $start_date_time (optional) * @param \DateTime $end_date_time (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllEmailSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllEmailSubscribersRequest($start_date_time = null, $end_date_time = null, $is_archive_included = null) + public function fetchAllEmailSubscribersRequest($start_date_time = null, $end_date_time = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllEmailSubscribers'][0]) { + + + + $resourcePath = '/v2/emailSubscriber/all'; $formParams = []; $queryParams = []; @@ -1043,52 +1312,41 @@ public function fetchAllEmailSubscribersRequest($start_date_time = null, $end_da $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1106,12 +1364,12 @@ public function fetchAllEmailSubscribersRequest($start_date_time = null, $end_da // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1127,10 +1385,11 @@ public function fetchAllEmailSubscribersRequest($start_date_time = null, $end_da $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1142,14 +1401,15 @@ public function fetchAllEmailSubscribersRequest($start_date_time = null, $end_da * Restore email subscriber * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreEmailSubscriber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmailSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreEmailSubscriber($id) + public function restoreEmailSubscriber($id, string $contentType = self::contentTypes['restoreEmailSubscriber'][0]) { - list($response) = $this->restoreEmailSubscriberWithHttpInfo($id); + list($response) = $this->restoreEmailSubscriberWithHttpInfo($id, $contentType); return $response; } @@ -1159,14 +1419,15 @@ public function restoreEmailSubscriber($id) * Restore email subscriber * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreEmailSubscriber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmailSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreEmailSubscriberWithHttpInfo($id) + public function restoreEmailSubscriberWithHttpInfo($id, string $contentType = self::contentTypes['restoreEmailSubscriber'][0]) { - $request = $this->restoreEmailSubscriberRequest($id); + $request = $this->restoreEmailSubscriberRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1209,6 +1470,21 @@ public function restoreEmailSubscriberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EmailSubscriber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1221,6 +1497,21 @@ public function restoreEmailSubscriberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1233,6 +1524,21 @@ public function restoreEmailSubscriberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1245,6 +1551,21 @@ public function restoreEmailSubscriberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1259,6 +1580,21 @@ public function restoreEmailSubscriberWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1312,13 +1648,14 @@ public function restoreEmailSubscriberWithHttpInfo($id) * Restore email subscriber * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreEmailSubscriberAsync($id) + public function restoreEmailSubscriberAsync($id, string $contentType = self::contentTypes['restoreEmailSubscriber'][0]) { - return $this->restoreEmailSubscriberAsyncWithHttpInfo($id) + return $this->restoreEmailSubscriberAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1332,14 +1669,15 @@ function ($response) { * Restore email subscriber * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreEmailSubscriberAsyncWithHttpInfo($id) + public function restoreEmailSubscriberAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreEmailSubscriber'][0]) { $returnType = '\OpenAPI\Client\Model\EmailSubscriber'; - $request = $this->restoreEmailSubscriberRequest($id); + $request = $this->restoreEmailSubscriberRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1349,6 +1687,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1378,12 +1719,14 @@ function ($exception) { * Create request for operation 'restoreEmailSubscriber' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreEmailSubscriberRequest($id) + public function restoreEmailSubscriberRequest($id, string $contentType = self::contentTypes['restoreEmailSubscriber'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1391,6 +1734,7 @@ public function restoreEmailSubscriberRequest($id) ); } + $resourcePath = '/v2/emailSubscriber/{id}'; $formParams = []; $queryParams = []; @@ -1410,16 +1754,11 @@ public function restoreEmailSubscriberRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1437,12 +1776,12 @@ public function restoreEmailSubscriberRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1458,10 +1797,11 @@ public function restoreEmailSubscriberRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1474,14 +1814,15 @@ public function restoreEmailSubscriberRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTEmailSubscriberUpdateParams $wt_email_subscriber_update_params wt_email_subscriber_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailSubscriber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmailSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateEmailSubscriber($id, $wt_email_subscriber_update_params) + public function updateEmailSubscriber($id, $wt_email_subscriber_update_params, string $contentType = self::contentTypes['updateEmailSubscriber'][0]) { - list($response) = $this->updateEmailSubscriberWithHttpInfo($id, $wt_email_subscriber_update_params); + list($response) = $this->updateEmailSubscriberWithHttpInfo($id, $wt_email_subscriber_update_params, $contentType); return $response; } @@ -1492,14 +1833,15 @@ public function updateEmailSubscriber($id, $wt_email_subscriber_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTEmailSubscriberUpdateParams $wt_email_subscriber_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailSubscriber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmailSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmailSubscriberWithHttpInfo($id, $wt_email_subscriber_update_params) + public function updateEmailSubscriberWithHttpInfo($id, $wt_email_subscriber_update_params, string $contentType = self::contentTypes['updateEmailSubscriber'][0]) { - $request = $this->updateEmailSubscriberRequest($id, $wt_email_subscriber_update_params); + $request = $this->updateEmailSubscriberRequest($id, $wt_email_subscriber_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1542,6 +1884,21 @@ public function updateEmailSubscriberWithHttpInfo($id, $wt_email_subscriber_upda $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EmailSubscriber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1554,6 +1911,21 @@ public function updateEmailSubscriberWithHttpInfo($id, $wt_email_subscriber_upda $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1566,6 +1938,21 @@ public function updateEmailSubscriberWithHttpInfo($id, $wt_email_subscriber_upda $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1578,6 +1965,21 @@ public function updateEmailSubscriberWithHttpInfo($id, $wt_email_subscriber_upda $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1592,6 +1994,21 @@ public function updateEmailSubscriberWithHttpInfo($id, $wt_email_subscriber_upda $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1646,13 +2063,14 @@ public function updateEmailSubscriberWithHttpInfo($id, $wt_email_subscriber_upda * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTEmailSubscriberUpdateParams $wt_email_subscriber_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateEmailSubscriberAsync($id, $wt_email_subscriber_update_params) + public function updateEmailSubscriberAsync($id, $wt_email_subscriber_update_params, string $contentType = self::contentTypes['updateEmailSubscriber'][0]) { - return $this->updateEmailSubscriberAsyncWithHttpInfo($id, $wt_email_subscriber_update_params) + return $this->updateEmailSubscriberAsyncWithHttpInfo($id, $wt_email_subscriber_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1667,14 +2085,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTEmailSubscriberUpdateParams $wt_email_subscriber_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateEmailSubscriberAsyncWithHttpInfo($id, $wt_email_subscriber_update_params) + public function updateEmailSubscriberAsyncWithHttpInfo($id, $wt_email_subscriber_update_params, string $contentType = self::contentTypes['updateEmailSubscriber'][0]) { $returnType = '\OpenAPI\Client\Model\EmailSubscriber'; - $request = $this->updateEmailSubscriberRequest($id, $wt_email_subscriber_update_params); + $request = $this->updateEmailSubscriberRequest($id, $wt_email_subscriber_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1684,6 +2103,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1714,18 +2136,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTEmailSubscriberUpdateParams $wt_email_subscriber_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailSubscriber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateEmailSubscriberRequest($id, $wt_email_subscriber_update_params) + public function updateEmailSubscriberRequest($id, $wt_email_subscriber_update_params, string $contentType = self::contentTypes['updateEmailSubscriber'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateEmailSubscriber' ); } + // verify the required parameter 'wt_email_subscriber_update_params' is set if ($wt_email_subscriber_update_params === null || (is_array($wt_email_subscriber_update_params) && count($wt_email_subscriber_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1733,6 +2158,7 @@ public function updateEmailSubscriberRequest($id, $wt_email_subscriber_update_pa ); } + $resourcePath = '/v2/emailSubscriber/{id}'; $formParams = []; $queryParams = []; @@ -1752,21 +2178,17 @@ public function updateEmailSubscriberRequest($id, $wt_email_subscriber_update_pa } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_email_subscriber_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_email_subscriber_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_email_subscriber_update_params)); } else { $httpBody = $wt_email_subscriber_update_params; } @@ -1785,12 +2207,12 @@ public function updateEmailSubscriberRequest($id, $wt_email_subscriber_update_pa // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1806,10 +2228,11 @@ public function updateEmailSubscriberRequest($id, $wt_email_subscriber_update_pa $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/EmployeeAPIKeysApi.php b/lib/Api/EmployeeAPIKeysApi.php index ec12de3..2274d9c 100644 --- a/lib/Api/EmployeeAPIKeysApi.php +++ b/lib/Api/EmployeeAPIKeysApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createEmployeeAPIKeys' => [ + 'application/json', + ], + 'fetchAllEmployeeAPIKeys' => [ + 'application/json', + ], + 'fetchEmployeeAPIKeyById' => [ + 'application/json', + ], + 'updateEmployeeAPIKeys' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive employee API Key * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveEmployeeAPIKeys'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmployeeAPIKey|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveEmployeeAPIKeys($id) + public function archiveEmployeeAPIKeys($id, string $contentType = self::contentTypes['archiveEmployeeAPIKeys'][0]) { - list($response) = $this->archiveEmployeeAPIKeysWithHttpInfo($id); + list($response) = $this->archiveEmployeeAPIKeysWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveEmployeeAPIKeys($id) * Archive employee API Key * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveEmployeeAPIKeys'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmployeeAPIKey|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveEmployeeAPIKeysWithHttpInfo($id) + public function archiveEmployeeAPIKeysWithHttpInfo($id, string $contentType = self::contentTypes['archiveEmployeeAPIKeys'][0]) { - $request = $this->archiveEmployeeAPIKeysRequest($id); + $request = $this->archiveEmployeeAPIKeysRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveEmployeeAPIKeysWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EmployeeAPIKey' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveEmployeeAPIKeysWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveEmployeeAPIKeysWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveEmployeeAPIKeysWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveEmployeeAPIKeysWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveEmployeeAPIKeysWithHttpInfo($id) * Archive employee API Key * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveEmployeeAPIKeysAsync($id) + public function archiveEmployeeAPIKeysAsync($id, string $contentType = self::contentTypes['archiveEmployeeAPIKeys'][0]) { - return $this->archiveEmployeeAPIKeysAsyncWithHttpInfo($id) + return $this->archiveEmployeeAPIKeysAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive employee API Key * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveEmployeeAPIKeysAsyncWithHttpInfo($id) + public function archiveEmployeeAPIKeysAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveEmployeeAPIKeys'][0]) { $returnType = '\OpenAPI\Client\Model\EmployeeAPIKey'; - $request = $this->archiveEmployeeAPIKeysRequest($id); + $request = $this->archiveEmployeeAPIKeysRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveEmployeeAPIKeys' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveEmployeeAPIKeysRequest($id) + public function archiveEmployeeAPIKeysRequest($id, string $contentType = self::contentTypes['archiveEmployeeAPIKeys'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveEmployeeAPIKeysRequest($id) ); } + $resourcePath = '/v2/employee/apiKeys/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveEmployeeAPIKeysRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveEmployeeAPIKeysRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveEmployeeAPIKeysRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveEmployeeAPIKeysRequest($id) * Create employee API Key * * @param \OpenAPI\Client\Model\WTEmployeeAPIKeyCreateParams $wt_employee_api_key_create_params wt_employee_api_key_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeAPIKeys'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmployeeAPIKey|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createEmployeeAPIKeys($wt_employee_api_key_create_params) + public function createEmployeeAPIKeys($wt_employee_api_key_create_params, string $contentType = self::contentTypes['createEmployeeAPIKeys'][0]) { - list($response) = $this->createEmployeeAPIKeysWithHttpInfo($wt_employee_api_key_create_params); + list($response) = $this->createEmployeeAPIKeysWithHttpInfo($wt_employee_api_key_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createEmployeeAPIKeys($wt_employee_api_key_create_params) * Create employee API Key * * @param \OpenAPI\Client\Model\WTEmployeeAPIKeyCreateParams $wt_employee_api_key_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeAPIKeys'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmployeeAPIKey|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeAPIKeysWithHttpInfo($wt_employee_api_key_create_params) + public function createEmployeeAPIKeysWithHttpInfo($wt_employee_api_key_create_params, string $contentType = self::contentTypes['createEmployeeAPIKeys'][0]) { - $request = $this->createEmployeeAPIKeysRequest($wt_employee_api_key_create_params); + $request = $this->createEmployeeAPIKeysRequest($wt_employee_api_key_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createEmployeeAPIKeysWithHttpInfo($wt_employee_api_key_create_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EmployeeAPIKey' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createEmployeeAPIKeysWithHttpInfo($wt_employee_api_key_create_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createEmployeeAPIKeysWithHttpInfo($wt_employee_api_key_create_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createEmployeeAPIKeysWithHttpInfo($wt_employee_api_key_create_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createEmployeeAPIKeysWithHttpInfo($wt_employee_api_key_create_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createEmployeeAPIKeysWithHttpInfo($wt_employee_api_key_create_pa * Create employee API Key * * @param \OpenAPI\Client\Model\WTEmployeeAPIKeyCreateParams $wt_employee_api_key_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeAPIKeysAsync($wt_employee_api_key_create_params) + public function createEmployeeAPIKeysAsync($wt_employee_api_key_create_params, string $contentType = self::contentTypes['createEmployeeAPIKeys'][0]) { - return $this->createEmployeeAPIKeysAsyncWithHttpInfo($wt_employee_api_key_create_params) + return $this->createEmployeeAPIKeysAsyncWithHttpInfo($wt_employee_api_key_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create employee API Key * * @param \OpenAPI\Client\Model\WTEmployeeAPIKeyCreateParams $wt_employee_api_key_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeAPIKeysAsyncWithHttpInfo($wt_employee_api_key_create_params) + public function createEmployeeAPIKeysAsyncWithHttpInfo($wt_employee_api_key_create_params, string $contentType = self::contentTypes['createEmployeeAPIKeys'][0]) { $returnType = '\OpenAPI\Client\Model\EmployeeAPIKey'; - $request = $this->createEmployeeAPIKeysRequest($wt_employee_api_key_create_params); + $request = $this->createEmployeeAPIKeysRequest($wt_employee_api_key_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createEmployeeAPIKeys' * * @param \OpenAPI\Client\Model\WTEmployeeAPIKeyCreateParams $wt_employee_api_key_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createEmployeeAPIKeysRequest($wt_employee_api_key_create_params) + public function createEmployeeAPIKeysRequest($wt_employee_api_key_create_params, string $contentType = self::contentTypes['createEmployeeAPIKeys'][0]) { + // verify the required parameter 'wt_employee_api_key_create_params' is set if ($wt_employee_api_key_create_params === null || (is_array($wt_employee_api_key_create_params) && count($wt_employee_api_key_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createEmployeeAPIKeysRequest($wt_employee_api_key_create_params) ); } + $resourcePath = '/v2/employee/apiKeys'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createEmployeeAPIKeysRequest($wt_employee_api_key_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_api_key_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_api_key_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_api_key_create_params)); } else { $httpBody = $wt_employee_api_key_create_params; } @@ -746,12 +927,12 @@ public function createEmployeeAPIKeysRequest($wt_employee_api_key_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createEmployeeAPIKeysRequest($wt_employee_api_key_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createEmployeeAPIKeysRequest($wt_employee_api_key_create_params) * Fetch all employee API Keys * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllEmployeeAPIKeys'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmployeeAPIKey[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllEmployeeAPIKeys($is_archive_included = null) + public function fetchAllEmployeeAPIKeys($is_archive_included = null, string $contentType = self::contentTypes['fetchAllEmployeeAPIKeys'][0]) { - list($response) = $this->fetchAllEmployeeAPIKeysWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllEmployeeAPIKeysWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllEmployeeAPIKeys($is_archive_included = null) * Fetch all employee API Keys * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllEmployeeAPIKeys'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmployeeAPIKey[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllEmployeeAPIKeysWithHttpInfo($is_archive_included = null) + public function fetchAllEmployeeAPIKeysWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllEmployeeAPIKeys'][0]) { - $request = $this->fetchAllEmployeeAPIKeysRequest($is_archive_included); + $request = $this->fetchAllEmployeeAPIKeysRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllEmployeeAPIKeysWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EmployeeAPIKey[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllEmployeeAPIKeysWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllEmployeeAPIKeysWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllEmployeeAPIKeysWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllEmployeeAPIKeysWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllEmployeeAPIKeysWithHttpInfo($is_archive_included = null) * Fetch all employee API Keys * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllEmployeeAPIKeysAsync($is_archive_included = null) + public function fetchAllEmployeeAPIKeysAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllEmployeeAPIKeys'][0]) { - return $this->fetchAllEmployeeAPIKeysAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllEmployeeAPIKeysAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all employee API Keys * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllEmployeeAPIKeysAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllEmployeeAPIKeysAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllEmployeeAPIKeys'][0]) { $returnType = '\OpenAPI\Client\Model\EmployeeAPIKey[]'; - $request = $this->fetchAllEmployeeAPIKeysRequest($is_archive_included); + $request = $this->fetchAllEmployeeAPIKeysRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllEmployeeAPIKeys' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllEmployeeAPIKeysRequest($is_archive_included = null) + public function fetchAllEmployeeAPIKeysRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllEmployeeAPIKeys'][0]) { + + $resourcePath = '/v2/employee/apiKeys/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllEmployeeAPIKeysRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllEmployeeAPIKeysRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllEmployeeAPIKeysRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllEmployeeAPIKeysRequest($is_archive_included = null) * Fetch API Key * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeAPIKeyById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTEmployeeAPIKey|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchEmployeeAPIKeyById($id) + public function fetchEmployeeAPIKeyById($id, string $contentType = self::contentTypes['fetchEmployeeAPIKeyById'][0]) { - list($response) = $this->fetchEmployeeAPIKeyByIdWithHttpInfo($id); + list($response) = $this->fetchEmployeeAPIKeyByIdWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function fetchEmployeeAPIKeyById($id) * Fetch API Key * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeAPIKeyById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTEmployeeAPIKey|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchEmployeeAPIKeyByIdWithHttpInfo($id) + public function fetchEmployeeAPIKeyByIdWithHttpInfo($id, string $contentType = self::contentTypes['fetchEmployeeAPIKeyById'][0]) { - $request = $this->fetchEmployeeAPIKeyByIdRequest($id); + $request = $this->fetchEmployeeAPIKeyByIdRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function fetchEmployeeAPIKeyByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTEmployeeAPIKey' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function fetchEmployeeAPIKeyByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function fetchEmployeeAPIKeyByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function fetchEmployeeAPIKeyByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function fetchEmployeeAPIKeyByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function fetchEmployeeAPIKeyByIdWithHttpInfo($id) * Fetch API Key * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeAPIKeyById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchEmployeeAPIKeyByIdAsync($id) + public function fetchEmployeeAPIKeyByIdAsync($id, string $contentType = self::contentTypes['fetchEmployeeAPIKeyById'][0]) { - return $this->fetchEmployeeAPIKeyByIdAsyncWithHttpInfo($id) + return $this->fetchEmployeeAPIKeyByIdAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Fetch API Key * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeAPIKeyById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchEmployeeAPIKeyByIdAsyncWithHttpInfo($id) + public function fetchEmployeeAPIKeyByIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchEmployeeAPIKeyById'][0]) { $returnType = '\OpenAPI\Client\Model\WTEmployeeAPIKey'; - $request = $this->fetchEmployeeAPIKeyByIdRequest($id); + $request = $this->fetchEmployeeAPIKeyByIdRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'fetchEmployeeAPIKeyById' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeAPIKeyById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchEmployeeAPIKeyByIdRequest($id) + public function fetchEmployeeAPIKeyByIdRequest($id, string $contentType = self::contentTypes['fetchEmployeeAPIKeyById'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function fetchEmployeeAPIKeyByIdRequest($id) ); } + $resourcePath = '/v2/employee/apiKeys/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function fetchEmployeeAPIKeyByIdRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function fetchEmployeeAPIKeyByIdRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function fetchEmployeeAPIKeyByIdRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function fetchEmployeeAPIKeyByIdRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTEmployeeAPIKeyUpdateParams $wt_employee_api_key_update_params wt_employee_api_key_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeAPIKeys'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmployeeAPIKey|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateEmployeeAPIKeys($id, $wt_employee_api_key_update_params) + public function updateEmployeeAPIKeys($id, $wt_employee_api_key_update_params, string $contentType = self::contentTypes['updateEmployeeAPIKeys'][0]) { - list($response) = $this->updateEmployeeAPIKeysWithHttpInfo($id, $wt_employee_api_key_update_params); + list($response) = $this->updateEmployeeAPIKeysWithHttpInfo($id, $wt_employee_api_key_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateEmployeeAPIKeys($id, $wt_employee_api_key_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTEmployeeAPIKeyUpdateParams $wt_employee_api_key_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeAPIKeys'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmployeeAPIKey|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeAPIKeysWithHttpInfo($id, $wt_employee_api_key_update_params) + public function updateEmployeeAPIKeysWithHttpInfo($id, $wt_employee_api_key_update_params, string $contentType = self::contentTypes['updateEmployeeAPIKeys'][0]) { - $request = $this->updateEmployeeAPIKeysRequest($id, $wt_employee_api_key_update_params); + $request = $this->updateEmployeeAPIKeysRequest($id, $wt_employee_api_key_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateEmployeeAPIKeysWithHttpInfo($id, $wt_employee_api_key_upda $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EmployeeAPIKey' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateEmployeeAPIKeysWithHttpInfo($id, $wt_employee_api_key_upda $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateEmployeeAPIKeysWithHttpInfo($id, $wt_employee_api_key_upda $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateEmployeeAPIKeysWithHttpInfo($id, $wt_employee_api_key_upda $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateEmployeeAPIKeysWithHttpInfo($id, $wt_employee_api_key_upda $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateEmployeeAPIKeysWithHttpInfo($id, $wt_employee_api_key_upda * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTEmployeeAPIKeyUpdateParams $wt_employee_api_key_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeAPIKeysAsync($id, $wt_employee_api_key_update_params) + public function updateEmployeeAPIKeysAsync($id, $wt_employee_api_key_update_params, string $contentType = self::contentTypes['updateEmployeeAPIKeys'][0]) { - return $this->updateEmployeeAPIKeysAsyncWithHttpInfo($id, $wt_employee_api_key_update_params) + return $this->updateEmployeeAPIKeysAsyncWithHttpInfo($id, $wt_employee_api_key_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTEmployeeAPIKeyUpdateParams $wt_employee_api_key_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeAPIKeysAsyncWithHttpInfo($id, $wt_employee_api_key_update_params) + public function updateEmployeeAPIKeysAsyncWithHttpInfo($id, $wt_employee_api_key_update_params, string $contentType = self::contentTypes['updateEmployeeAPIKeys'][0]) { $returnType = '\OpenAPI\Client\Model\EmployeeAPIKey'; - $request = $this->updateEmployeeAPIKeysRequest($id, $wt_employee_api_key_update_params); + $request = $this->updateEmployeeAPIKeysRequest($id, $wt_employee_api_key_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTEmployeeAPIKeyUpdateParams $wt_employee_api_key_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeeAPIKeys'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateEmployeeAPIKeysRequest($id, $wt_employee_api_key_update_params) + public function updateEmployeeAPIKeysRequest($id, $wt_employee_api_key_update_params, string $contentType = self::contentTypes['updateEmployeeAPIKeys'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateEmployeeAPIKeys' ); } + // verify the required parameter 'wt_employee_api_key_update_params' is set if ($wt_employee_api_key_update_params === null || (is_array($wt_employee_api_key_update_params) && count($wt_employee_api_key_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateEmployeeAPIKeysRequest($id, $wt_employee_api_key_update_pa ); } + $resourcePath = '/v2/employee/apiKeys/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateEmployeeAPIKeysRequest($id, $wt_employee_api_key_update_pa } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_api_key_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_api_key_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_api_key_update_params)); } else { $httpBody = $wt_employee_api_key_update_params; } @@ -1753,12 +2177,12 @@ public function updateEmployeeAPIKeysRequest($id, $wt_employee_api_key_update_pa // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateEmployeeAPIKeysRequest($id, $wt_employee_api_key_update_pa $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/EmployeeAccessApi.php b/lib/Api/EmployeeAccessApi.php index 8663ea5..6630dd3 100644 --- a/lib/Api/EmployeeAccessApi.php +++ b/lib/Api/EmployeeAccessApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +129,15 @@ public function getConfig() * Register * * @param \OpenAPI\Client\Model\WTAuthenticationRegister $wt_authentication_register wt_authentication_register (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['register'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Employee|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function register($wt_authentication_register) + public function register($wt_authentication_register, string $contentType = self::contentTypes['register'][0]) { - list($response) = $this->registerWithHttpInfo($wt_authentication_register); + list($response) = $this->registerWithHttpInfo($wt_authentication_register, $contentType); return $response; } @@ -139,14 +147,15 @@ public function register($wt_authentication_register) * Register * * @param \OpenAPI\Client\Model\WTAuthenticationRegister $wt_authentication_register (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['register'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Employee|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function registerWithHttpInfo($wt_authentication_register) + public function registerWithHttpInfo($wt_authentication_register, string $contentType = self::contentTypes['register'][0]) { - $request = $this->registerRequest($wt_authentication_register); + $request = $this->registerRequest($wt_authentication_register, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +198,21 @@ public function registerWithHttpInfo($wt_authentication_register) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Employee' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +225,21 @@ public function registerWithHttpInfo($wt_authentication_register) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +252,21 @@ public function registerWithHttpInfo($wt_authentication_register) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +279,21 @@ public function registerWithHttpInfo($wt_authentication_register) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +308,21 @@ public function registerWithHttpInfo($wt_authentication_register) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +376,14 @@ public function registerWithHttpInfo($wt_authentication_register) * Register * * @param \OpenAPI\Client\Model\WTAuthenticationRegister $wt_authentication_register (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['register'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function registerAsync($wt_authentication_register) + public function registerAsync($wt_authentication_register, string $contentType = self::contentTypes['register'][0]) { - return $this->registerAsyncWithHttpInfo($wt_authentication_register) + return $this->registerAsyncWithHttpInfo($wt_authentication_register, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +397,15 @@ function ($response) { * Register * * @param \OpenAPI\Client\Model\WTAuthenticationRegister $wt_authentication_register (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['register'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function registerAsyncWithHttpInfo($wt_authentication_register) + public function registerAsyncWithHttpInfo($wt_authentication_register, string $contentType = self::contentTypes['register'][0]) { $returnType = '\OpenAPI\Client\Model\Employee'; - $request = $this->registerRequest($wt_authentication_register); + $request = $this->registerRequest($wt_authentication_register, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +415,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +447,14 @@ function ($exception) { * Create request for operation 'register' * * @param \OpenAPI\Client\Model\WTAuthenticationRegister $wt_authentication_register (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['register'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function registerRequest($wt_authentication_register) + public function registerRequest($wt_authentication_register, string $contentType = self::contentTypes['register'][0]) { + // verify the required parameter 'wt_authentication_register' is set if ($wt_authentication_register === null || (is_array($wt_authentication_register) && count($wt_authentication_register) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +462,7 @@ public function registerRequest($wt_authentication_register) ); } + $resourcePath = '/authentication/register'; $formParams = []; $queryParams = []; @@ -382,21 +474,17 @@ public function registerRequest($wt_authentication_register) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_authentication_register)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_authentication_register)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_authentication_register)); } else { $httpBody = $wt_authentication_register; } @@ -415,12 +503,12 @@ public function registerRequest($wt_authentication_register) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -436,10 +524,11 @@ public function registerRequest($wt_authentication_register) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/EmployeesApi.php b/lib/Api/EmployeesApi.php index 9fd418e..b1e5825 100644 --- a/lib/Api/EmployeesApi.php +++ b/lib/Api/EmployeesApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createDocument' => [ + 'application/json', + ], + 'createEmployeePeer' => [ + 'application/json', + ], + 'createFile' => [ + 'application/json', + ], + 'createMediaFile' => [ + 'application/json', + ], + 'createStaticVoucherCampaignsGroup' => [ + 'application/json', + ], + 'deleteDocument' => [ + 'application/json', + ], + 'deleteMediaFile' => [ + 'application/json', + ], + 'downloadFile' => [ + 'application/json', + ], + 'exportClubMembers' => [ + 'application/json', + ], + 'exportMerchantCredits' => [ + 'application/json', + ], + 'exportStaticVoucherCampaign' => [ + 'application/json', + ], + 'failedImport' => [ + 'application/json', + ], + 'fetchDocuments' => [ + 'application/json', + ], + 'fetchDynamicVouchers' => [ + 'application/json', + ], + 'fetchEmployeeStaticVoucherCampaignGroups' => [ + 'application/json', + ], + 'fetchEmployeeStaticVoucherCampaigns' => [ + 'application/json', + ], + 'fetchMediaFiles' => [ + 'application/json', + ], + 'fetchMerchant' => [ + 'application/json', + ], + 'fetchMessages' => [ + 'application/json', + ], + 'fetchOptInListSource' => [ + 'application/json', + ], + 'fetchOptInListSourcesCreatedByEmployee' => [ + 'application/json', + ], + 'fetchPeerActivity' => [ + 'application/json', + ], + 'fetchPeersPermissions' => [ + 'application/json', + ], + 'fetchProfileInfo' => [ + 'application/json', + ], + 'importClubMembers' => [ + 'application/json', + ], + 'importMerchantCredits' => [ + 'application/json', + ], + 'loadWebpagesOfEmployee' => [ + 'application/json', + ], + 'modifyPeersRoles' => [ + 'application/json', + ], + 'presignFile' => [ + 'application/json', + ], + 'removePeerFromAllRoles' => [ + 'application/json', + ], + 'scheduleAdvertisementCredit' => [ + 'application/json', + ], + 'scheduleDynamicVoucher' => [ + 'application/json', + ], + 'scheduleDynamicVoucherToRecipient' => [ + 'application/json', + ], + 'scheduleSimpleSMS' => [ + 'application/json', + ], + 'scheduleSimpleSMSToRecipient' => [ + 'application/json', + ], + 'sendHelpDeskResponse' => [ + 'application/json', + ], + 'sendSmsCampaignBroadcast' => [ + 'application/json', + ], + 'setAlertsRead' => [ + 'application/json', + ], + 'setExportDataFilesRead' => [ + 'application/json', + ], + 'setHelpDeskRequestResolved' => [ + 'application/json', + ], + 'setMessagesRead' => [ + 'application/json', + ], + 'setProfilePicture' => [ + 'application/json', + ], + 'updateClubMembers' => [ + 'application/json', + ], + 'updateEmailNotificationPreference' => [ + 'application/json', + ], + 'updateEmployeePeer' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -123,14 +265,15 @@ public function getConfig() * * @param mixed $user_id user_id (required) * @param \OpenAPI\Client\Model\WTEmployeePeerRoles $wt_employee_peer_roles wt_employee_peer_roles (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPeerToRoles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function addPeerToRoles($user_id, $wt_employee_peer_roles) + public function addPeerToRoles($user_id, $wt_employee_peer_roles, string $contentType = self::contentTypes['addPeerToRoles'][0]) { - list($response) = $this->addPeerToRolesWithHttpInfo($user_id, $wt_employee_peer_roles); + list($response) = $this->addPeerToRolesWithHttpInfo($user_id, $wt_employee_peer_roles, $contentType); return $response; } @@ -141,14 +284,15 @@ public function addPeerToRoles($user_id, $wt_employee_peer_roles) * * @param mixed $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeePeerRoles $wt_employee_peer_roles (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPeerToRoles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function addPeerToRolesWithHttpInfo($user_id, $wt_employee_peer_roles) + public function addPeerToRolesWithHttpInfo($user_id, $wt_employee_peer_roles, string $contentType = self::contentTypes['addPeerToRoles'][0]) { - $request = $this->addPeerToRolesRequest($user_id, $wt_employee_peer_roles); + $request = $this->addPeerToRolesRequest($user_id, $wt_employee_peer_roles, $contentType); try { $options = $this->createHttpClientOption(); @@ -191,6 +335,21 @@ public function addPeerToRolesWithHttpInfo($user_id, $wt_employee_peer_roles) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -203,6 +362,21 @@ public function addPeerToRolesWithHttpInfo($user_id, $wt_employee_peer_roles) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -215,6 +389,21 @@ public function addPeerToRolesWithHttpInfo($user_id, $wt_employee_peer_roles) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -227,6 +416,21 @@ public function addPeerToRolesWithHttpInfo($user_id, $wt_employee_peer_roles) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -241,6 +445,21 @@ public function addPeerToRolesWithHttpInfo($user_id, $wt_employee_peer_roles) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -295,13 +514,14 @@ public function addPeerToRolesWithHttpInfo($user_id, $wt_employee_peer_roles) * * @param mixed $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeePeerRoles $wt_employee_peer_roles (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPeerToRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addPeerToRolesAsync($user_id, $wt_employee_peer_roles) + public function addPeerToRolesAsync($user_id, $wt_employee_peer_roles, string $contentType = self::contentTypes['addPeerToRoles'][0]) { - return $this->addPeerToRolesAsyncWithHttpInfo($user_id, $wt_employee_peer_roles) + return $this->addPeerToRolesAsyncWithHttpInfo($user_id, $wt_employee_peer_roles, $contentType) ->then( function ($response) { return $response[0]; @@ -316,14 +536,15 @@ function ($response) { * * @param mixed $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeePeerRoles $wt_employee_peer_roles (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPeerToRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function addPeerToRolesAsyncWithHttpInfo($user_id, $wt_employee_peer_roles) + public function addPeerToRolesAsyncWithHttpInfo($user_id, $wt_employee_peer_roles, string $contentType = self::contentTypes['addPeerToRoles'][0]) { $returnType = 'string'; - $request = $this->addPeerToRolesRequest($user_id, $wt_employee_peer_roles); + $request = $this->addPeerToRolesRequest($user_id, $wt_employee_peer_roles, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -333,6 +554,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -363,18 +587,21 @@ function ($exception) { * * @param mixed $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeePeerRoles $wt_employee_peer_roles (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addPeerToRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function addPeerToRolesRequest($user_id, $wt_employee_peer_roles) + public function addPeerToRolesRequest($user_id, $wt_employee_peer_roles, string $contentType = self::contentTypes['addPeerToRoles'][0]) { + // verify the required parameter 'user_id' is set if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $user_id when calling addPeerToRoles' ); } + // verify the required parameter 'wt_employee_peer_roles' is set if ($wt_employee_peer_roles === null || (is_array($wt_employee_peer_roles) && count($wt_employee_peer_roles) === 0)) { throw new \InvalidArgumentException( @@ -382,6 +609,7 @@ public function addPeerToRolesRequest($user_id, $wt_employee_peer_roles) ); } + $resourcePath = '/v2/employee/roles/peer/{userID}'; $formParams = []; $queryParams = []; @@ -401,21 +629,17 @@ public function addPeerToRolesRequest($user_id, $wt_employee_peer_roles) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_peer_roles)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_peer_roles)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_peer_roles)); } else { $httpBody = $wt_employee_peer_roles; } @@ -434,12 +658,12 @@ public function addPeerToRolesRequest($user_id, $wt_employee_peer_roles) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -455,10 +679,11 @@ public function addPeerToRolesRequest($user_id, $wt_employee_peer_roles) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -470,14 +695,15 @@ public function addPeerToRolesRequest($user_id, $wt_employee_peer_roles) * Create document * * @param \OpenAPI\Client\Model\WTEmployeeCreateDocument $wt_employee_create_document wt_employee_create_document (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocument'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Document|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createDocument($wt_employee_create_document) + public function createDocument($wt_employee_create_document, string $contentType = self::contentTypes['createDocument'][0]) { - list($response) = $this->createDocumentWithHttpInfo($wt_employee_create_document); + list($response) = $this->createDocumentWithHttpInfo($wt_employee_create_document, $contentType); return $response; } @@ -487,14 +713,15 @@ public function createDocument($wt_employee_create_document) * Create document * * @param \OpenAPI\Client\Model\WTEmployeeCreateDocument $wt_employee_create_document (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocument'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Document|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createDocumentWithHttpInfo($wt_employee_create_document) + public function createDocumentWithHttpInfo($wt_employee_create_document, string $contentType = self::contentTypes['createDocument'][0]) { - $request = $this->createDocumentRequest($wt_employee_create_document); + $request = $this->createDocumentRequest($wt_employee_create_document, $contentType); try { $options = $this->createHttpClientOption(); @@ -537,6 +764,21 @@ public function createDocumentWithHttpInfo($wt_employee_create_document) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Document' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -549,6 +791,21 @@ public function createDocumentWithHttpInfo($wt_employee_create_document) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -561,6 +818,21 @@ public function createDocumentWithHttpInfo($wt_employee_create_document) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -573,6 +845,21 @@ public function createDocumentWithHttpInfo($wt_employee_create_document) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -587,6 +874,21 @@ public function createDocumentWithHttpInfo($wt_employee_create_document) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -640,13 +942,14 @@ public function createDocumentWithHttpInfo($wt_employee_create_document) * Create document * * @param \OpenAPI\Client\Model\WTEmployeeCreateDocument $wt_employee_create_document (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createDocumentAsync($wt_employee_create_document) + public function createDocumentAsync($wt_employee_create_document, string $contentType = self::contentTypes['createDocument'][0]) { - return $this->createDocumentAsyncWithHttpInfo($wt_employee_create_document) + return $this->createDocumentAsyncWithHttpInfo($wt_employee_create_document, $contentType) ->then( function ($response) { return $response[0]; @@ -660,14 +963,15 @@ function ($response) { * Create document * * @param \OpenAPI\Client\Model\WTEmployeeCreateDocument $wt_employee_create_document (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createDocumentAsyncWithHttpInfo($wt_employee_create_document) + public function createDocumentAsyncWithHttpInfo($wt_employee_create_document, string $contentType = self::contentTypes['createDocument'][0]) { $returnType = '\OpenAPI\Client\Model\Document'; - $request = $this->createDocumentRequest($wt_employee_create_document); + $request = $this->createDocumentRequest($wt_employee_create_document, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -677,6 +981,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -706,12 +1013,14 @@ function ($exception) { * Create request for operation 'createDocument' * * @param \OpenAPI\Client\Model\WTEmployeeCreateDocument $wt_employee_create_document (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createDocumentRequest($wt_employee_create_document) + public function createDocumentRequest($wt_employee_create_document, string $contentType = self::contentTypes['createDocument'][0]) { + // verify the required parameter 'wt_employee_create_document' is set if ($wt_employee_create_document === null || (is_array($wt_employee_create_document) && count($wt_employee_create_document) === 0)) { throw new \InvalidArgumentException( @@ -719,6 +1028,7 @@ public function createDocumentRequest($wt_employee_create_document) ); } + $resourcePath = '/v2/employee/document'; $formParams = []; $queryParams = []; @@ -730,21 +1040,17 @@ public function createDocumentRequest($wt_employee_create_document) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_create_document)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_create_document)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_create_document)); } else { $httpBody = $wt_employee_create_document; } @@ -763,12 +1069,12 @@ public function createDocumentRequest($wt_employee_create_document) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -784,10 +1090,11 @@ public function createDocumentRequest($wt_employee_create_document) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -799,14 +1106,15 @@ public function createDocumentRequest($wt_employee_create_document) * Create employee peer * * @param \OpenAPI\Client\Model\WTEmployeeCreate $wt_employee_create wt_employee_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeePeer'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Employee|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createEmployeePeer($wt_employee_create) + public function createEmployeePeer($wt_employee_create, string $contentType = self::contentTypes['createEmployeePeer'][0]) { - list($response) = $this->createEmployeePeerWithHttpInfo($wt_employee_create); + list($response) = $this->createEmployeePeerWithHttpInfo($wt_employee_create, $contentType); return $response; } @@ -816,14 +1124,15 @@ public function createEmployeePeer($wt_employee_create) * Create employee peer * * @param \OpenAPI\Client\Model\WTEmployeeCreate $wt_employee_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeePeer'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Employee|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeePeerWithHttpInfo($wt_employee_create) + public function createEmployeePeerWithHttpInfo($wt_employee_create, string $contentType = self::contentTypes['createEmployeePeer'][0]) { - $request = $this->createEmployeePeerRequest($wt_employee_create); + $request = $this->createEmployeePeerRequest($wt_employee_create, $contentType); try { $options = $this->createHttpClientOption(); @@ -866,6 +1175,21 @@ public function createEmployeePeerWithHttpInfo($wt_employee_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Employee' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -878,6 +1202,21 @@ public function createEmployeePeerWithHttpInfo($wt_employee_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -890,6 +1229,21 @@ public function createEmployeePeerWithHttpInfo($wt_employee_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -902,6 +1256,21 @@ public function createEmployeePeerWithHttpInfo($wt_employee_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -916,6 +1285,21 @@ public function createEmployeePeerWithHttpInfo($wt_employee_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -969,13 +1353,14 @@ public function createEmployeePeerWithHttpInfo($wt_employee_create) * Create employee peer * * @param \OpenAPI\Client\Model\WTEmployeeCreate $wt_employee_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeePeer'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeePeerAsync($wt_employee_create) + public function createEmployeePeerAsync($wt_employee_create, string $contentType = self::contentTypes['createEmployeePeer'][0]) { - return $this->createEmployeePeerAsyncWithHttpInfo($wt_employee_create) + return $this->createEmployeePeerAsyncWithHttpInfo($wt_employee_create, $contentType) ->then( function ($response) { return $response[0]; @@ -989,14 +1374,15 @@ function ($response) { * Create employee peer * * @param \OpenAPI\Client\Model\WTEmployeeCreate $wt_employee_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeePeer'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeePeerAsyncWithHttpInfo($wt_employee_create) + public function createEmployeePeerAsyncWithHttpInfo($wt_employee_create, string $contentType = self::contentTypes['createEmployeePeer'][0]) { $returnType = '\OpenAPI\Client\Model\Employee'; - $request = $this->createEmployeePeerRequest($wt_employee_create); + $request = $this->createEmployeePeerRequest($wt_employee_create, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1006,6 +1392,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1035,12 +1424,14 @@ function ($exception) { * Create request for operation 'createEmployeePeer' * * @param \OpenAPI\Client\Model\WTEmployeeCreate $wt_employee_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeePeer'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createEmployeePeerRequest($wt_employee_create) + public function createEmployeePeerRequest($wt_employee_create, string $contentType = self::contentTypes['createEmployeePeer'][0]) { + // verify the required parameter 'wt_employee_create' is set if ($wt_employee_create === null || (is_array($wt_employee_create) && count($wt_employee_create) === 0)) { throw new \InvalidArgumentException( @@ -1048,6 +1439,7 @@ public function createEmployeePeerRequest($wt_employee_create) ); } + $resourcePath = '/v2/employee/peer'; $formParams = []; $queryParams = []; @@ -1059,21 +1451,17 @@ public function createEmployeePeerRequest($wt_employee_create) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_create)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_create)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_create)); } else { $httpBody = $wt_employee_create; } @@ -1092,12 +1480,12 @@ public function createEmployeePeerRequest($wt_employee_create) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1113,10 +1501,11 @@ public function createEmployeePeerRequest($wt_employee_create) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1128,14 +1517,15 @@ public function createEmployeePeerRequest($wt_employee_create) * Create file * * @param \OpenAPI\Client\Model\WTEmployeeFileCreate $wt_employee_file_create wt_employee_file_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2001|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\CreateFile200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createFile($wt_employee_file_create) + public function createFile($wt_employee_file_create, string $contentType = self::contentTypes['createFile'][0]) { - list($response) = $this->createFileWithHttpInfo($wt_employee_file_create); + list($response) = $this->createFileWithHttpInfo($wt_employee_file_create, $contentType); return $response; } @@ -1145,14 +1535,15 @@ public function createFile($wt_employee_file_create) * Create file * * @param \OpenAPI\Client\Model\WTEmployeeFileCreate $wt_employee_file_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2001|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\CreateFile200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createFileWithHttpInfo($wt_employee_file_create) + public function createFileWithHttpInfo($wt_employee_file_create, string $contentType = self::contentTypes['createFile'][0]) { - $request = $this->createFileRequest($wt_employee_file_create); + $request = $this->createFileRequest($wt_employee_file_create, $contentType); try { $options = $this->createHttpClientOption(); @@ -1191,14 +1582,29 @@ public function createFileWithHttpInfo($wt_employee_file_create) switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2001' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\CreateFile200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CreateFile200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2001', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CreateFile200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1207,6 +1613,21 @@ public function createFileWithHttpInfo($wt_employee_file_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1219,6 +1640,21 @@ public function createFileWithHttpInfo($wt_employee_file_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1231,6 +1667,21 @@ public function createFileWithHttpInfo($wt_employee_file_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1240,11 +1691,26 @@ public function createFileWithHttpInfo($wt_employee_file_create) ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2001'; + $returnType = '\OpenAPI\Client\Model\CreateFile200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1258,7 +1724,7 @@ public function createFileWithHttpInfo($wt_employee_file_create) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2001', + '\OpenAPI\Client\Model\CreateFile200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1298,13 +1764,14 @@ public function createFileWithHttpInfo($wt_employee_file_create) * Create file * * @param \OpenAPI\Client\Model\WTEmployeeFileCreate $wt_employee_file_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createFileAsync($wt_employee_file_create) + public function createFileAsync($wt_employee_file_create, string $contentType = self::contentTypes['createFile'][0]) { - return $this->createFileAsyncWithHttpInfo($wt_employee_file_create) + return $this->createFileAsyncWithHttpInfo($wt_employee_file_create, $contentType) ->then( function ($response) { return $response[0]; @@ -1318,14 +1785,15 @@ function ($response) { * Create file * * @param \OpenAPI\Client\Model\WTEmployeeFileCreate $wt_employee_file_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createFileAsyncWithHttpInfo($wt_employee_file_create) + public function createFileAsyncWithHttpInfo($wt_employee_file_create, string $contentType = self::contentTypes['createFile'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2001'; - $request = $this->createFileRequest($wt_employee_file_create); + $returnType = '\OpenAPI\Client\Model\CreateFile200Response'; + $request = $this->createFileRequest($wt_employee_file_create, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1335,6 +1803,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1364,12 +1835,14 @@ function ($exception) { * Create request for operation 'createFile' * * @param \OpenAPI\Client\Model\WTEmployeeFileCreate $wt_employee_file_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createFileRequest($wt_employee_file_create) + public function createFileRequest($wt_employee_file_create, string $contentType = self::contentTypes['createFile'][0]) { + // verify the required parameter 'wt_employee_file_create' is set if ($wt_employee_file_create === null || (is_array($wt_employee_file_create) && count($wt_employee_file_create) === 0)) { throw new \InvalidArgumentException( @@ -1377,6 +1850,7 @@ public function createFileRequest($wt_employee_file_create) ); } + $resourcePath = '/v2/employee/file/create'; $formParams = []; $queryParams = []; @@ -1388,21 +1862,17 @@ public function createFileRequest($wt_employee_file_create) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_file_create)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_file_create)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_file_create)); } else { $httpBody = $wt_employee_file_create; } @@ -1421,12 +1891,12 @@ public function createFileRequest($wt_employee_file_create) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1442,10 +1912,11 @@ public function createFileRequest($wt_employee_file_create) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1457,14 +1928,15 @@ public function createFileRequest($wt_employee_file_create) * Create media file * * @param \OpenAPI\Client\Model\WTEmployeeCreateMediaFile $wt_employee_create_media_file wt_employee_create_media_file (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMediaFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MediaFile|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createMediaFile($wt_employee_create_media_file) + public function createMediaFile($wt_employee_create_media_file, string $contentType = self::contentTypes['createMediaFile'][0]) { - list($response) = $this->createMediaFileWithHttpInfo($wt_employee_create_media_file); + list($response) = $this->createMediaFileWithHttpInfo($wt_employee_create_media_file, $contentType); return $response; } @@ -1474,14 +1946,15 @@ public function createMediaFile($wt_employee_create_media_file) * Create media file * * @param \OpenAPI\Client\Model\WTEmployeeCreateMediaFile $wt_employee_create_media_file (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMediaFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MediaFile|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createMediaFileWithHttpInfo($wt_employee_create_media_file) + public function createMediaFileWithHttpInfo($wt_employee_create_media_file, string $contentType = self::contentTypes['createMediaFile'][0]) { - $request = $this->createMediaFileRequest($wt_employee_create_media_file); + $request = $this->createMediaFileRequest($wt_employee_create_media_file, $contentType); try { $options = $this->createHttpClientOption(); @@ -1524,6 +1997,21 @@ public function createMediaFileWithHttpInfo($wt_employee_create_media_file) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MediaFile' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1536,6 +2024,21 @@ public function createMediaFileWithHttpInfo($wt_employee_create_media_file) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1548,6 +2051,21 @@ public function createMediaFileWithHttpInfo($wt_employee_create_media_file) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +2078,21 @@ public function createMediaFileWithHttpInfo($wt_employee_create_media_file) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1574,6 +2107,21 @@ public function createMediaFileWithHttpInfo($wt_employee_create_media_file) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1627,13 +2175,14 @@ public function createMediaFileWithHttpInfo($wt_employee_create_media_file) * Create media file * * @param \OpenAPI\Client\Model\WTEmployeeCreateMediaFile $wt_employee_create_media_file (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMediaFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createMediaFileAsync($wt_employee_create_media_file) + public function createMediaFileAsync($wt_employee_create_media_file, string $contentType = self::contentTypes['createMediaFile'][0]) { - return $this->createMediaFileAsyncWithHttpInfo($wt_employee_create_media_file) + return $this->createMediaFileAsyncWithHttpInfo($wt_employee_create_media_file, $contentType) ->then( function ($response) { return $response[0]; @@ -1647,14 +2196,15 @@ function ($response) { * Create media file * * @param \OpenAPI\Client\Model\WTEmployeeCreateMediaFile $wt_employee_create_media_file (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMediaFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createMediaFileAsyncWithHttpInfo($wt_employee_create_media_file) + public function createMediaFileAsyncWithHttpInfo($wt_employee_create_media_file, string $contentType = self::contentTypes['createMediaFile'][0]) { $returnType = '\OpenAPI\Client\Model\MediaFile'; - $request = $this->createMediaFileRequest($wt_employee_create_media_file); + $request = $this->createMediaFileRequest($wt_employee_create_media_file, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1664,6 +2214,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1693,12 +2246,14 @@ function ($exception) { * Create request for operation 'createMediaFile' * * @param \OpenAPI\Client\Model\WTEmployeeCreateMediaFile $wt_employee_create_media_file (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMediaFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createMediaFileRequest($wt_employee_create_media_file) + public function createMediaFileRequest($wt_employee_create_media_file, string $contentType = self::contentTypes['createMediaFile'][0]) { + // verify the required parameter 'wt_employee_create_media_file' is set if ($wt_employee_create_media_file === null || (is_array($wt_employee_create_media_file) && count($wt_employee_create_media_file) === 0)) { throw new \InvalidArgumentException( @@ -1706,6 +2261,7 @@ public function createMediaFileRequest($wt_employee_create_media_file) ); } + $resourcePath = '/v2/employee/mediaFile'; $formParams = []; $queryParams = []; @@ -1717,21 +2273,17 @@ public function createMediaFileRequest($wt_employee_create_media_file) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_create_media_file)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_create_media_file)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_create_media_file)); } else { $httpBody = $wt_employee_create_media_file; } @@ -1750,12 +2302,12 @@ public function createMediaFileRequest($wt_employee_create_media_file) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1771,10 +2323,11 @@ public function createMediaFileRequest($wt_employee_create_media_file) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1786,14 +2339,15 @@ public function createMediaFileRequest($wt_employee_create_media_file) * Create static voucher campaign group * * @param \OpenAPI\Client\Model\WTEmployeeCreateStaticVoucherCampaignGroup $wt_employee_create_static_voucher_campaign_group wt_employee_create_static_voucher_campaign_group (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignsGroup'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucherCampaignGroup|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createStaticVoucherCampaignsGroup($wt_employee_create_static_voucher_campaign_group) + public function createStaticVoucherCampaignsGroup($wt_employee_create_static_voucher_campaign_group, string $contentType = self::contentTypes['createStaticVoucherCampaignsGroup'][0]) { - list($response) = $this->createStaticVoucherCampaignsGroupWithHttpInfo($wt_employee_create_static_voucher_campaign_group); + list($response) = $this->createStaticVoucherCampaignsGroupWithHttpInfo($wt_employee_create_static_voucher_campaign_group, $contentType); return $response; } @@ -1803,14 +2357,15 @@ public function createStaticVoucherCampaignsGroup($wt_employee_create_static_vou * Create static voucher campaign group * * @param \OpenAPI\Client\Model\WTEmployeeCreateStaticVoucherCampaignGroup $wt_employee_create_static_voucher_campaign_group (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignsGroup'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucherCampaignGroup|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createStaticVoucherCampaignsGroupWithHttpInfo($wt_employee_create_static_voucher_campaign_group) + public function createStaticVoucherCampaignsGroupWithHttpInfo($wt_employee_create_static_voucher_campaign_group, string $contentType = self::contentTypes['createStaticVoucherCampaignsGroup'][0]) { - $request = $this->createStaticVoucherCampaignsGroupRequest($wt_employee_create_static_voucher_campaign_group); + $request = $this->createStaticVoucherCampaignsGroupRequest($wt_employee_create_static_voucher_campaign_group, $contentType); try { $options = $this->createHttpClientOption(); @@ -1853,6 +2408,21 @@ public function createStaticVoucherCampaignsGroupWithHttpInfo($wt_employee_creat $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucherCampaignGroup' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1865,6 +2435,21 @@ public function createStaticVoucherCampaignsGroupWithHttpInfo($wt_employee_creat $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1877,6 +2462,21 @@ public function createStaticVoucherCampaignsGroupWithHttpInfo($wt_employee_creat $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1889,6 +2489,21 @@ public function createStaticVoucherCampaignsGroupWithHttpInfo($wt_employee_creat $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1903,6 +2518,21 @@ public function createStaticVoucherCampaignsGroupWithHttpInfo($wt_employee_creat $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1956,13 +2586,14 @@ public function createStaticVoucherCampaignsGroupWithHttpInfo($wt_employee_creat * Create static voucher campaign group * * @param \OpenAPI\Client\Model\WTEmployeeCreateStaticVoucherCampaignGroup $wt_employee_create_static_voucher_campaign_group (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignsGroup'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStaticVoucherCampaignsGroupAsync($wt_employee_create_static_voucher_campaign_group) + public function createStaticVoucherCampaignsGroupAsync($wt_employee_create_static_voucher_campaign_group, string $contentType = self::contentTypes['createStaticVoucherCampaignsGroup'][0]) { - return $this->createStaticVoucherCampaignsGroupAsyncWithHttpInfo($wt_employee_create_static_voucher_campaign_group) + return $this->createStaticVoucherCampaignsGroupAsyncWithHttpInfo($wt_employee_create_static_voucher_campaign_group, $contentType) ->then( function ($response) { return $response[0]; @@ -1976,14 +2607,15 @@ function ($response) { * Create static voucher campaign group * * @param \OpenAPI\Client\Model\WTEmployeeCreateStaticVoucherCampaignGroup $wt_employee_create_static_voucher_campaign_group (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignsGroup'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStaticVoucherCampaignsGroupAsyncWithHttpInfo($wt_employee_create_static_voucher_campaign_group) + public function createStaticVoucherCampaignsGroupAsyncWithHttpInfo($wt_employee_create_static_voucher_campaign_group, string $contentType = self::contentTypes['createStaticVoucherCampaignsGroup'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucherCampaignGroup'; - $request = $this->createStaticVoucherCampaignsGroupRequest($wt_employee_create_static_voucher_campaign_group); + $request = $this->createStaticVoucherCampaignsGroupRequest($wt_employee_create_static_voucher_campaign_group, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1993,6 +2625,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2022,12 +2657,14 @@ function ($exception) { * Create request for operation 'createStaticVoucherCampaignsGroup' * * @param \OpenAPI\Client\Model\WTEmployeeCreateStaticVoucherCampaignGroup $wt_employee_create_static_voucher_campaign_group (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignsGroup'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createStaticVoucherCampaignsGroupRequest($wt_employee_create_static_voucher_campaign_group) + public function createStaticVoucherCampaignsGroupRequest($wt_employee_create_static_voucher_campaign_group, string $contentType = self::contentTypes['createStaticVoucherCampaignsGroup'][0]) { + // verify the required parameter 'wt_employee_create_static_voucher_campaign_group' is set if ($wt_employee_create_static_voucher_campaign_group === null || (is_array($wt_employee_create_static_voucher_campaign_group) && count($wt_employee_create_static_voucher_campaign_group) === 0)) { throw new \InvalidArgumentException( @@ -2035,6 +2672,7 @@ public function createStaticVoucherCampaignsGroupRequest($wt_employee_create_sta ); } + $resourcePath = '/v2/employee/staticVoucherCampaignsGroup'; $formParams = []; $queryParams = []; @@ -2046,21 +2684,17 @@ public function createStaticVoucherCampaignsGroupRequest($wt_employee_create_sta - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_create_static_voucher_campaign_group)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_create_static_voucher_campaign_group)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_create_static_voucher_campaign_group)); } else { $httpBody = $wt_employee_create_static_voucher_campaign_group; } @@ -2079,12 +2713,12 @@ public function createStaticVoucherCampaignsGroupRequest($wt_employee_create_sta // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2100,10 +2734,11 @@ public function createStaticVoucherCampaignsGroupRequest($wt_employee_create_sta $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2115,14 +2750,15 @@ public function createStaticVoucherCampaignsGroupRequest($wt_employee_create_sta * Delete document * * @param mixed $document_id document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocument'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Document|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function deleteDocument($document_id) + public function deleteDocument($document_id, string $contentType = self::contentTypes['deleteDocument'][0]) { - list($response) = $this->deleteDocumentWithHttpInfo($document_id); + list($response) = $this->deleteDocumentWithHttpInfo($document_id, $contentType); return $response; } @@ -2132,14 +2768,15 @@ public function deleteDocument($document_id) * Delete document * * @param mixed $document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocument'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Document|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function deleteDocumentWithHttpInfo($document_id) + public function deleteDocumentWithHttpInfo($document_id, string $contentType = self::contentTypes['deleteDocument'][0]) { - $request = $this->deleteDocumentRequest($document_id); + $request = $this->deleteDocumentRequest($document_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2182,6 +2819,21 @@ public function deleteDocumentWithHttpInfo($document_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Document' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2194,6 +2846,21 @@ public function deleteDocumentWithHttpInfo($document_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2206,6 +2873,21 @@ public function deleteDocumentWithHttpInfo($document_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2218,6 +2900,21 @@ public function deleteDocumentWithHttpInfo($document_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2232,6 +2929,21 @@ public function deleteDocumentWithHttpInfo($document_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2285,13 +2997,14 @@ public function deleteDocumentWithHttpInfo($document_id) * Delete document * * @param mixed $document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteDocumentAsync($document_id) + public function deleteDocumentAsync($document_id, string $contentType = self::contentTypes['deleteDocument'][0]) { - return $this->deleteDocumentAsyncWithHttpInfo($document_id) + return $this->deleteDocumentAsyncWithHttpInfo($document_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2305,14 +3018,15 @@ function ($response) { * Delete document * * @param mixed $document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteDocumentAsyncWithHttpInfo($document_id) + public function deleteDocumentAsyncWithHttpInfo($document_id, string $contentType = self::contentTypes['deleteDocument'][0]) { $returnType = '\OpenAPI\Client\Model\Document'; - $request = $this->deleteDocumentRequest($document_id); + $request = $this->deleteDocumentRequest($document_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2322,6 +3036,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2351,12 +3068,14 @@ function ($exception) { * Create request for operation 'deleteDocument' * * @param mixed $document_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteDocument'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteDocumentRequest($document_id) + public function deleteDocumentRequest($document_id, string $contentType = self::contentTypes['deleteDocument'][0]) { + // verify the required parameter 'document_id' is set if ($document_id === null || (is_array($document_id) && count($document_id) === 0)) { throw new \InvalidArgumentException( @@ -2364,6 +3083,7 @@ public function deleteDocumentRequest($document_id) ); } + $resourcePath = '/v2/employee/document/{documentID}'; $formParams = []; $queryParams = []; @@ -2383,16 +3103,11 @@ public function deleteDocumentRequest($document_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2410,12 +3125,12 @@ public function deleteDocumentRequest($document_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2431,10 +3146,11 @@ public function deleteDocumentRequest($document_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2446,14 +3162,15 @@ public function deleteDocumentRequest($document_id) * Delete media file * * @param mixed $media_file_id media_file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMediaFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MediaFile|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function deleteMediaFile($media_file_id) + public function deleteMediaFile($media_file_id, string $contentType = self::contentTypes['deleteMediaFile'][0]) { - list($response) = $this->deleteMediaFileWithHttpInfo($media_file_id); + list($response) = $this->deleteMediaFileWithHttpInfo($media_file_id, $contentType); return $response; } @@ -2463,14 +3180,15 @@ public function deleteMediaFile($media_file_id) * Delete media file * * @param mixed $media_file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMediaFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MediaFile|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function deleteMediaFileWithHttpInfo($media_file_id) + public function deleteMediaFileWithHttpInfo($media_file_id, string $contentType = self::contentTypes['deleteMediaFile'][0]) { - $request = $this->deleteMediaFileRequest($media_file_id); + $request = $this->deleteMediaFileRequest($media_file_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2513,6 +3231,21 @@ public function deleteMediaFileWithHttpInfo($media_file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MediaFile' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2525,6 +3258,21 @@ public function deleteMediaFileWithHttpInfo($media_file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2537,6 +3285,21 @@ public function deleteMediaFileWithHttpInfo($media_file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2549,6 +3312,21 @@ public function deleteMediaFileWithHttpInfo($media_file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2563,6 +3341,21 @@ public function deleteMediaFileWithHttpInfo($media_file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2616,13 +3409,14 @@ public function deleteMediaFileWithHttpInfo($media_file_id) * Delete media file * * @param mixed $media_file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMediaFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteMediaFileAsync($media_file_id) + public function deleteMediaFileAsync($media_file_id, string $contentType = self::contentTypes['deleteMediaFile'][0]) { - return $this->deleteMediaFileAsyncWithHttpInfo($media_file_id) + return $this->deleteMediaFileAsyncWithHttpInfo($media_file_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2636,14 +3430,15 @@ function ($response) { * Delete media file * * @param mixed $media_file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMediaFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteMediaFileAsyncWithHttpInfo($media_file_id) + public function deleteMediaFileAsyncWithHttpInfo($media_file_id, string $contentType = self::contentTypes['deleteMediaFile'][0]) { $returnType = '\OpenAPI\Client\Model\MediaFile'; - $request = $this->deleteMediaFileRequest($media_file_id); + $request = $this->deleteMediaFileRequest($media_file_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2653,6 +3448,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2682,12 +3480,14 @@ function ($exception) { * Create request for operation 'deleteMediaFile' * * @param mixed $media_file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteMediaFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteMediaFileRequest($media_file_id) + public function deleteMediaFileRequest($media_file_id, string $contentType = self::contentTypes['deleteMediaFile'][0]) { + // verify the required parameter 'media_file_id' is set if ($media_file_id === null || (is_array($media_file_id) && count($media_file_id) === 0)) { throw new \InvalidArgumentException( @@ -2695,6 +3495,7 @@ public function deleteMediaFileRequest($media_file_id) ); } + $resourcePath = '/v2/employee/mediaFile/{mediaFileID}'; $formParams = []; $queryParams = []; @@ -2714,16 +3515,11 @@ public function deleteMediaFileRequest($media_file_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2741,12 +3537,12 @@ public function deleteMediaFileRequest($media_file_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2762,10 +3558,11 @@ public function deleteMediaFileRequest($media_file_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2777,14 +3574,15 @@ public function deleteMediaFileRequest($media_file_id) * Fetch URL for file download * * @param string $file_id file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function downloadFile($file_id) + public function downloadFile($file_id, string $contentType = self::contentTypes['downloadFile'][0]) { - list($response) = $this->downloadFileWithHttpInfo($file_id); + list($response) = $this->downloadFileWithHttpInfo($file_id, $contentType); return $response; } @@ -2794,14 +3592,15 @@ public function downloadFile($file_id) * Fetch URL for file download * * @param string $file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function downloadFileWithHttpInfo($file_id) + public function downloadFileWithHttpInfo($file_id, string $contentType = self::contentTypes['downloadFile'][0]) { - $request = $this->downloadFileRequest($file_id); + $request = $this->downloadFileRequest($file_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2844,6 +3643,21 @@ public function downloadFileWithHttpInfo($file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2856,6 +3670,21 @@ public function downloadFileWithHttpInfo($file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2868,6 +3697,21 @@ public function downloadFileWithHttpInfo($file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2880,6 +3724,21 @@ public function downloadFileWithHttpInfo($file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2894,6 +3753,21 @@ public function downloadFileWithHttpInfo($file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2947,13 +3821,14 @@ public function downloadFileWithHttpInfo($file_id) * Fetch URL for file download * * @param string $file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadFileAsync($file_id) + public function downloadFileAsync($file_id, string $contentType = self::contentTypes['downloadFile'][0]) { - return $this->downloadFileAsyncWithHttpInfo($file_id) + return $this->downloadFileAsyncWithHttpInfo($file_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2967,14 +3842,15 @@ function ($response) { * Fetch URL for file download * * @param string $file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadFileAsyncWithHttpInfo($file_id) + public function downloadFileAsyncWithHttpInfo($file_id, string $contentType = self::contentTypes['downloadFile'][0]) { $returnType = 'string'; - $request = $this->downloadFileRequest($file_id); + $request = $this->downloadFileRequest($file_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2984,6 +3860,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3013,12 +3892,14 @@ function ($exception) { * Create request for operation 'downloadFile' * * @param string $file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function downloadFileRequest($file_id) + public function downloadFileRequest($file_id, string $contentType = self::contentTypes['downloadFile'][0]) { + // verify the required parameter 'file_id' is set if ($file_id === null || (is_array($file_id) && count($file_id) === 0)) { throw new \InvalidArgumentException( @@ -3026,6 +3907,7 @@ public function downloadFileRequest($file_id) ); } + $resourcePath = '/v2/employee/file/download/{fileID}'; $formParams = []; $queryParams = []; @@ -3045,16 +3927,11 @@ public function downloadFileRequest($file_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3072,12 +3949,12 @@ public function downloadFileRequest($file_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3093,10 +3970,11 @@ public function downloadFileRequest($file_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3107,14 +3985,15 @@ public function downloadFileRequest($file_id) * * Export club members * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportClubMembers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function exportClubMembers() + public function exportClubMembers(string $contentType = self::contentTypes['exportClubMembers'][0]) { - list($response) = $this->exportClubMembersWithHttpInfo(); + list($response) = $this->exportClubMembersWithHttpInfo($contentType); return $response; } @@ -3123,14 +4002,15 @@ public function exportClubMembers() * * Export club members * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportClubMembers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function exportClubMembersWithHttpInfo() + public function exportClubMembersWithHttpInfo(string $contentType = self::contentTypes['exportClubMembers'][0]) { - $request = $this->exportClubMembersRequest(); + $request = $this->exportClubMembersRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -3173,6 +4053,21 @@ public function exportClubMembersWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3185,6 +4080,21 @@ public function exportClubMembersWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3197,6 +4107,21 @@ public function exportClubMembersWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3209,6 +4134,21 @@ public function exportClubMembersWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3223,6 +4163,21 @@ public function exportClubMembersWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3275,13 +4230,14 @@ public function exportClubMembersWithHttpInfo() * * Export club members * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportClubMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportClubMembersAsync() + public function exportClubMembersAsync(string $contentType = self::contentTypes['exportClubMembers'][0]) { - return $this->exportClubMembersAsyncWithHttpInfo() + return $this->exportClubMembersAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -3294,14 +4250,15 @@ function ($response) { * * Export club members * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportClubMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportClubMembersAsyncWithHttpInfo() + public function exportClubMembersAsyncWithHttpInfo(string $contentType = self::contentTypes['exportClubMembers'][0]) { $returnType = 'string'; - $request = $this->exportClubMembersRequest(); + $request = $this->exportClubMembersRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3311,6 +4268,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3339,13 +4299,15 @@ function ($exception) { /** * Create request for operation 'exportClubMembers' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportClubMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function exportClubMembersRequest() + public function exportClubMembersRequest(string $contentType = self::contentTypes['exportClubMembers'][0]) { + $resourcePath = '/v2/employee/export/members'; $formParams = []; $queryParams = []; @@ -3357,16 +4319,11 @@ public function exportClubMembersRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3384,12 +4341,12 @@ public function exportClubMembersRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3405,10 +4362,11 @@ public function exportClubMembersRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3419,14 +4377,15 @@ public function exportClubMembersRequest() * * Export merchant credits * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportMerchantCredits'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function exportMerchantCredits() + public function exportMerchantCredits(string $contentType = self::contentTypes['exportMerchantCredits'][0]) { - list($response) = $this->exportMerchantCreditsWithHttpInfo(); + list($response) = $this->exportMerchantCreditsWithHttpInfo($contentType); return $response; } @@ -3435,14 +4394,15 @@ public function exportMerchantCredits() * * Export merchant credits * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportMerchantCredits'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function exportMerchantCreditsWithHttpInfo() + public function exportMerchantCreditsWithHttpInfo(string $contentType = self::contentTypes['exportMerchantCredits'][0]) { - $request = $this->exportMerchantCreditsRequest(); + $request = $this->exportMerchantCreditsRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -3485,6 +4445,21 @@ public function exportMerchantCreditsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3497,6 +4472,21 @@ public function exportMerchantCreditsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3509,6 +4499,21 @@ public function exportMerchantCreditsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3521,6 +4526,21 @@ public function exportMerchantCreditsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3535,6 +4555,21 @@ public function exportMerchantCreditsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3587,13 +4622,14 @@ public function exportMerchantCreditsWithHttpInfo() * * Export merchant credits * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportMerchantCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportMerchantCreditsAsync() + public function exportMerchantCreditsAsync(string $contentType = self::contentTypes['exportMerchantCredits'][0]) { - return $this->exportMerchantCreditsAsyncWithHttpInfo() + return $this->exportMerchantCreditsAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -3606,14 +4642,15 @@ function ($response) { * * Export merchant credits * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportMerchantCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportMerchantCreditsAsyncWithHttpInfo() + public function exportMerchantCreditsAsyncWithHttpInfo(string $contentType = self::contentTypes['exportMerchantCredits'][0]) { $returnType = 'string'; - $request = $this->exportMerchantCreditsRequest(); + $request = $this->exportMerchantCreditsRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3623,6 +4660,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3651,13 +4691,15 @@ function ($exception) { /** * Create request for operation 'exportMerchantCredits' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportMerchantCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function exportMerchantCreditsRequest() + public function exportMerchantCreditsRequest(string $contentType = self::contentTypes['exportMerchantCredits'][0]) { + $resourcePath = '/v2/employee/export/merchantCredits'; $formParams = []; $queryParams = []; @@ -3669,16 +4711,11 @@ public function exportMerchantCreditsRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3696,12 +4733,12 @@ public function exportMerchantCreditsRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3717,10 +4754,11 @@ public function exportMerchantCreditsRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3732,14 +4770,15 @@ public function exportMerchantCreditsRequest() * Export static voucher campaign * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function exportStaticVoucherCampaign($campaign_id) + public function exportStaticVoucherCampaign($campaign_id, string $contentType = self::contentTypes['exportStaticVoucherCampaign'][0]) { - list($response) = $this->exportStaticVoucherCampaignWithHttpInfo($campaign_id); + list($response) = $this->exportStaticVoucherCampaignWithHttpInfo($campaign_id, $contentType); return $response; } @@ -3749,14 +4788,15 @@ public function exportStaticVoucherCampaign($campaign_id) * Export static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function exportStaticVoucherCampaignWithHttpInfo($campaign_id) + public function exportStaticVoucherCampaignWithHttpInfo($campaign_id, string $contentType = self::contentTypes['exportStaticVoucherCampaign'][0]) { - $request = $this->exportStaticVoucherCampaignRequest($campaign_id); + $request = $this->exportStaticVoucherCampaignRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3799,6 +4839,21 @@ public function exportStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3811,6 +4866,21 @@ public function exportStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3823,6 +4893,21 @@ public function exportStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3835,6 +4920,21 @@ public function exportStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3849,6 +4949,21 @@ public function exportStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3902,13 +5017,14 @@ public function exportStaticVoucherCampaignWithHttpInfo($campaign_id) * Export static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportStaticVoucherCampaignAsync($campaign_id) + public function exportStaticVoucherCampaignAsync($campaign_id, string $contentType = self::contentTypes['exportStaticVoucherCampaign'][0]) { - return $this->exportStaticVoucherCampaignAsyncWithHttpInfo($campaign_id) + return $this->exportStaticVoucherCampaignAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -3922,14 +5038,15 @@ function ($response) { * Export static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportStaticVoucherCampaignAsyncWithHttpInfo($campaign_id) + public function exportStaticVoucherCampaignAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['exportStaticVoucherCampaign'][0]) { $returnType = 'string'; - $request = $this->exportStaticVoucherCampaignRequest($campaign_id); + $request = $this->exportStaticVoucherCampaignRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3939,6 +5056,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3968,12 +5088,14 @@ function ($exception) { * Create request for operation 'exportStaticVoucherCampaign' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function exportStaticVoucherCampaignRequest($campaign_id) + public function exportStaticVoucherCampaignRequest($campaign_id, string $contentType = self::contentTypes['exportStaticVoucherCampaign'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -3981,6 +5103,7 @@ public function exportStaticVoucherCampaignRequest($campaign_id) ); } + $resourcePath = '/v2/employee/export/staticVoucherCampaign/{campaignID}'; $formParams = []; $queryParams = []; @@ -4000,16 +5123,11 @@ public function exportStaticVoucherCampaignRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4027,12 +5145,12 @@ public function exportStaticVoucherCampaignRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4048,10 +5166,11 @@ public function exportStaticVoucherCampaignRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4063,14 +5182,15 @@ public function exportStaticVoucherCampaignRequest($campaign_id) * Fetch URL to download a failed import * * @param string $file_id file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['failedImport'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function failedImport($file_id) + public function failedImport($file_id, string $contentType = self::contentTypes['failedImport'][0]) { - list($response) = $this->failedImportWithHttpInfo($file_id); + list($response) = $this->failedImportWithHttpInfo($file_id, $contentType); return $response; } @@ -4080,14 +5200,15 @@ public function failedImport($file_id) * Fetch URL to download a failed import * * @param string $file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['failedImport'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function failedImportWithHttpInfo($file_id) + public function failedImportWithHttpInfo($file_id, string $contentType = self::contentTypes['failedImport'][0]) { - $request = $this->failedImportRequest($file_id); + $request = $this->failedImportRequest($file_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -4130,6 +5251,21 @@ public function failedImportWithHttpInfo($file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4142,6 +5278,21 @@ public function failedImportWithHttpInfo($file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4154,6 +5305,21 @@ public function failedImportWithHttpInfo($file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4166,6 +5332,21 @@ public function failedImportWithHttpInfo($file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4180,6 +5361,21 @@ public function failedImportWithHttpInfo($file_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4233,13 +5429,14 @@ public function failedImportWithHttpInfo($file_id) * Fetch URL to download a failed import * * @param string $file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['failedImport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function failedImportAsync($file_id) + public function failedImportAsync($file_id, string $contentType = self::contentTypes['failedImport'][0]) { - return $this->failedImportAsyncWithHttpInfo($file_id) + return $this->failedImportAsyncWithHttpInfo($file_id, $contentType) ->then( function ($response) { return $response[0]; @@ -4253,14 +5450,15 @@ function ($response) { * Fetch URL to download a failed import * * @param string $file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['failedImport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function failedImportAsyncWithHttpInfo($file_id) + public function failedImportAsyncWithHttpInfo($file_id, string $contentType = self::contentTypes['failedImport'][0]) { $returnType = 'string'; - $request = $this->failedImportRequest($file_id); + $request = $this->failedImportRequest($file_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4270,6 +5468,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4299,12 +5500,14 @@ function ($exception) { * Create request for operation 'failedImport' * * @param string $file_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['failedImport'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function failedImportRequest($file_id) + public function failedImportRequest($file_id, string $contentType = self::contentTypes['failedImport'][0]) { + // verify the required parameter 'file_id' is set if ($file_id === null || (is_array($file_id) && count($file_id) === 0)) { throw new \InvalidArgumentException( @@ -4312,6 +5515,7 @@ public function failedImportRequest($file_id) ); } + $resourcePath = '/v2/employee/file/imports/failed/{fileID}'; $formParams = []; $queryParams = []; @@ -4331,16 +5535,11 @@ public function failedImportRequest($file_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4358,12 +5557,12 @@ public function failedImportRequest($file_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4379,10 +5578,11 @@ public function failedImportRequest($file_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4394,14 +5594,15 @@ public function failedImportRequest($file_id) * Fetch all documents * * @param string $folder folder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDocuments'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Document[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDocuments($folder = null) + public function fetchDocuments($folder = null, string $contentType = self::contentTypes['fetchDocuments'][0]) { - list($response) = $this->fetchDocumentsWithHttpInfo($folder); + list($response) = $this->fetchDocumentsWithHttpInfo($folder, $contentType); return $response; } @@ -4411,14 +5612,15 @@ public function fetchDocuments($folder = null) * Fetch all documents * * @param string $folder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDocuments'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Document[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDocumentsWithHttpInfo($folder = null) + public function fetchDocumentsWithHttpInfo($folder = null, string $contentType = self::contentTypes['fetchDocuments'][0]) { - $request = $this->fetchDocumentsRequest($folder); + $request = $this->fetchDocumentsRequest($folder, $contentType); try { $options = $this->createHttpClientOption(); @@ -4461,6 +5663,21 @@ public function fetchDocumentsWithHttpInfo($folder = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Document[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4473,6 +5690,21 @@ public function fetchDocumentsWithHttpInfo($folder = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4485,6 +5717,21 @@ public function fetchDocumentsWithHttpInfo($folder = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4497,6 +5744,21 @@ public function fetchDocumentsWithHttpInfo($folder = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4511,6 +5773,21 @@ public function fetchDocumentsWithHttpInfo($folder = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4564,13 +5841,14 @@ public function fetchDocumentsWithHttpInfo($folder = null) * Fetch all documents * * @param string $folder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDocuments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDocumentsAsync($folder = null) + public function fetchDocumentsAsync($folder = null, string $contentType = self::contentTypes['fetchDocuments'][0]) { - return $this->fetchDocumentsAsyncWithHttpInfo($folder) + return $this->fetchDocumentsAsyncWithHttpInfo($folder, $contentType) ->then( function ($response) { return $response[0]; @@ -4584,14 +5862,15 @@ function ($response) { * Fetch all documents * * @param string $folder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDocuments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDocumentsAsyncWithHttpInfo($folder = null) + public function fetchDocumentsAsyncWithHttpInfo($folder = null, string $contentType = self::contentTypes['fetchDocuments'][0]) { $returnType = '\OpenAPI\Client\Model\Document[]'; - $request = $this->fetchDocumentsRequest($folder); + $request = $this->fetchDocumentsRequest($folder, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4601,6 +5880,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4630,13 +5912,16 @@ function ($exception) { * Create request for operation 'fetchDocuments' * * @param string $folder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDocuments'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDocumentsRequest($folder = null) + public function fetchDocumentsRequest($folder = null, string $contentType = self::contentTypes['fetchDocuments'][0]) { + + $resourcePath = '/v2/employee/documents/all'; $formParams = []; $queryParams = []; @@ -4645,30 +5930,23 @@ public function fetchDocumentsRequest($folder = null) $multipart = false; // query params - if ($folder !== null) { - if('form' === 'form' && is_array($folder)) { - foreach($folder as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['folder'] = $folder; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $folder, + 'folder', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4686,12 +5964,12 @@ public function fetchDocumentsRequest($folder = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4707,10 +5985,11 @@ public function fetchDocumentsRequest($folder = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4722,14 +6001,15 @@ public function fetchDocumentsRequest($folder = null) * Fetch all dynamic vouchers * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DynamicVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDynamicVouchers($is_archive_included = null) + public function fetchDynamicVouchers($is_archive_included = null, string $contentType = self::contentTypes['fetchDynamicVouchers'][0]) { - list($response) = $this->fetchDynamicVouchersWithHttpInfo($is_archive_included); + list($response) = $this->fetchDynamicVouchersWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -4739,14 +6019,15 @@ public function fetchDynamicVouchers($is_archive_included = null) * Fetch all dynamic vouchers * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DynamicVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDynamicVouchersWithHttpInfo($is_archive_included = null) + public function fetchDynamicVouchersWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchDynamicVouchers'][0]) { - $request = $this->fetchDynamicVouchersRequest($is_archive_included); + $request = $this->fetchDynamicVouchersRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -4789,6 +6070,21 @@ public function fetchDynamicVouchersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DynamicVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4801,6 +6097,21 @@ public function fetchDynamicVouchersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4813,6 +6124,21 @@ public function fetchDynamicVouchersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4825,6 +6151,21 @@ public function fetchDynamicVouchersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4839,6 +6180,21 @@ public function fetchDynamicVouchersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4892,13 +6248,14 @@ public function fetchDynamicVouchersWithHttpInfo($is_archive_included = null) * Fetch all dynamic vouchers * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDynamicVouchersAsync($is_archive_included = null) + public function fetchDynamicVouchersAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchDynamicVouchers'][0]) { - return $this->fetchDynamicVouchersAsyncWithHttpInfo($is_archive_included) + return $this->fetchDynamicVouchersAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -4912,14 +6269,15 @@ function ($response) { * Fetch all dynamic vouchers * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDynamicVouchersAsyncWithHttpInfo($is_archive_included = null) + public function fetchDynamicVouchersAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchDynamicVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\DynamicVoucher[]'; - $request = $this->fetchDynamicVouchersRequest($is_archive_included); + $request = $this->fetchDynamicVouchersRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4929,6 +6287,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4958,13 +6319,16 @@ function ($exception) { * Create request for operation 'fetchDynamicVouchers' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDynamicVouchersRequest($is_archive_included = null) + public function fetchDynamicVouchersRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchDynamicVouchers'][0]) { + + $resourcePath = '/v2/employee/dynamicVouchers/all'; $formParams = []; $queryParams = []; @@ -4973,30 +6337,23 @@ public function fetchDynamicVouchersRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5014,12 +6371,12 @@ public function fetchDynamicVouchersRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5035,10 +6392,11 @@ public function fetchDynamicVouchersRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5049,14 +6407,15 @@ public function fetchDynamicVouchersRequest($is_archive_included = null) * * Fetch static voucher campaign groups * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeStaticVoucherCampaignGroups'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucherCampaignGroup[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchEmployeeStaticVoucherCampaignGroups() + public function fetchEmployeeStaticVoucherCampaignGroups(string $contentType = self::contentTypes['fetchEmployeeStaticVoucherCampaignGroups'][0]) { - list($response) = $this->fetchEmployeeStaticVoucherCampaignGroupsWithHttpInfo(); + list($response) = $this->fetchEmployeeStaticVoucherCampaignGroupsWithHttpInfo($contentType); return $response; } @@ -5065,14 +6424,15 @@ public function fetchEmployeeStaticVoucherCampaignGroups() * * Fetch static voucher campaign groups * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeStaticVoucherCampaignGroups'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucherCampaignGroup[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchEmployeeStaticVoucherCampaignGroupsWithHttpInfo() + public function fetchEmployeeStaticVoucherCampaignGroupsWithHttpInfo(string $contentType = self::contentTypes['fetchEmployeeStaticVoucherCampaignGroups'][0]) { - $request = $this->fetchEmployeeStaticVoucherCampaignGroupsRequest(); + $request = $this->fetchEmployeeStaticVoucherCampaignGroupsRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -5115,6 +6475,21 @@ public function fetchEmployeeStaticVoucherCampaignGroupsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucherCampaignGroup[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5127,6 +6502,21 @@ public function fetchEmployeeStaticVoucherCampaignGroupsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5139,6 +6529,21 @@ public function fetchEmployeeStaticVoucherCampaignGroupsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5151,6 +6556,21 @@ public function fetchEmployeeStaticVoucherCampaignGroupsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5165,6 +6585,21 @@ public function fetchEmployeeStaticVoucherCampaignGroupsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5217,13 +6652,14 @@ public function fetchEmployeeStaticVoucherCampaignGroupsWithHttpInfo() * * Fetch static voucher campaign groups * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeStaticVoucherCampaignGroups'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchEmployeeStaticVoucherCampaignGroupsAsync() + public function fetchEmployeeStaticVoucherCampaignGroupsAsync(string $contentType = self::contentTypes['fetchEmployeeStaticVoucherCampaignGroups'][0]) { - return $this->fetchEmployeeStaticVoucherCampaignGroupsAsyncWithHttpInfo() + return $this->fetchEmployeeStaticVoucherCampaignGroupsAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -5236,14 +6672,15 @@ function ($response) { * * Fetch static voucher campaign groups * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeStaticVoucherCampaignGroups'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchEmployeeStaticVoucherCampaignGroupsAsyncWithHttpInfo() + public function fetchEmployeeStaticVoucherCampaignGroupsAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchEmployeeStaticVoucherCampaignGroups'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucherCampaignGroup[]'; - $request = $this->fetchEmployeeStaticVoucherCampaignGroupsRequest(); + $request = $this->fetchEmployeeStaticVoucherCampaignGroupsRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5253,6 +6690,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5281,13 +6721,15 @@ function ($exception) { /** * Create request for operation 'fetchEmployeeStaticVoucherCampaignGroups' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeStaticVoucherCampaignGroups'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchEmployeeStaticVoucherCampaignGroupsRequest() + public function fetchEmployeeStaticVoucherCampaignGroupsRequest(string $contentType = self::contentTypes['fetchEmployeeStaticVoucherCampaignGroups'][0]) { + $resourcePath = '/v2/employee/staticVoucherCampaignGroups/all'; $formParams = []; $queryParams = []; @@ -5299,16 +6741,11 @@ public function fetchEmployeeStaticVoucherCampaignGroupsRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5326,12 +6763,12 @@ public function fetchEmployeeStaticVoucherCampaignGroupsRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5347,10 +6784,11 @@ public function fetchEmployeeStaticVoucherCampaignGroupsRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5362,16 +6800,17 @@ public function fetchEmployeeStaticVoucherCampaignGroupsRequest() * Fetch static voucher campaigns * * @param bool $is_archive_included is_archive_included (optional) - * @param double $source_id source_id (optional) + * @param float $source_id source_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeStaticVoucherCampaigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucherCampaign[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError * @deprecated */ - public function fetchEmployeeStaticVoucherCampaigns($is_archive_included = null, $source_id = null) + public function fetchEmployeeStaticVoucherCampaigns($is_archive_included = null, $source_id = null, string $contentType = self::contentTypes['fetchEmployeeStaticVoucherCampaigns'][0]) { - list($response) = $this->fetchEmployeeStaticVoucherCampaignsWithHttpInfo($is_archive_included, $source_id); + list($response) = $this->fetchEmployeeStaticVoucherCampaignsWithHttpInfo($is_archive_included, $source_id, $contentType); return $response; } @@ -5381,16 +6820,17 @@ public function fetchEmployeeStaticVoucherCampaigns($is_archive_included = null, * Fetch static voucher campaigns * * @param bool $is_archive_included (optional) - * @param double $source_id (optional) + * @param float $source_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeStaticVoucherCampaigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucherCampaign[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function fetchEmployeeStaticVoucherCampaignsWithHttpInfo($is_archive_included = null, $source_id = null) + public function fetchEmployeeStaticVoucherCampaignsWithHttpInfo($is_archive_included = null, $source_id = null, string $contentType = self::contentTypes['fetchEmployeeStaticVoucherCampaigns'][0]) { - $request = $this->fetchEmployeeStaticVoucherCampaignsRequest($is_archive_included, $source_id); + $request = $this->fetchEmployeeStaticVoucherCampaignsRequest($is_archive_included, $source_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -5433,6 +6873,21 @@ public function fetchEmployeeStaticVoucherCampaignsWithHttpInfo($is_archive_incl $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucherCampaign[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5445,6 +6900,21 @@ public function fetchEmployeeStaticVoucherCampaignsWithHttpInfo($is_archive_incl $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5457,6 +6927,21 @@ public function fetchEmployeeStaticVoucherCampaignsWithHttpInfo($is_archive_incl $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5469,6 +6954,21 @@ public function fetchEmployeeStaticVoucherCampaignsWithHttpInfo($is_archive_incl $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5483,6 +6983,21 @@ public function fetchEmployeeStaticVoucherCampaignsWithHttpInfo($is_archive_incl $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5536,15 +7051,16 @@ public function fetchEmployeeStaticVoucherCampaignsWithHttpInfo($is_archive_incl * Fetch static voucher campaigns * * @param bool $is_archive_included (optional) - * @param double $source_id (optional) + * @param float $source_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeStaticVoucherCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function fetchEmployeeStaticVoucherCampaignsAsync($is_archive_included = null, $source_id = null) + public function fetchEmployeeStaticVoucherCampaignsAsync($is_archive_included = null, $source_id = null, string $contentType = self::contentTypes['fetchEmployeeStaticVoucherCampaigns'][0]) { - return $this->fetchEmployeeStaticVoucherCampaignsAsyncWithHttpInfo($is_archive_included, $source_id) + return $this->fetchEmployeeStaticVoucherCampaignsAsyncWithHttpInfo($is_archive_included, $source_id, $contentType) ->then( function ($response) { return $response[0]; @@ -5558,16 +7074,17 @@ function ($response) { * Fetch static voucher campaigns * * @param bool $is_archive_included (optional) - * @param double $source_id (optional) + * @param float $source_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeStaticVoucherCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function fetchEmployeeStaticVoucherCampaignsAsyncWithHttpInfo($is_archive_included = null, $source_id = null) + public function fetchEmployeeStaticVoucherCampaignsAsyncWithHttpInfo($is_archive_included = null, $source_id = null, string $contentType = self::contentTypes['fetchEmployeeStaticVoucherCampaigns'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucherCampaign[]'; - $request = $this->fetchEmployeeStaticVoucherCampaignsRequest($is_archive_included, $source_id); + $request = $this->fetchEmployeeStaticVoucherCampaignsRequest($is_archive_included, $source_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5577,6 +7094,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5606,15 +7126,19 @@ function ($exception) { * Create request for operation 'fetchEmployeeStaticVoucherCampaigns' * * @param bool $is_archive_included (optional) - * @param double $source_id (optional) + * @param float $source_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeeStaticVoucherCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function fetchEmployeeStaticVoucherCampaignsRequest($is_archive_included = null, $source_id = null) + public function fetchEmployeeStaticVoucherCampaignsRequest($is_archive_included = null, $source_id = null, string $contentType = self::contentTypes['fetchEmployeeStaticVoucherCampaigns'][0]) { + + + $resourcePath = '/v2/employee/staticVoucherCampaigns/all'; $formParams = []; $queryParams = []; @@ -5623,41 +7147,32 @@ public function fetchEmployeeStaticVoucherCampaignsRequest($is_archive_included $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($source_id !== null) { - if('form' === 'form' && is_array($source_id)) { - foreach($source_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['sourceID'] = $source_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $source_id, + 'sourceID', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5675,12 +7190,12 @@ public function fetchEmployeeStaticVoucherCampaignsRequest($is_archive_included // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5696,10 +7211,11 @@ public function fetchEmployeeStaticVoucherCampaignsRequest($is_archive_included $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5711,14 +7227,15 @@ public function fetchEmployeeStaticVoucherCampaignsRequest($is_archive_included * Fetch all media files * * @param string $folder folder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMediaFiles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MediaFile[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMediaFiles($folder = null) + public function fetchMediaFiles($folder = null, string $contentType = self::contentTypes['fetchMediaFiles'][0]) { - list($response) = $this->fetchMediaFilesWithHttpInfo($folder); + list($response) = $this->fetchMediaFilesWithHttpInfo($folder, $contentType); return $response; } @@ -5728,14 +7245,15 @@ public function fetchMediaFiles($folder = null) * Fetch all media files * * @param string $folder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMediaFiles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MediaFile[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMediaFilesWithHttpInfo($folder = null) + public function fetchMediaFilesWithHttpInfo($folder = null, string $contentType = self::contentTypes['fetchMediaFiles'][0]) { - $request = $this->fetchMediaFilesRequest($folder); + $request = $this->fetchMediaFilesRequest($folder, $contentType); try { $options = $this->createHttpClientOption(); @@ -5778,6 +7296,21 @@ public function fetchMediaFilesWithHttpInfo($folder = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MediaFile[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5790,6 +7323,21 @@ public function fetchMediaFilesWithHttpInfo($folder = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5802,6 +7350,21 @@ public function fetchMediaFilesWithHttpInfo($folder = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5814,6 +7377,21 @@ public function fetchMediaFilesWithHttpInfo($folder = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5828,6 +7406,21 @@ public function fetchMediaFilesWithHttpInfo($folder = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5881,13 +7474,14 @@ public function fetchMediaFilesWithHttpInfo($folder = null) * Fetch all media files * * @param string $folder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMediaFiles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMediaFilesAsync($folder = null) + public function fetchMediaFilesAsync($folder = null, string $contentType = self::contentTypes['fetchMediaFiles'][0]) { - return $this->fetchMediaFilesAsyncWithHttpInfo($folder) + return $this->fetchMediaFilesAsyncWithHttpInfo($folder, $contentType) ->then( function ($response) { return $response[0]; @@ -5901,14 +7495,15 @@ function ($response) { * Fetch all media files * * @param string $folder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMediaFiles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMediaFilesAsyncWithHttpInfo($folder = null) + public function fetchMediaFilesAsyncWithHttpInfo($folder = null, string $contentType = self::contentTypes['fetchMediaFiles'][0]) { $returnType = '\OpenAPI\Client\Model\MediaFile[]'; - $request = $this->fetchMediaFilesRequest($folder); + $request = $this->fetchMediaFilesRequest($folder, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5918,6 +7513,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5947,13 +7545,16 @@ function ($exception) { * Create request for operation 'fetchMediaFiles' * * @param string $folder (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMediaFiles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMediaFilesRequest($folder = null) + public function fetchMediaFilesRequest($folder = null, string $contentType = self::contentTypes['fetchMediaFiles'][0]) { + + $resourcePath = '/v2/employee/mediaFiles/all'; $formParams = []; $queryParams = []; @@ -5962,30 +7563,23 @@ public function fetchMediaFilesRequest($folder = null) $multipart = false; // query params - if ($folder !== null) { - if('form' === 'form' && is_array($folder)) { - foreach($folder as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['folder'] = $folder; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $folder, + 'folder', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6003,12 +7597,12 @@ public function fetchMediaFilesRequest($folder = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6024,10 +7618,11 @@ public function fetchMediaFilesRequest($folder = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6038,14 +7633,15 @@ public function fetchMediaFilesRequest($folder = null) * * Create employee alert * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchant'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMerchant() + public function fetchMerchant(string $contentType = self::contentTypes['fetchMerchant'][0]) { - list($response) = $this->fetchMerchantWithHttpInfo(); + list($response) = $this->fetchMerchantWithHttpInfo($contentType); return $response; } @@ -6054,14 +7650,15 @@ public function fetchMerchant() * * Create employee alert * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchant'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMerchantWithHttpInfo() + public function fetchMerchantWithHttpInfo(string $contentType = self::contentTypes['fetchMerchant'][0]) { - $request = $this->fetchMerchantRequest(); + $request = $this->fetchMerchantRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -6104,6 +7701,21 @@ public function fetchMerchantWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6116,6 +7728,21 @@ public function fetchMerchantWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6128,6 +7755,21 @@ public function fetchMerchantWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6140,6 +7782,21 @@ public function fetchMerchantWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6154,6 +7811,21 @@ public function fetchMerchantWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6206,13 +7878,14 @@ public function fetchMerchantWithHttpInfo() * * Create employee alert * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchant'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantAsync() + public function fetchMerchantAsync(string $contentType = self::contentTypes['fetchMerchant'][0]) { - return $this->fetchMerchantAsyncWithHttpInfo() + return $this->fetchMerchantAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -6225,14 +7898,15 @@ function ($response) { * * Create employee alert * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchant'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantAsyncWithHttpInfo() + public function fetchMerchantAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchMerchant'][0]) { $returnType = 'mixed'; - $request = $this->fetchMerchantRequest(); + $request = $this->fetchMerchantRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6242,6 +7916,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6270,13 +7947,15 @@ function ($exception) { /** * Create request for operation 'fetchMerchant' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchant'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMerchantRequest() + public function fetchMerchantRequest(string $contentType = self::contentTypes['fetchMerchant'][0]) { + $resourcePath = '/v2/employee/merchant'; $formParams = []; $queryParams = []; @@ -6288,16 +7967,11 @@ public function fetchMerchantRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6315,12 +7989,12 @@ public function fetchMerchantRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6336,10 +8010,11 @@ public function fetchMerchantRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6350,14 +8025,15 @@ public function fetchMerchantRequest() * * Fetch all messages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Message[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMessages() + public function fetchMessages(string $contentType = self::contentTypes['fetchMessages'][0]) { - list($response) = $this->fetchMessagesWithHttpInfo(); + list($response) = $this->fetchMessagesWithHttpInfo($contentType); return $response; } @@ -6366,14 +8042,15 @@ public function fetchMessages() * * Fetch all messages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Message[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMessagesWithHttpInfo() + public function fetchMessagesWithHttpInfo(string $contentType = self::contentTypes['fetchMessages'][0]) { - $request = $this->fetchMessagesRequest(); + $request = $this->fetchMessagesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -6416,6 +8093,21 @@ public function fetchMessagesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Message[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6428,6 +8120,21 @@ public function fetchMessagesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6440,6 +8147,21 @@ public function fetchMessagesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6452,6 +8174,21 @@ public function fetchMessagesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6466,6 +8203,21 @@ public function fetchMessagesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6518,13 +8270,14 @@ public function fetchMessagesWithHttpInfo() * * Fetch all messages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMessagesAsync() + public function fetchMessagesAsync(string $contentType = self::contentTypes['fetchMessages'][0]) { - return $this->fetchMessagesAsyncWithHttpInfo() + return $this->fetchMessagesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -6537,14 +8290,15 @@ function ($response) { * * Fetch all messages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMessagesAsyncWithHttpInfo() + public function fetchMessagesAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchMessages'][0]) { $returnType = '\OpenAPI\Client\Model\Message[]'; - $request = $this->fetchMessagesRequest(); + $request = $this->fetchMessagesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6554,6 +8308,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6582,13 +8339,15 @@ function ($exception) { /** * Create request for operation 'fetchMessages' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMessagesRequest() + public function fetchMessagesRequest(string $contentType = self::contentTypes['fetchMessages'][0]) { + $resourcePath = '/v2/employee/messages/all'; $formParams = []; $queryParams = []; @@ -6600,16 +8359,11 @@ public function fetchMessagesRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6627,12 +8381,12 @@ public function fetchMessagesRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6648,10 +8402,11 @@ public function fetchMessagesRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6663,14 +8418,15 @@ public function fetchMessagesRequest() * Fetch opt in list source * * @param mixed $source_id source_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSource'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OptInListSource|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOptInListSource($source_id) + public function fetchOptInListSource($source_id, string $contentType = self::contentTypes['fetchOptInListSource'][0]) { - list($response) = $this->fetchOptInListSourceWithHttpInfo($source_id); + list($response) = $this->fetchOptInListSourceWithHttpInfo($source_id, $contentType); return $response; } @@ -6680,14 +8436,15 @@ public function fetchOptInListSource($source_id) * Fetch opt in list source * * @param mixed $source_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSource'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OptInListSource|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOptInListSourceWithHttpInfo($source_id) + public function fetchOptInListSourceWithHttpInfo($source_id, string $contentType = self::contentTypes['fetchOptInListSource'][0]) { - $request = $this->fetchOptInListSourceRequest($source_id); + $request = $this->fetchOptInListSourceRequest($source_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -6730,6 +8487,21 @@ public function fetchOptInListSourceWithHttpInfo($source_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptInListSource' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6742,6 +8514,21 @@ public function fetchOptInListSourceWithHttpInfo($source_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6754,6 +8541,21 @@ public function fetchOptInListSourceWithHttpInfo($source_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6766,6 +8568,21 @@ public function fetchOptInListSourceWithHttpInfo($source_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6780,6 +8597,21 @@ public function fetchOptInListSourceWithHttpInfo($source_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6833,13 +8665,14 @@ public function fetchOptInListSourceWithHttpInfo($source_id) * Fetch opt in list source * * @param mixed $source_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSource'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListSourceAsync($source_id) + public function fetchOptInListSourceAsync($source_id, string $contentType = self::contentTypes['fetchOptInListSource'][0]) { - return $this->fetchOptInListSourceAsyncWithHttpInfo($source_id) + return $this->fetchOptInListSourceAsyncWithHttpInfo($source_id, $contentType) ->then( function ($response) { return $response[0]; @@ -6853,14 +8686,15 @@ function ($response) { * Fetch opt in list source * * @param mixed $source_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSource'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListSourceAsyncWithHttpInfo($source_id) + public function fetchOptInListSourceAsyncWithHttpInfo($source_id, string $contentType = self::contentTypes['fetchOptInListSource'][0]) { $returnType = '\OpenAPI\Client\Model\OptInListSource'; - $request = $this->fetchOptInListSourceRequest($source_id); + $request = $this->fetchOptInListSourceRequest($source_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6870,6 +8704,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6899,12 +8736,14 @@ function ($exception) { * Create request for operation 'fetchOptInListSource' * * @param mixed $source_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSource'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOptInListSourceRequest($source_id) + public function fetchOptInListSourceRequest($source_id, string $contentType = self::contentTypes['fetchOptInListSource'][0]) { + // verify the required parameter 'source_id' is set if ($source_id === null || (is_array($source_id) && count($source_id) === 0)) { throw new \InvalidArgumentException( @@ -6912,6 +8751,7 @@ public function fetchOptInListSourceRequest($source_id) ); } + $resourcePath = '/v2/employee/optInListSource/{sourceID}'; $formParams = []; $queryParams = []; @@ -6931,16 +8771,11 @@ public function fetchOptInListSourceRequest($source_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6958,12 +8793,12 @@ public function fetchOptInListSourceRequest($source_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6979,10 +8814,11 @@ public function fetchOptInListSourceRequest($source_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6993,14 +8829,15 @@ public function fetchOptInListSourceRequest($source_id) * * Fetch all opt in list sources * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSourcesCreatedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OptInListSource[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOptInListSourcesCreatedByEmployee() + public function fetchOptInListSourcesCreatedByEmployee(string $contentType = self::contentTypes['fetchOptInListSourcesCreatedByEmployee'][0]) { - list($response) = $this->fetchOptInListSourcesCreatedByEmployeeWithHttpInfo(); + list($response) = $this->fetchOptInListSourcesCreatedByEmployeeWithHttpInfo($contentType); return $response; } @@ -7009,14 +8846,15 @@ public function fetchOptInListSourcesCreatedByEmployee() * * Fetch all opt in list sources * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSourcesCreatedByEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OptInListSource[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOptInListSourcesCreatedByEmployeeWithHttpInfo() + public function fetchOptInListSourcesCreatedByEmployeeWithHttpInfo(string $contentType = self::contentTypes['fetchOptInListSourcesCreatedByEmployee'][0]) { - $request = $this->fetchOptInListSourcesCreatedByEmployeeRequest(); + $request = $this->fetchOptInListSourcesCreatedByEmployeeRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -7059,6 +8897,21 @@ public function fetchOptInListSourcesCreatedByEmployeeWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptInListSource[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7071,6 +8924,21 @@ public function fetchOptInListSourcesCreatedByEmployeeWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7083,6 +8951,21 @@ public function fetchOptInListSourcesCreatedByEmployeeWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7095,6 +8978,21 @@ public function fetchOptInListSourcesCreatedByEmployeeWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7109,6 +9007,21 @@ public function fetchOptInListSourcesCreatedByEmployeeWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7161,13 +9074,14 @@ public function fetchOptInListSourcesCreatedByEmployeeWithHttpInfo() * * Fetch all opt in list sources * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSourcesCreatedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListSourcesCreatedByEmployeeAsync() + public function fetchOptInListSourcesCreatedByEmployeeAsync(string $contentType = self::contentTypes['fetchOptInListSourcesCreatedByEmployee'][0]) { - return $this->fetchOptInListSourcesCreatedByEmployeeAsyncWithHttpInfo() + return $this->fetchOptInListSourcesCreatedByEmployeeAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -7180,14 +9094,15 @@ function ($response) { * * Fetch all opt in list sources * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSourcesCreatedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListSourcesCreatedByEmployeeAsyncWithHttpInfo() + public function fetchOptInListSourcesCreatedByEmployeeAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchOptInListSourcesCreatedByEmployee'][0]) { $returnType = '\OpenAPI\Client\Model\OptInListSource[]'; - $request = $this->fetchOptInListSourcesCreatedByEmployeeRequest(); + $request = $this->fetchOptInListSourcesCreatedByEmployeeRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7197,6 +9112,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7225,13 +9143,15 @@ function ($exception) { /** * Create request for operation 'fetchOptInListSourcesCreatedByEmployee' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSourcesCreatedByEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOptInListSourcesCreatedByEmployeeRequest() + public function fetchOptInListSourcesCreatedByEmployeeRequest(string $contentType = self::contentTypes['fetchOptInListSourcesCreatedByEmployee'][0]) { + $resourcePath = '/v2/employee/optInListSources/all'; $formParams = []; $queryParams = []; @@ -7243,16 +9163,11 @@ public function fetchOptInListSourcesCreatedByEmployeeRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -7270,12 +9185,12 @@ public function fetchOptInListSourcesCreatedByEmployeeRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7291,10 +9206,11 @@ public function fetchOptInListSourcesCreatedByEmployeeRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7306,14 +9222,15 @@ public function fetchOptInListSourcesCreatedByEmployeeRequest() * Fetch peer activity * * @param mixed $employee_id employee_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPeerActivity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmployeeActivityLog[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchPeerActivity($employee_id) + public function fetchPeerActivity($employee_id, string $contentType = self::contentTypes['fetchPeerActivity'][0]) { - list($response) = $this->fetchPeerActivityWithHttpInfo($employee_id); + list($response) = $this->fetchPeerActivityWithHttpInfo($employee_id, $contentType); return $response; } @@ -7323,14 +9240,15 @@ public function fetchPeerActivity($employee_id) * Fetch peer activity * * @param mixed $employee_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPeerActivity'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmployeeActivityLog[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchPeerActivityWithHttpInfo($employee_id) + public function fetchPeerActivityWithHttpInfo($employee_id, string $contentType = self::contentTypes['fetchPeerActivity'][0]) { - $request = $this->fetchPeerActivityRequest($employee_id); + $request = $this->fetchPeerActivityRequest($employee_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -7373,6 +9291,21 @@ public function fetchPeerActivityWithHttpInfo($employee_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EmployeeActivityLog[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7385,6 +9318,21 @@ public function fetchPeerActivityWithHttpInfo($employee_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7397,6 +9345,21 @@ public function fetchPeerActivityWithHttpInfo($employee_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7409,6 +9372,21 @@ public function fetchPeerActivityWithHttpInfo($employee_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7423,6 +9401,21 @@ public function fetchPeerActivityWithHttpInfo($employee_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7476,13 +9469,14 @@ public function fetchPeerActivityWithHttpInfo($employee_id) * Fetch peer activity * * @param mixed $employee_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPeerActivity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPeerActivityAsync($employee_id) + public function fetchPeerActivityAsync($employee_id, string $contentType = self::contentTypes['fetchPeerActivity'][0]) { - return $this->fetchPeerActivityAsyncWithHttpInfo($employee_id) + return $this->fetchPeerActivityAsyncWithHttpInfo($employee_id, $contentType) ->then( function ($response) { return $response[0]; @@ -7496,14 +9490,15 @@ function ($response) { * Fetch peer activity * * @param mixed $employee_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPeerActivity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPeerActivityAsyncWithHttpInfo($employee_id) + public function fetchPeerActivityAsyncWithHttpInfo($employee_id, string $contentType = self::contentTypes['fetchPeerActivity'][0]) { $returnType = '\OpenAPI\Client\Model\EmployeeActivityLog[]'; - $request = $this->fetchPeerActivityRequest($employee_id); + $request = $this->fetchPeerActivityRequest($employee_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7513,6 +9508,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7542,12 +9540,14 @@ function ($exception) { * Create request for operation 'fetchPeerActivity' * * @param mixed $employee_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPeerActivity'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchPeerActivityRequest($employee_id) + public function fetchPeerActivityRequest($employee_id, string $contentType = self::contentTypes['fetchPeerActivity'][0]) { + // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( @@ -7555,6 +9555,7 @@ public function fetchPeerActivityRequest($employee_id) ); } + $resourcePath = '/v2/employee/peer/activity/{employeeID}'; $formParams = []; $queryParams = []; @@ -7574,16 +9575,11 @@ public function fetchPeerActivityRequest($employee_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -7601,12 +9597,12 @@ public function fetchPeerActivityRequest($employee_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7622,10 +9618,11 @@ public function fetchPeerActivityRequest($employee_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7637,14 +9634,15 @@ public function fetchPeerActivityRequest($employee_id) * Fetch peer permissions * * @param mixed $user_id user_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPeersPermissions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchPeersPermissions($user_id) + public function fetchPeersPermissions($user_id, string $contentType = self::contentTypes['fetchPeersPermissions'][0]) { - list($response) = $this->fetchPeersPermissionsWithHttpInfo($user_id); + list($response) = $this->fetchPeersPermissionsWithHttpInfo($user_id, $contentType); return $response; } @@ -7654,14 +9652,15 @@ public function fetchPeersPermissions($user_id) * Fetch peer permissions * * @param mixed $user_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPeersPermissions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchPeersPermissionsWithHttpInfo($user_id) + public function fetchPeersPermissionsWithHttpInfo($user_id, string $contentType = self::contentTypes['fetchPeersPermissions'][0]) { - $request = $this->fetchPeersPermissionsRequest($user_id); + $request = $this->fetchPeersPermissionsRequest($user_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -7704,6 +9703,21 @@ public function fetchPeersPermissionsWithHttpInfo($user_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7716,6 +9730,21 @@ public function fetchPeersPermissionsWithHttpInfo($user_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7728,6 +9757,21 @@ public function fetchPeersPermissionsWithHttpInfo($user_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7740,6 +9784,21 @@ public function fetchPeersPermissionsWithHttpInfo($user_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7754,6 +9813,21 @@ public function fetchPeersPermissionsWithHttpInfo($user_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7807,13 +9881,14 @@ public function fetchPeersPermissionsWithHttpInfo($user_id) * Fetch peer permissions * * @param mixed $user_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPeersPermissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPeersPermissionsAsync($user_id) + public function fetchPeersPermissionsAsync($user_id, string $contentType = self::contentTypes['fetchPeersPermissions'][0]) { - return $this->fetchPeersPermissionsAsyncWithHttpInfo($user_id) + return $this->fetchPeersPermissionsAsyncWithHttpInfo($user_id, $contentType) ->then( function ($response) { return $response[0]; @@ -7827,14 +9902,15 @@ function ($response) { * Fetch peer permissions * * @param mixed $user_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPeersPermissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPeersPermissionsAsyncWithHttpInfo($user_id) + public function fetchPeersPermissionsAsyncWithHttpInfo($user_id, string $contentType = self::contentTypes['fetchPeersPermissions'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchPeersPermissionsRequest($user_id); + $request = $this->fetchPeersPermissionsRequest($user_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7844,6 +9920,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7873,12 +9952,14 @@ function ($exception) { * Create request for operation 'fetchPeersPermissions' * * @param mixed $user_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPeersPermissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchPeersPermissionsRequest($user_id) + public function fetchPeersPermissionsRequest($user_id, string $contentType = self::contentTypes['fetchPeersPermissions'][0]) { + // verify the required parameter 'user_id' is set if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { throw new \InvalidArgumentException( @@ -7886,6 +9967,7 @@ public function fetchPeersPermissionsRequest($user_id) ); } + $resourcePath = '/v2/employee/peer/permissions/{userID}'; $formParams = []; $queryParams = []; @@ -7905,16 +9987,11 @@ public function fetchPeersPermissionsRequest($user_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -7932,12 +10009,12 @@ public function fetchPeersPermissionsRequest($user_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7953,10 +10030,11 @@ public function fetchPeersPermissionsRequest($user_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7967,14 +10045,15 @@ public function fetchPeersPermissionsRequest($user_id) * * Retrieve employee's webpages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchProfileInfo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Employee|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchProfileInfo() + public function fetchProfileInfo(string $contentType = self::contentTypes['fetchProfileInfo'][0]) { - list($response) = $this->fetchProfileInfoWithHttpInfo(); + list($response) = $this->fetchProfileInfoWithHttpInfo($contentType); return $response; } @@ -7983,14 +10062,15 @@ public function fetchProfileInfo() * * Retrieve employee's webpages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchProfileInfo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Employee|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchProfileInfoWithHttpInfo() + public function fetchProfileInfoWithHttpInfo(string $contentType = self::contentTypes['fetchProfileInfo'][0]) { - $request = $this->fetchProfileInfoRequest(); + $request = $this->fetchProfileInfoRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -8033,6 +10113,21 @@ public function fetchProfileInfoWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Employee' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8045,6 +10140,21 @@ public function fetchProfileInfoWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8057,6 +10167,21 @@ public function fetchProfileInfoWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8069,6 +10194,21 @@ public function fetchProfileInfoWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8083,6 +10223,21 @@ public function fetchProfileInfoWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8135,13 +10290,14 @@ public function fetchProfileInfoWithHttpInfo() * * Retrieve employee's webpages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchProfileInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchProfileInfoAsync() + public function fetchProfileInfoAsync(string $contentType = self::contentTypes['fetchProfileInfo'][0]) { - return $this->fetchProfileInfoAsyncWithHttpInfo() + return $this->fetchProfileInfoAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -8154,14 +10310,15 @@ function ($response) { * * Retrieve employee's webpages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchProfileInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchProfileInfoAsyncWithHttpInfo() + public function fetchProfileInfoAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchProfileInfo'][0]) { $returnType = '\OpenAPI\Client\Model\Employee'; - $request = $this->fetchProfileInfoRequest(); + $request = $this->fetchProfileInfoRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8171,6 +10328,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8199,13 +10359,15 @@ function ($exception) { /** * Create request for operation 'fetchProfileInfo' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchProfileInfo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchProfileInfoRequest() + public function fetchProfileInfoRequest(string $contentType = self::contentTypes['fetchProfileInfo'][0]) { + $resourcePath = '/v2/employee'; $formParams = []; $queryParams = []; @@ -8217,16 +10379,11 @@ public function fetchProfileInfoRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -8244,12 +10401,12 @@ public function fetchProfileInfoRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8265,10 +10422,11 @@ public function fetchProfileInfoRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8280,14 +10438,15 @@ public function fetchProfileInfoRequest() * Import club members * * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importClubMembers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function importClubMembers($wt_employee_import_records) + public function importClubMembers($wt_employee_import_records, string $contentType = self::contentTypes['importClubMembers'][0]) { - list($response) = $this->importClubMembersWithHttpInfo($wt_employee_import_records); + list($response) = $this->importClubMembersWithHttpInfo($wt_employee_import_records, $contentType); return $response; } @@ -8297,14 +10456,15 @@ public function importClubMembers($wt_employee_import_records) * Import club members * * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importClubMembers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function importClubMembersWithHttpInfo($wt_employee_import_records) + public function importClubMembersWithHttpInfo($wt_employee_import_records, string $contentType = self::contentTypes['importClubMembers'][0]) { - $request = $this->importClubMembersRequest($wt_employee_import_records); + $request = $this->importClubMembersRequest($wt_employee_import_records, $contentType); try { $options = $this->createHttpClientOption(); @@ -8347,6 +10507,21 @@ public function importClubMembersWithHttpInfo($wt_employee_import_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8359,6 +10534,21 @@ public function importClubMembersWithHttpInfo($wt_employee_import_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8371,6 +10561,21 @@ public function importClubMembersWithHttpInfo($wt_employee_import_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8383,6 +10588,21 @@ public function importClubMembersWithHttpInfo($wt_employee_import_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8397,6 +10617,21 @@ public function importClubMembersWithHttpInfo($wt_employee_import_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8450,13 +10685,14 @@ public function importClubMembersWithHttpInfo($wt_employee_import_records) * Import club members * * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importClubMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importClubMembersAsync($wt_employee_import_records) + public function importClubMembersAsync($wt_employee_import_records, string $contentType = self::contentTypes['importClubMembers'][0]) { - return $this->importClubMembersAsyncWithHttpInfo($wt_employee_import_records) + return $this->importClubMembersAsyncWithHttpInfo($wt_employee_import_records, $contentType) ->then( function ($response) { return $response[0]; @@ -8470,14 +10706,15 @@ function ($response) { * Import club members * * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importClubMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importClubMembersAsyncWithHttpInfo($wt_employee_import_records) + public function importClubMembersAsyncWithHttpInfo($wt_employee_import_records, string $contentType = self::contentTypes['importClubMembers'][0]) { $returnType = 'string'; - $request = $this->importClubMembersRequest($wt_employee_import_records); + $request = $this->importClubMembersRequest($wt_employee_import_records, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8487,6 +10724,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8516,12 +10756,14 @@ function ($exception) { * Create request for operation 'importClubMembers' * * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importClubMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function importClubMembersRequest($wt_employee_import_records) + public function importClubMembersRequest($wt_employee_import_records, string $contentType = self::contentTypes['importClubMembers'][0]) { + // verify the required parameter 'wt_employee_import_records' is set if ($wt_employee_import_records === null || (is_array($wt_employee_import_records) && count($wt_employee_import_records) === 0)) { throw new \InvalidArgumentException( @@ -8529,6 +10771,7 @@ public function importClubMembersRequest($wt_employee_import_records) ); } + $resourcePath = '/v2/employee/import/members'; $formParams = []; $queryParams = []; @@ -8540,21 +10783,17 @@ public function importClubMembersRequest($wt_employee_import_records) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_import_records)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_import_records)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_import_records)); } else { $httpBody = $wt_employee_import_records; } @@ -8573,12 +10812,12 @@ public function importClubMembersRequest($wt_employee_import_records) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8594,10 +10833,11 @@ public function importClubMembersRequest($wt_employee_import_records) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8609,14 +10849,15 @@ public function importClubMembersRequest($wt_employee_import_records) * Import merchant credits * * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importMerchantCredits'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function importMerchantCredits($wt_employee_import_records) + public function importMerchantCredits($wt_employee_import_records, string $contentType = self::contentTypes['importMerchantCredits'][0]) { - list($response) = $this->importMerchantCreditsWithHttpInfo($wt_employee_import_records); + list($response) = $this->importMerchantCreditsWithHttpInfo($wt_employee_import_records, $contentType); return $response; } @@ -8626,14 +10867,15 @@ public function importMerchantCredits($wt_employee_import_records) * Import merchant credits * * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importMerchantCredits'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function importMerchantCreditsWithHttpInfo($wt_employee_import_records) + public function importMerchantCreditsWithHttpInfo($wt_employee_import_records, string $contentType = self::contentTypes['importMerchantCredits'][0]) { - $request = $this->importMerchantCreditsRequest($wt_employee_import_records); + $request = $this->importMerchantCreditsRequest($wt_employee_import_records, $contentType); try { $options = $this->createHttpClientOption(); @@ -8676,6 +10918,21 @@ public function importMerchantCreditsWithHttpInfo($wt_employee_import_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8688,6 +10945,21 @@ public function importMerchantCreditsWithHttpInfo($wt_employee_import_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8700,6 +10972,21 @@ public function importMerchantCreditsWithHttpInfo($wt_employee_import_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8712,6 +10999,21 @@ public function importMerchantCreditsWithHttpInfo($wt_employee_import_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8726,6 +11028,21 @@ public function importMerchantCreditsWithHttpInfo($wt_employee_import_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8779,13 +11096,14 @@ public function importMerchantCreditsWithHttpInfo($wt_employee_import_records) * Import merchant credits * * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importMerchantCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importMerchantCreditsAsync($wt_employee_import_records) + public function importMerchantCreditsAsync($wt_employee_import_records, string $contentType = self::contentTypes['importMerchantCredits'][0]) { - return $this->importMerchantCreditsAsyncWithHttpInfo($wt_employee_import_records) + return $this->importMerchantCreditsAsyncWithHttpInfo($wt_employee_import_records, $contentType) ->then( function ($response) { return $response[0]; @@ -8799,14 +11117,15 @@ function ($response) { * Import merchant credits * * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importMerchantCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importMerchantCreditsAsyncWithHttpInfo($wt_employee_import_records) + public function importMerchantCreditsAsyncWithHttpInfo($wt_employee_import_records, string $contentType = self::contentTypes['importMerchantCredits'][0]) { $returnType = 'string'; - $request = $this->importMerchantCreditsRequest($wt_employee_import_records); + $request = $this->importMerchantCreditsRequest($wt_employee_import_records, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8816,6 +11135,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8845,12 +11167,14 @@ function ($exception) { * Create request for operation 'importMerchantCredits' * * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importMerchantCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function importMerchantCreditsRequest($wt_employee_import_records) + public function importMerchantCreditsRequest($wt_employee_import_records, string $contentType = self::contentTypes['importMerchantCredits'][0]) { + // verify the required parameter 'wt_employee_import_records' is set if ($wt_employee_import_records === null || (is_array($wt_employee_import_records) && count($wt_employee_import_records) === 0)) { throw new \InvalidArgumentException( @@ -8858,6 +11182,7 @@ public function importMerchantCreditsRequest($wt_employee_import_records) ); } + $resourcePath = '/v2/employee/import/merchantCredits'; $formParams = []; $queryParams = []; @@ -8869,21 +11194,17 @@ public function importMerchantCreditsRequest($wt_employee_import_records) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_import_records)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_import_records)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_import_records)); } else { $httpBody = $wt_employee_import_records; } @@ -8902,12 +11223,12 @@ public function importMerchantCreditsRequest($wt_employee_import_records) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8923,10 +11244,11 @@ public function importMerchantCreditsRequest($wt_employee_import_records) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8937,14 +11259,15 @@ public function importMerchantCreditsRequest($wt_employee_import_records) * * Retrieve employee's webpages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loadWebpagesOfEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Webpage[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function loadWebpagesOfEmployee() + public function loadWebpagesOfEmployee(string $contentType = self::contentTypes['loadWebpagesOfEmployee'][0]) { - list($response) = $this->loadWebpagesOfEmployeeWithHttpInfo(); + list($response) = $this->loadWebpagesOfEmployeeWithHttpInfo($contentType); return $response; } @@ -8953,14 +11276,15 @@ public function loadWebpagesOfEmployee() * * Retrieve employee's webpages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loadWebpagesOfEmployee'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Webpage[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function loadWebpagesOfEmployeeWithHttpInfo() + public function loadWebpagesOfEmployeeWithHttpInfo(string $contentType = self::contentTypes['loadWebpagesOfEmployee'][0]) { - $request = $this->loadWebpagesOfEmployeeRequest(); + $request = $this->loadWebpagesOfEmployeeRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -9003,6 +11327,21 @@ public function loadWebpagesOfEmployeeWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Webpage[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9015,6 +11354,21 @@ public function loadWebpagesOfEmployeeWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9027,6 +11381,21 @@ public function loadWebpagesOfEmployeeWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9039,6 +11408,21 @@ public function loadWebpagesOfEmployeeWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9053,6 +11437,21 @@ public function loadWebpagesOfEmployeeWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9105,13 +11504,14 @@ public function loadWebpagesOfEmployeeWithHttpInfo() * * Retrieve employee's webpages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loadWebpagesOfEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function loadWebpagesOfEmployeeAsync() + public function loadWebpagesOfEmployeeAsync(string $contentType = self::contentTypes['loadWebpagesOfEmployee'][0]) { - return $this->loadWebpagesOfEmployeeAsyncWithHttpInfo() + return $this->loadWebpagesOfEmployeeAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -9124,14 +11524,15 @@ function ($response) { * * Retrieve employee's webpages * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loadWebpagesOfEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function loadWebpagesOfEmployeeAsyncWithHttpInfo() + public function loadWebpagesOfEmployeeAsyncWithHttpInfo(string $contentType = self::contentTypes['loadWebpagesOfEmployee'][0]) { $returnType = '\OpenAPI\Client\Model\Webpage[]'; - $request = $this->loadWebpagesOfEmployeeRequest(); + $request = $this->loadWebpagesOfEmployeeRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9141,6 +11542,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9169,13 +11573,15 @@ function ($exception) { /** * Create request for operation 'loadWebpagesOfEmployee' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loadWebpagesOfEmployee'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function loadWebpagesOfEmployeeRequest() + public function loadWebpagesOfEmployeeRequest(string $contentType = self::contentTypes['loadWebpagesOfEmployee'][0]) { + $resourcePath = '/v2/employee/webpages/all'; $formParams = []; $queryParams = []; @@ -9187,16 +11593,11 @@ public function loadWebpagesOfEmployeeRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -9214,12 +11615,12 @@ public function loadWebpagesOfEmployeeRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -9235,10 +11636,11 @@ public function loadWebpagesOfEmployeeRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9251,14 +11653,15 @@ public function loadWebpagesOfEmployeeRequest() * * @param mixed $user_id user_id (required) * @param \OpenAPI\Client\Model\WTEmployeePeerRoles $wt_employee_peer_roles wt_employee_peer_roles (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyPeersRoles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function modifyPeersRoles($user_id, $wt_employee_peer_roles) + public function modifyPeersRoles($user_id, $wt_employee_peer_roles, string $contentType = self::contentTypes['modifyPeersRoles'][0]) { - list($response) = $this->modifyPeersRolesWithHttpInfo($user_id, $wt_employee_peer_roles); + list($response) = $this->modifyPeersRolesWithHttpInfo($user_id, $wt_employee_peer_roles, $contentType); return $response; } @@ -9269,14 +11672,15 @@ public function modifyPeersRoles($user_id, $wt_employee_peer_roles) * * @param mixed $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeePeerRoles $wt_employee_peer_roles (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyPeersRoles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function modifyPeersRolesWithHttpInfo($user_id, $wt_employee_peer_roles) + public function modifyPeersRolesWithHttpInfo($user_id, $wt_employee_peer_roles, string $contentType = self::contentTypes['modifyPeersRoles'][0]) { - $request = $this->modifyPeersRolesRequest($user_id, $wt_employee_peer_roles); + $request = $this->modifyPeersRolesRequest($user_id, $wt_employee_peer_roles, $contentType); try { $options = $this->createHttpClientOption(); @@ -9319,6 +11723,21 @@ public function modifyPeersRolesWithHttpInfo($user_id, $wt_employee_peer_roles) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9331,6 +11750,21 @@ public function modifyPeersRolesWithHttpInfo($user_id, $wt_employee_peer_roles) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9343,6 +11777,21 @@ public function modifyPeersRolesWithHttpInfo($user_id, $wt_employee_peer_roles) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9355,6 +11804,21 @@ public function modifyPeersRolesWithHttpInfo($user_id, $wt_employee_peer_roles) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9369,6 +11833,21 @@ public function modifyPeersRolesWithHttpInfo($user_id, $wt_employee_peer_roles) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9423,13 +11902,14 @@ public function modifyPeersRolesWithHttpInfo($user_id, $wt_employee_peer_roles) * * @param mixed $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeePeerRoles $wt_employee_peer_roles (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyPeersRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function modifyPeersRolesAsync($user_id, $wt_employee_peer_roles) + public function modifyPeersRolesAsync($user_id, $wt_employee_peer_roles, string $contentType = self::contentTypes['modifyPeersRoles'][0]) { - return $this->modifyPeersRolesAsyncWithHttpInfo($user_id, $wt_employee_peer_roles) + return $this->modifyPeersRolesAsyncWithHttpInfo($user_id, $wt_employee_peer_roles, $contentType) ->then( function ($response) { return $response[0]; @@ -9444,14 +11924,15 @@ function ($response) { * * @param mixed $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeePeerRoles $wt_employee_peer_roles (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyPeersRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function modifyPeersRolesAsyncWithHttpInfo($user_id, $wt_employee_peer_roles) + public function modifyPeersRolesAsyncWithHttpInfo($user_id, $wt_employee_peer_roles, string $contentType = self::contentTypes['modifyPeersRoles'][0]) { $returnType = 'mixed[]'; - $request = $this->modifyPeersRolesRequest($user_id, $wt_employee_peer_roles); + $request = $this->modifyPeersRolesRequest($user_id, $wt_employee_peer_roles, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9461,6 +11942,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9491,18 +11975,21 @@ function ($exception) { * * @param mixed $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeePeerRoles $wt_employee_peer_roles (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['modifyPeersRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function modifyPeersRolesRequest($user_id, $wt_employee_peer_roles) + public function modifyPeersRolesRequest($user_id, $wt_employee_peer_roles, string $contentType = self::contentTypes['modifyPeersRoles'][0]) { + // verify the required parameter 'user_id' is set if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $user_id when calling modifyPeersRoles' ); } + // verify the required parameter 'wt_employee_peer_roles' is set if ($wt_employee_peer_roles === null || (is_array($wt_employee_peer_roles) && count($wt_employee_peer_roles) === 0)) { throw new \InvalidArgumentException( @@ -9510,6 +11997,7 @@ public function modifyPeersRolesRequest($user_id, $wt_employee_peer_roles) ); } + $resourcePath = '/v2/employee/peer/permissions/{userID}'; $formParams = []; $queryParams = []; @@ -9529,21 +12017,17 @@ public function modifyPeersRolesRequest($user_id, $wt_employee_peer_roles) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_peer_roles)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_peer_roles)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_peer_roles)); } else { $httpBody = $wt_employee_peer_roles; } @@ -9562,12 +12046,12 @@ public function modifyPeersRolesRequest($user_id, $wt_employee_peer_roles) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -9583,10 +12067,11 @@ public function modifyPeersRolesRequest($user_id, $wt_employee_peer_roles) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9598,14 +12083,15 @@ public function modifyPeersRolesRequest($user_id, $wt_employee_peer_roles) * Presign file for upload * * @param \OpenAPI\Client\Model\WTEmployeeS3FilePresign $wt_employee_s3_file_presign wt_employee_s3_file_presign (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['presignFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PresignedPost|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function presignFile($wt_employee_s3_file_presign) + public function presignFile($wt_employee_s3_file_presign, string $contentType = self::contentTypes['presignFile'][0]) { - list($response) = $this->presignFileWithHttpInfo($wt_employee_s3_file_presign); + list($response) = $this->presignFileWithHttpInfo($wt_employee_s3_file_presign, $contentType); return $response; } @@ -9615,14 +12101,15 @@ public function presignFile($wt_employee_s3_file_presign) * Presign file for upload * * @param \OpenAPI\Client\Model\WTEmployeeS3FilePresign $wt_employee_s3_file_presign (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['presignFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PresignedPost|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function presignFileWithHttpInfo($wt_employee_s3_file_presign) + public function presignFileWithHttpInfo($wt_employee_s3_file_presign, string $contentType = self::contentTypes['presignFile'][0]) { - $request = $this->presignFileRequest($wt_employee_s3_file_presign); + $request = $this->presignFileRequest($wt_employee_s3_file_presign, $contentType); try { $options = $this->createHttpClientOption(); @@ -9665,6 +12152,21 @@ public function presignFileWithHttpInfo($wt_employee_s3_file_presign) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PresignedPost' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9677,6 +12179,21 @@ public function presignFileWithHttpInfo($wt_employee_s3_file_presign) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9689,6 +12206,21 @@ public function presignFileWithHttpInfo($wt_employee_s3_file_presign) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9701,6 +12233,21 @@ public function presignFileWithHttpInfo($wt_employee_s3_file_presign) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9715,6 +12262,21 @@ public function presignFileWithHttpInfo($wt_employee_s3_file_presign) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9768,13 +12330,14 @@ public function presignFileWithHttpInfo($wt_employee_s3_file_presign) * Presign file for upload * * @param \OpenAPI\Client\Model\WTEmployeeS3FilePresign $wt_employee_s3_file_presign (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['presignFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function presignFileAsync($wt_employee_s3_file_presign) + public function presignFileAsync($wt_employee_s3_file_presign, string $contentType = self::contentTypes['presignFile'][0]) { - return $this->presignFileAsyncWithHttpInfo($wt_employee_s3_file_presign) + return $this->presignFileAsyncWithHttpInfo($wt_employee_s3_file_presign, $contentType) ->then( function ($response) { return $response[0]; @@ -9788,14 +12351,15 @@ function ($response) { * Presign file for upload * * @param \OpenAPI\Client\Model\WTEmployeeS3FilePresign $wt_employee_s3_file_presign (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['presignFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function presignFileAsyncWithHttpInfo($wt_employee_s3_file_presign) + public function presignFileAsyncWithHttpInfo($wt_employee_s3_file_presign, string $contentType = self::contentTypes['presignFile'][0]) { $returnType = '\OpenAPI\Client\Model\PresignedPost'; - $request = $this->presignFileRequest($wt_employee_s3_file_presign); + $request = $this->presignFileRequest($wt_employee_s3_file_presign, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9805,6 +12369,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9834,12 +12401,14 @@ function ($exception) { * Create request for operation 'presignFile' * * @param \OpenAPI\Client\Model\WTEmployeeS3FilePresign $wt_employee_s3_file_presign (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['presignFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function presignFileRequest($wt_employee_s3_file_presign) + public function presignFileRequest($wt_employee_s3_file_presign, string $contentType = self::contentTypes['presignFile'][0]) { + // verify the required parameter 'wt_employee_s3_file_presign' is set if ($wt_employee_s3_file_presign === null || (is_array($wt_employee_s3_file_presign) && count($wt_employee_s3_file_presign) === 0)) { throw new \InvalidArgumentException( @@ -9847,6 +12416,7 @@ public function presignFileRequest($wt_employee_s3_file_presign) ); } + $resourcePath = '/v2/employee/file/presign'; $formParams = []; $queryParams = []; @@ -9858,21 +12428,17 @@ public function presignFileRequest($wt_employee_s3_file_presign) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_s3_file_presign)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_s3_file_presign)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_s3_file_presign)); } else { $httpBody = $wt_employee_s3_file_presign; } @@ -9891,12 +12457,12 @@ public function presignFileRequest($wt_employee_s3_file_presign) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -9912,10 +12478,11 @@ public function presignFileRequest($wt_employee_s3_file_presign) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9927,14 +12494,15 @@ public function presignFileRequest($wt_employee_s3_file_presign) * Remove peer from all roles * * @param mixed $user_id user_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePeerFromAllRoles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function removePeerFromAllRoles($user_id) + public function removePeerFromAllRoles($user_id, string $contentType = self::contentTypes['removePeerFromAllRoles'][0]) { - list($response) = $this->removePeerFromAllRolesWithHttpInfo($user_id); + list($response) = $this->removePeerFromAllRolesWithHttpInfo($user_id, $contentType); return $response; } @@ -9944,14 +12512,15 @@ public function removePeerFromAllRoles($user_id) * Remove peer from all roles * * @param mixed $user_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePeerFromAllRoles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function removePeerFromAllRolesWithHttpInfo($user_id) + public function removePeerFromAllRolesWithHttpInfo($user_id, string $contentType = self::contentTypes['removePeerFromAllRoles'][0]) { - $request = $this->removePeerFromAllRolesRequest($user_id); + $request = $this->removePeerFromAllRolesRequest($user_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -9994,6 +12563,21 @@ public function removePeerFromAllRolesWithHttpInfo($user_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10006,6 +12590,21 @@ public function removePeerFromAllRolesWithHttpInfo($user_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10018,6 +12617,21 @@ public function removePeerFromAllRolesWithHttpInfo($user_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10030,6 +12644,21 @@ public function removePeerFromAllRolesWithHttpInfo($user_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10044,6 +12673,21 @@ public function removePeerFromAllRolesWithHttpInfo($user_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10097,13 +12741,14 @@ public function removePeerFromAllRolesWithHttpInfo($user_id) * Remove peer from all roles * * @param mixed $user_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePeerFromAllRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removePeerFromAllRolesAsync($user_id) + public function removePeerFromAllRolesAsync($user_id, string $contentType = self::contentTypes['removePeerFromAllRoles'][0]) { - return $this->removePeerFromAllRolesAsyncWithHttpInfo($user_id) + return $this->removePeerFromAllRolesAsyncWithHttpInfo($user_id, $contentType) ->then( function ($response) { return $response[0]; @@ -10117,14 +12762,15 @@ function ($response) { * Remove peer from all roles * * @param mixed $user_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePeerFromAllRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removePeerFromAllRolesAsyncWithHttpInfo($user_id) + public function removePeerFromAllRolesAsyncWithHttpInfo($user_id, string $contentType = self::contentTypes['removePeerFromAllRoles'][0]) { $returnType = 'bool'; - $request = $this->removePeerFromAllRolesRequest($user_id); + $request = $this->removePeerFromAllRolesRequest($user_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10134,6 +12780,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10163,12 +12812,14 @@ function ($exception) { * Create request for operation 'removePeerFromAllRoles' * * @param mixed $user_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removePeerFromAllRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function removePeerFromAllRolesRequest($user_id) + public function removePeerFromAllRolesRequest($user_id, string $contentType = self::contentTypes['removePeerFromAllRoles'][0]) { + // verify the required parameter 'user_id' is set if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { throw new \InvalidArgumentException( @@ -10176,6 +12827,7 @@ public function removePeerFromAllRolesRequest($user_id) ); } + $resourcePath = '/v2/employee/peer/permissions/{userID}'; $formParams = []; $queryParams = []; @@ -10195,16 +12847,11 @@ public function removePeerFromAllRolesRequest($user_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -10222,12 +12869,12 @@ public function removePeerFromAllRolesRequest($user_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -10243,10 +12890,11 @@ public function removePeerFromAllRolesRequest($user_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -10259,14 +12907,15 @@ public function removePeerFromAllRolesRequest($user_id) * * @param mixed $advertisement_credit_id advertisement_credit_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleAdvertisementCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\AdvertisementCreditBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function scheduleAdvertisementCredit($advertisement_credit_id, $wt_employee_schedule_simple_sms) + public function scheduleAdvertisementCredit($advertisement_credit_id, $wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleAdvertisementCredit'][0]) { - list($response) = $this->scheduleAdvertisementCreditWithHttpInfo($advertisement_credit_id, $wt_employee_schedule_simple_sms); + list($response) = $this->scheduleAdvertisementCreditWithHttpInfo($advertisement_credit_id, $wt_employee_schedule_simple_sms, $contentType); return $response; } @@ -10277,14 +12926,15 @@ public function scheduleAdvertisementCredit($advertisement_credit_id, $wt_employ * * @param mixed $advertisement_credit_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleAdvertisementCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\AdvertisementCreditBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function scheduleAdvertisementCreditWithHttpInfo($advertisement_credit_id, $wt_employee_schedule_simple_sms) + public function scheduleAdvertisementCreditWithHttpInfo($advertisement_credit_id, $wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleAdvertisementCredit'][0]) { - $request = $this->scheduleAdvertisementCreditRequest($advertisement_credit_id, $wt_employee_schedule_simple_sms); + $request = $this->scheduleAdvertisementCreditRequest($advertisement_credit_id, $wt_employee_schedule_simple_sms, $contentType); try { $options = $this->createHttpClientOption(); @@ -10327,6 +12977,21 @@ public function scheduleAdvertisementCreditWithHttpInfo($advertisement_credit_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AdvertisementCreditBroadcast' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10339,6 +13004,21 @@ public function scheduleAdvertisementCreditWithHttpInfo($advertisement_credit_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10351,6 +13031,21 @@ public function scheduleAdvertisementCreditWithHttpInfo($advertisement_credit_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EntityTooLarge' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10363,6 +13058,21 @@ public function scheduleAdvertisementCreditWithHttpInfo($advertisement_credit_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10375,6 +13085,21 @@ public function scheduleAdvertisementCreditWithHttpInfo($advertisement_credit_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10389,6 +13114,21 @@ public function scheduleAdvertisementCreditWithHttpInfo($advertisement_credit_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10451,13 +13191,14 @@ public function scheduleAdvertisementCreditWithHttpInfo($advertisement_credit_id * * @param mixed $advertisement_credit_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function scheduleAdvertisementCreditAsync($advertisement_credit_id, $wt_employee_schedule_simple_sms) + public function scheduleAdvertisementCreditAsync($advertisement_credit_id, $wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleAdvertisementCredit'][0]) { - return $this->scheduleAdvertisementCreditAsyncWithHttpInfo($advertisement_credit_id, $wt_employee_schedule_simple_sms) + return $this->scheduleAdvertisementCreditAsyncWithHttpInfo($advertisement_credit_id, $wt_employee_schedule_simple_sms, $contentType) ->then( function ($response) { return $response[0]; @@ -10472,14 +13213,15 @@ function ($response) { * * @param mixed $advertisement_credit_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function scheduleAdvertisementCreditAsyncWithHttpInfo($advertisement_credit_id, $wt_employee_schedule_simple_sms) + public function scheduleAdvertisementCreditAsyncWithHttpInfo($advertisement_credit_id, $wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleAdvertisementCredit'][0]) { $returnType = '\OpenAPI\Client\Model\AdvertisementCreditBroadcast'; - $request = $this->scheduleAdvertisementCreditRequest($advertisement_credit_id, $wt_employee_schedule_simple_sms); + $request = $this->scheduleAdvertisementCreditRequest($advertisement_credit_id, $wt_employee_schedule_simple_sms, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10489,6 +13231,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10519,18 +13264,21 @@ function ($exception) { * * @param mixed $advertisement_credit_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleAdvertisementCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function scheduleAdvertisementCreditRequest($advertisement_credit_id, $wt_employee_schedule_simple_sms) + public function scheduleAdvertisementCreditRequest($advertisement_credit_id, $wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleAdvertisementCredit'][0]) { + // verify the required parameter 'advertisement_credit_id' is set if ($advertisement_credit_id === null || (is_array($advertisement_credit_id) && count($advertisement_credit_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $advertisement_credit_id when calling scheduleAdvertisementCredit' ); } + // verify the required parameter 'wt_employee_schedule_simple_sms' is set if ($wt_employee_schedule_simple_sms === null || (is_array($wt_employee_schedule_simple_sms) && count($wt_employee_schedule_simple_sms) === 0)) { throw new \InvalidArgumentException( @@ -10538,6 +13286,7 @@ public function scheduleAdvertisementCreditRequest($advertisement_credit_id, $wt ); } + $resourcePath = '/v2/employee/sms/schedule/adCredit/{advertisementCreditID}'; $formParams = []; $queryParams = []; @@ -10557,21 +13306,17 @@ public function scheduleAdvertisementCreditRequest($advertisement_credit_id, $wt } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_schedule_simple_sms)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_simple_sms)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_simple_sms)); } else { $httpBody = $wt_employee_schedule_simple_sms; } @@ -10590,12 +13335,12 @@ public function scheduleAdvertisementCreditRequest($advertisement_credit_id, $wt // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -10611,10 +13356,11 @@ public function scheduleAdvertisementCreditRequest($advertisement_credit_id, $wt $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -10627,14 +13373,15 @@ public function scheduleAdvertisementCreditRequest($advertisement_credit_id, $wt * * @param mixed $dynamic_voucher_id dynamic_voucher_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDynamicVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DynamicVoucherBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function scheduleDynamicVoucher($dynamic_voucher_id, $wt_employee_schedule_simple_sms) + public function scheduleDynamicVoucher($dynamic_voucher_id, $wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleDynamicVoucher'][0]) { - list($response) = $this->scheduleDynamicVoucherWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_sms); + list($response) = $this->scheduleDynamicVoucherWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_sms, $contentType); return $response; } @@ -10645,14 +13392,15 @@ public function scheduleDynamicVoucher($dynamic_voucher_id, $wt_employee_schedul * * @param mixed $dynamic_voucher_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDynamicVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DynamicVoucherBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function scheduleDynamicVoucherWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_sms) + public function scheduleDynamicVoucherWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleDynamicVoucher'][0]) { - $request = $this->scheduleDynamicVoucherRequest($dynamic_voucher_id, $wt_employee_schedule_simple_sms); + $request = $this->scheduleDynamicVoucherRequest($dynamic_voucher_id, $wt_employee_schedule_simple_sms, $contentType); try { $options = $this->createHttpClientOption(); @@ -10695,6 +13443,21 @@ public function scheduleDynamicVoucherWithHttpInfo($dynamic_voucher_id, $wt_empl $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DynamicVoucherBroadcast' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10707,6 +13470,21 @@ public function scheduleDynamicVoucherWithHttpInfo($dynamic_voucher_id, $wt_empl $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10719,6 +13497,21 @@ public function scheduleDynamicVoucherWithHttpInfo($dynamic_voucher_id, $wt_empl $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EntityTooLarge' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10731,6 +13524,21 @@ public function scheduleDynamicVoucherWithHttpInfo($dynamic_voucher_id, $wt_empl $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10743,6 +13551,21 @@ public function scheduleDynamicVoucherWithHttpInfo($dynamic_voucher_id, $wt_empl $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10757,6 +13580,21 @@ public function scheduleDynamicVoucherWithHttpInfo($dynamic_voucher_id, $wt_empl $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10819,13 +13657,14 @@ public function scheduleDynamicVoucherWithHttpInfo($dynamic_voucher_id, $wt_empl * * @param mixed $dynamic_voucher_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function scheduleDynamicVoucherAsync($dynamic_voucher_id, $wt_employee_schedule_simple_sms) + public function scheduleDynamicVoucherAsync($dynamic_voucher_id, $wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleDynamicVoucher'][0]) { - return $this->scheduleDynamicVoucherAsyncWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_sms) + return $this->scheduleDynamicVoucherAsyncWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_sms, $contentType) ->then( function ($response) { return $response[0]; @@ -10840,14 +13679,15 @@ function ($response) { * * @param mixed $dynamic_voucher_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function scheduleDynamicVoucherAsyncWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_sms) + public function scheduleDynamicVoucherAsyncWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleDynamicVoucher'][0]) { $returnType = '\OpenAPI\Client\Model\DynamicVoucherBroadcast'; - $request = $this->scheduleDynamicVoucherRequest($dynamic_voucher_id, $wt_employee_schedule_simple_sms); + $request = $this->scheduleDynamicVoucherRequest($dynamic_voucher_id, $wt_employee_schedule_simple_sms, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10857,6 +13697,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10887,18 +13730,21 @@ function ($exception) { * * @param mixed $dynamic_voucher_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDynamicVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function scheduleDynamicVoucherRequest($dynamic_voucher_id, $wt_employee_schedule_simple_sms) + public function scheduleDynamicVoucherRequest($dynamic_voucher_id, $wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleDynamicVoucher'][0]) { + // verify the required parameter 'dynamic_voucher_id' is set if ($dynamic_voucher_id === null || (is_array($dynamic_voucher_id) && count($dynamic_voucher_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $dynamic_voucher_id when calling scheduleDynamicVoucher' ); } + // verify the required parameter 'wt_employee_schedule_simple_sms' is set if ($wt_employee_schedule_simple_sms === null || (is_array($wt_employee_schedule_simple_sms) && count($wt_employee_schedule_simple_sms) === 0)) { throw new \InvalidArgumentException( @@ -10906,6 +13752,7 @@ public function scheduleDynamicVoucherRequest($dynamic_voucher_id, $wt_employee_ ); } + $resourcePath = '/v2/employee/sms/schedule/dynamicVoucher/{dynamicVoucherID}'; $formParams = []; $queryParams = []; @@ -10925,21 +13772,17 @@ public function scheduleDynamicVoucherRequest($dynamic_voucher_id, $wt_employee_ } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_schedule_simple_sms)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_simple_sms)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_simple_sms)); } else { $httpBody = $wt_employee_schedule_simple_sms; } @@ -10958,12 +13801,12 @@ public function scheduleDynamicVoucherRequest($dynamic_voucher_id, $wt_employee_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -10979,10 +13822,11 @@ public function scheduleDynamicVoucherRequest($dynamic_voucher_id, $wt_employee_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -10995,14 +13839,15 @@ public function scheduleDynamicVoucherRequest($dynamic_voucher_id, $wt_employee_ * * @param mixed $dynamic_voucher_id dynamic_voucher_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient $wt_employee_schedule_simple_smsto_recipient wt_employee_schedule_simple_smsto_recipient (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDynamicVoucherToRecipient'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DynamicVoucherBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function scheduleDynamicVoucherToRecipient($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient) + public function scheduleDynamicVoucherToRecipient($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient, string $contentType = self::contentTypes['scheduleDynamicVoucherToRecipient'][0]) { - list($response) = $this->scheduleDynamicVoucherToRecipientWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient); + list($response) = $this->scheduleDynamicVoucherToRecipientWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient, $contentType); return $response; } @@ -11013,14 +13858,15 @@ public function scheduleDynamicVoucherToRecipient($dynamic_voucher_id, $wt_emplo * * @param mixed $dynamic_voucher_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient $wt_employee_schedule_simple_smsto_recipient (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDynamicVoucherToRecipient'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DynamicVoucherBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function scheduleDynamicVoucherToRecipientWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient) + public function scheduleDynamicVoucherToRecipientWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient, string $contentType = self::contentTypes['scheduleDynamicVoucherToRecipient'][0]) { - $request = $this->scheduleDynamicVoucherToRecipientRequest($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient); + $request = $this->scheduleDynamicVoucherToRecipientRequest($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient, $contentType); try { $options = $this->createHttpClientOption(); @@ -11063,6 +13909,21 @@ public function scheduleDynamicVoucherToRecipientWithHttpInfo($dynamic_voucher_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DynamicVoucherBroadcast' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11075,6 +13936,21 @@ public function scheduleDynamicVoucherToRecipientWithHttpInfo($dynamic_voucher_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11087,6 +13963,21 @@ public function scheduleDynamicVoucherToRecipientWithHttpInfo($dynamic_voucher_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EntityTooLarge' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11099,6 +13990,21 @@ public function scheduleDynamicVoucherToRecipientWithHttpInfo($dynamic_voucher_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11111,6 +14017,21 @@ public function scheduleDynamicVoucherToRecipientWithHttpInfo($dynamic_voucher_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11125,6 +14046,21 @@ public function scheduleDynamicVoucherToRecipientWithHttpInfo($dynamic_voucher_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11187,13 +14123,14 @@ public function scheduleDynamicVoucherToRecipientWithHttpInfo($dynamic_voucher_i * * @param mixed $dynamic_voucher_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient $wt_employee_schedule_simple_smsto_recipient (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDynamicVoucherToRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function scheduleDynamicVoucherToRecipientAsync($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient) + public function scheduleDynamicVoucherToRecipientAsync($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient, string $contentType = self::contentTypes['scheduleDynamicVoucherToRecipient'][0]) { - return $this->scheduleDynamicVoucherToRecipientAsyncWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient) + return $this->scheduleDynamicVoucherToRecipientAsyncWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient, $contentType) ->then( function ($response) { return $response[0]; @@ -11208,14 +14145,15 @@ function ($response) { * * @param mixed $dynamic_voucher_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient $wt_employee_schedule_simple_smsto_recipient (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDynamicVoucherToRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function scheduleDynamicVoucherToRecipientAsyncWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient) + public function scheduleDynamicVoucherToRecipientAsyncWithHttpInfo($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient, string $contentType = self::contentTypes['scheduleDynamicVoucherToRecipient'][0]) { $returnType = '\OpenAPI\Client\Model\DynamicVoucherBroadcast'; - $request = $this->scheduleDynamicVoucherToRecipientRequest($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient); + $request = $this->scheduleDynamicVoucherToRecipientRequest($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11225,6 +14163,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -11255,18 +14196,21 @@ function ($exception) { * * @param mixed $dynamic_voucher_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient $wt_employee_schedule_simple_smsto_recipient (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleDynamicVoucherToRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function scheduleDynamicVoucherToRecipientRequest($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient) + public function scheduleDynamicVoucherToRecipientRequest($dynamic_voucher_id, $wt_employee_schedule_simple_smsto_recipient, string $contentType = self::contentTypes['scheduleDynamicVoucherToRecipient'][0]) { + // verify the required parameter 'dynamic_voucher_id' is set if ($dynamic_voucher_id === null || (is_array($dynamic_voucher_id) && count($dynamic_voucher_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $dynamic_voucher_id when calling scheduleDynamicVoucherToRecipient' ); } + // verify the required parameter 'wt_employee_schedule_simple_smsto_recipient' is set if ($wt_employee_schedule_simple_smsto_recipient === null || (is_array($wt_employee_schedule_simple_smsto_recipient) && count($wt_employee_schedule_simple_smsto_recipient) === 0)) { throw new \InvalidArgumentException( @@ -11274,6 +14218,7 @@ public function scheduleDynamicVoucherToRecipientRequest($dynamic_voucher_id, $w ); } + $resourcePath = '/v2/employee/sms/schedule/recipient/dynamicVoucher/{dynamicVoucherID}'; $formParams = []; $queryParams = []; @@ -11293,21 +14238,17 @@ public function scheduleDynamicVoucherToRecipientRequest($dynamic_voucher_id, $w } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_schedule_simple_smsto_recipient)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_simple_smsto_recipient)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_simple_smsto_recipient)); } else { $httpBody = $wt_employee_schedule_simple_smsto_recipient; } @@ -11326,12 +14267,12 @@ public function scheduleDynamicVoucherToRecipientRequest($dynamic_voucher_id, $w // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -11347,10 +14288,11 @@ public function scheduleDynamicVoucherToRecipientRequest($dynamic_voucher_id, $w $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -11362,14 +14304,15 @@ public function scheduleDynamicVoucherToRecipientRequest($dynamic_voucher_id, $w * Schedule Simple SMS broadcast to list * * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleSimpleSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SimpleSMSBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function scheduleSimpleSMS($wt_employee_schedule_simple_sms) + public function scheduleSimpleSMS($wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleSimpleSMS'][0]) { - list($response) = $this->scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms); + list($response) = $this->scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms, $contentType); return $response; } @@ -11379,14 +14322,15 @@ public function scheduleSimpleSMS($wt_employee_schedule_simple_sms) * Schedule Simple SMS broadcast to list * * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleSimpleSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SimpleSMSBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms) + public function scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleSimpleSMS'][0]) { - $request = $this->scheduleSimpleSMSRequest($wt_employee_schedule_simple_sms); + $request = $this->scheduleSimpleSMSRequest($wt_employee_schedule_simple_sms, $contentType); try { $options = $this->createHttpClientOption(); @@ -11425,14 +14369,29 @@ public function scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms) switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SimpleSMSBroadcast' === '\SplFileObject') { + if ('bool' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SimpleSMSBroadcast', []), + ObjectSerializer::deserialize($content, 'bool', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11441,6 +14400,21 @@ public function scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11453,6 +14427,21 @@ public function scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EntityTooLarge' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11465,6 +14454,21 @@ public function scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11477,6 +14481,21 @@ public function scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11486,11 +14505,26 @@ public function scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms) ]; } - $returnType = '\OpenAPI\Client\Model\SimpleSMSBroadcast'; + $returnType = 'bool'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11504,7 +14538,7 @@ public function scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SimpleSMSBroadcast', + 'bool', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11552,13 +14586,14 @@ public function scheduleSimpleSMSWithHttpInfo($wt_employee_schedule_simple_sms) * Schedule Simple SMS broadcast to list * * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleSimpleSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function scheduleSimpleSMSAsync($wt_employee_schedule_simple_sms) + public function scheduleSimpleSMSAsync($wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleSimpleSMS'][0]) { - return $this->scheduleSimpleSMSAsyncWithHttpInfo($wt_employee_schedule_simple_sms) + return $this->scheduleSimpleSMSAsyncWithHttpInfo($wt_employee_schedule_simple_sms, $contentType) ->then( function ($response) { return $response[0]; @@ -11572,14 +14607,15 @@ function ($response) { * Schedule Simple SMS broadcast to list * * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleSimpleSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function scheduleSimpleSMSAsyncWithHttpInfo($wt_employee_schedule_simple_sms) + public function scheduleSimpleSMSAsyncWithHttpInfo($wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleSimpleSMS'][0]) { - $returnType = '\OpenAPI\Client\Model\SimpleSMSBroadcast'; - $request = $this->scheduleSimpleSMSRequest($wt_employee_schedule_simple_sms); + $returnType = 'bool'; + $request = $this->scheduleSimpleSMSRequest($wt_employee_schedule_simple_sms, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11589,6 +14625,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -11618,12 +14657,14 @@ function ($exception) { * Create request for operation 'scheduleSimpleSMS' * * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMS $wt_employee_schedule_simple_sms (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleSimpleSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function scheduleSimpleSMSRequest($wt_employee_schedule_simple_sms) + public function scheduleSimpleSMSRequest($wt_employee_schedule_simple_sms, string $contentType = self::contentTypes['scheduleSimpleSMS'][0]) { + // verify the required parameter 'wt_employee_schedule_simple_sms' is set if ($wt_employee_schedule_simple_sms === null || (is_array($wt_employee_schedule_simple_sms) && count($wt_employee_schedule_simple_sms) === 0)) { throw new \InvalidArgumentException( @@ -11631,6 +14672,7 @@ public function scheduleSimpleSMSRequest($wt_employee_schedule_simple_sms) ); } + $resourcePath = '/v2/employee/sms/schedule/simple'; $formParams = []; $queryParams = []; @@ -11642,21 +14684,17 @@ public function scheduleSimpleSMSRequest($wt_employee_schedule_simple_sms) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_schedule_simple_sms)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_simple_sms)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_simple_sms)); } else { $httpBody = $wt_employee_schedule_simple_sms; } @@ -11675,12 +14713,12 @@ public function scheduleSimpleSMSRequest($wt_employee_schedule_simple_sms) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -11696,10 +14734,11 @@ public function scheduleSimpleSMSRequest($wt_employee_schedule_simple_sms) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -11711,14 +14750,15 @@ public function scheduleSimpleSMSRequest($wt_employee_schedule_simple_sms) * Schedule Simple SMS broadcast to recipient * * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient $wt_employee_schedule_simple_smsto_recipient wt_employee_schedule_simple_smsto_recipient (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleSimpleSMSToRecipient'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\SimpleSMSBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function scheduleSimpleSMSToRecipient($wt_employee_schedule_simple_smsto_recipient) + public function scheduleSimpleSMSToRecipient($wt_employee_schedule_simple_smsto_recipient, string $contentType = self::contentTypes['scheduleSimpleSMSToRecipient'][0]) { - list($response) = $this->scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_simple_smsto_recipient); + list($response) = $this->scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_simple_smsto_recipient, $contentType); return $response; } @@ -11728,14 +14768,15 @@ public function scheduleSimpleSMSToRecipient($wt_employee_schedule_simple_smsto_ * Schedule Simple SMS broadcast to recipient * * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient $wt_employee_schedule_simple_smsto_recipient (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleSimpleSMSToRecipient'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\SimpleSMSBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_simple_smsto_recipient) + public function scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_simple_smsto_recipient, string $contentType = self::contentTypes['scheduleSimpleSMSToRecipient'][0]) { - $request = $this->scheduleSimpleSMSToRecipientRequest($wt_employee_schedule_simple_smsto_recipient); + $request = $this->scheduleSimpleSMSToRecipientRequest($wt_employee_schedule_simple_smsto_recipient, $contentType); try { $options = $this->createHttpClientOption(); @@ -11774,14 +14815,29 @@ public function scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_s switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\SimpleSMSBroadcast' === '\SplFileObject') { + if ('bool' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SimpleSMSBroadcast', []), + ObjectSerializer::deserialize($content, 'bool', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11790,6 +14846,21 @@ public function scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11802,6 +14873,21 @@ public function scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EntityTooLarge' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11814,6 +14900,21 @@ public function scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11826,6 +14927,21 @@ public function scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11835,11 +14951,26 @@ public function scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_s ]; } - $returnType = '\OpenAPI\Client\Model\SimpleSMSBroadcast'; + $returnType = 'bool'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11853,7 +14984,7 @@ public function scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_s case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\SimpleSMSBroadcast', + 'bool', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11901,13 +15032,14 @@ public function scheduleSimpleSMSToRecipientWithHttpInfo($wt_employee_schedule_s * Schedule Simple SMS broadcast to recipient * * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient $wt_employee_schedule_simple_smsto_recipient (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleSimpleSMSToRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function scheduleSimpleSMSToRecipientAsync($wt_employee_schedule_simple_smsto_recipient) + public function scheduleSimpleSMSToRecipientAsync($wt_employee_schedule_simple_smsto_recipient, string $contentType = self::contentTypes['scheduleSimpleSMSToRecipient'][0]) { - return $this->scheduleSimpleSMSToRecipientAsyncWithHttpInfo($wt_employee_schedule_simple_smsto_recipient) + return $this->scheduleSimpleSMSToRecipientAsyncWithHttpInfo($wt_employee_schedule_simple_smsto_recipient, $contentType) ->then( function ($response) { return $response[0]; @@ -11921,14 +15053,15 @@ function ($response) { * Schedule Simple SMS broadcast to recipient * * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient $wt_employee_schedule_simple_smsto_recipient (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleSimpleSMSToRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function scheduleSimpleSMSToRecipientAsyncWithHttpInfo($wt_employee_schedule_simple_smsto_recipient) + public function scheduleSimpleSMSToRecipientAsyncWithHttpInfo($wt_employee_schedule_simple_smsto_recipient, string $contentType = self::contentTypes['scheduleSimpleSMSToRecipient'][0]) { - $returnType = '\OpenAPI\Client\Model\SimpleSMSBroadcast'; - $request = $this->scheduleSimpleSMSToRecipientRequest($wt_employee_schedule_simple_smsto_recipient); + $returnType = 'bool'; + $request = $this->scheduleSimpleSMSToRecipientRequest($wt_employee_schedule_simple_smsto_recipient, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11938,6 +15071,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -11967,12 +15103,14 @@ function ($exception) { * Create request for operation 'scheduleSimpleSMSToRecipient' * * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSToRecipient $wt_employee_schedule_simple_smsto_recipient (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleSimpleSMSToRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function scheduleSimpleSMSToRecipientRequest($wt_employee_schedule_simple_smsto_recipient) + public function scheduleSimpleSMSToRecipientRequest($wt_employee_schedule_simple_smsto_recipient, string $contentType = self::contentTypes['scheduleSimpleSMSToRecipient'][0]) { + // verify the required parameter 'wt_employee_schedule_simple_smsto_recipient' is set if ($wt_employee_schedule_simple_smsto_recipient === null || (is_array($wt_employee_schedule_simple_smsto_recipient) && count($wt_employee_schedule_simple_smsto_recipient) === 0)) { throw new \InvalidArgumentException( @@ -11980,6 +15118,7 @@ public function scheduleSimpleSMSToRecipientRequest($wt_employee_schedule_simple ); } + $resourcePath = '/v2/employee/sms/schedule/recipient/simple'; $formParams = []; $queryParams = []; @@ -11991,21 +15130,17 @@ public function scheduleSimpleSMSToRecipientRequest($wt_employee_schedule_simple - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_schedule_simple_smsto_recipient)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_simple_smsto_recipient)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_simple_smsto_recipient)); } else { $httpBody = $wt_employee_schedule_simple_smsto_recipient; } @@ -12024,12 +15159,12 @@ public function scheduleSimpleSMSToRecipientRequest($wt_employee_schedule_simple // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -12045,10 +15180,11 @@ public function scheduleSimpleSMSToRecipientRequest($wt_employee_schedule_simple $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -12060,14 +15196,15 @@ public function scheduleSimpleSMSToRecipientRequest($wt_employee_schedule_simple * Send help desk response * * @param \OpenAPI\Client\Model\WTEmployeeSendHelpDeskResponse $wt_employee_send_help_desk_response wt_employee_send_help_desk_response (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendHelpDeskResponse'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OutboundSMS|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function sendHelpDeskResponse($wt_employee_send_help_desk_response) + public function sendHelpDeskResponse($wt_employee_send_help_desk_response, string $contentType = self::contentTypes['sendHelpDeskResponse'][0]) { - list($response) = $this->sendHelpDeskResponseWithHttpInfo($wt_employee_send_help_desk_response); + list($response) = $this->sendHelpDeskResponseWithHttpInfo($wt_employee_send_help_desk_response, $contentType); return $response; } @@ -12077,14 +15214,15 @@ public function sendHelpDeskResponse($wt_employee_send_help_desk_response) * Send help desk response * * @param \OpenAPI\Client\Model\WTEmployeeSendHelpDeskResponse $wt_employee_send_help_desk_response (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendHelpDeskResponse'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OutboundSMS|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function sendHelpDeskResponseWithHttpInfo($wt_employee_send_help_desk_response) + public function sendHelpDeskResponseWithHttpInfo($wt_employee_send_help_desk_response, string $contentType = self::contentTypes['sendHelpDeskResponse'][0]) { - $request = $this->sendHelpDeskResponseRequest($wt_employee_send_help_desk_response); + $request = $this->sendHelpDeskResponseRequest($wt_employee_send_help_desk_response, $contentType); try { $options = $this->createHttpClientOption(); @@ -12127,6 +15265,21 @@ public function sendHelpDeskResponseWithHttpInfo($wt_employee_send_help_desk_res $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OutboundSMS' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12139,6 +15292,21 @@ public function sendHelpDeskResponseWithHttpInfo($wt_employee_send_help_desk_res $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12151,6 +15319,21 @@ public function sendHelpDeskResponseWithHttpInfo($wt_employee_send_help_desk_res $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12163,6 +15346,21 @@ public function sendHelpDeskResponseWithHttpInfo($wt_employee_send_help_desk_res $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12177,6 +15375,21 @@ public function sendHelpDeskResponseWithHttpInfo($wt_employee_send_help_desk_res $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12230,13 +15443,14 @@ public function sendHelpDeskResponseWithHttpInfo($wt_employee_send_help_desk_res * Send help desk response * * @param \OpenAPI\Client\Model\WTEmployeeSendHelpDeskResponse $wt_employee_send_help_desk_response (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendHelpDeskResponse'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendHelpDeskResponseAsync($wt_employee_send_help_desk_response) + public function sendHelpDeskResponseAsync($wt_employee_send_help_desk_response, string $contentType = self::contentTypes['sendHelpDeskResponse'][0]) { - return $this->sendHelpDeskResponseAsyncWithHttpInfo($wt_employee_send_help_desk_response) + return $this->sendHelpDeskResponseAsyncWithHttpInfo($wt_employee_send_help_desk_response, $contentType) ->then( function ($response) { return $response[0]; @@ -12250,14 +15464,15 @@ function ($response) { * Send help desk response * * @param \OpenAPI\Client\Model\WTEmployeeSendHelpDeskResponse $wt_employee_send_help_desk_response (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendHelpDeskResponse'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendHelpDeskResponseAsyncWithHttpInfo($wt_employee_send_help_desk_response) + public function sendHelpDeskResponseAsyncWithHttpInfo($wt_employee_send_help_desk_response, string $contentType = self::contentTypes['sendHelpDeskResponse'][0]) { $returnType = '\OpenAPI\Client\Model\OutboundSMS'; - $request = $this->sendHelpDeskResponseRequest($wt_employee_send_help_desk_response); + $request = $this->sendHelpDeskResponseRequest($wt_employee_send_help_desk_response, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12267,6 +15482,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -12296,12 +15514,14 @@ function ($exception) { * Create request for operation 'sendHelpDeskResponse' * * @param \OpenAPI\Client\Model\WTEmployeeSendHelpDeskResponse $wt_employee_send_help_desk_response (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendHelpDeskResponse'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendHelpDeskResponseRequest($wt_employee_send_help_desk_response) + public function sendHelpDeskResponseRequest($wt_employee_send_help_desk_response, string $contentType = self::contentTypes['sendHelpDeskResponse'][0]) { + // verify the required parameter 'wt_employee_send_help_desk_response' is set if ($wt_employee_send_help_desk_response === null || (is_array($wt_employee_send_help_desk_response) && count($wt_employee_send_help_desk_response) === 0)) { throw new \InvalidArgumentException( @@ -12309,6 +15529,7 @@ public function sendHelpDeskResponseRequest($wt_employee_send_help_desk_response ); } + $resourcePath = '/v2/employee/helpDesk/response'; $formParams = []; $queryParams = []; @@ -12320,21 +15541,17 @@ public function sendHelpDeskResponseRequest($wt_employee_send_help_desk_response - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_send_help_desk_response)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_send_help_desk_response)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_send_help_desk_response)); } else { $httpBody = $wt_employee_send_help_desk_response; } @@ -12353,12 +15570,12 @@ public function sendHelpDeskResponseRequest($wt_employee_send_help_desk_response // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -12374,10 +15591,11 @@ public function sendHelpDeskResponseRequest($wt_employee_send_help_desk_response $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -12390,14 +15608,15 @@ public function sendHelpDeskResponseRequest($wt_employee_send_help_desk_response * * @param mixed $static_voucher_campaign_id static_voucher_campaign_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSMSCampaignBroadcast $wt_employee_schedule_sms_campaign_broadcast wt_employee_schedule_sms_campaign_broadcast (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsCampaignBroadcast'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucherCampaignBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function sendSmsCampaignBroadcast($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast) + public function sendSmsCampaignBroadcast($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast, string $contentType = self::contentTypes['sendSmsCampaignBroadcast'][0]) { - list($response) = $this->sendSmsCampaignBroadcastWithHttpInfo($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast); + list($response) = $this->sendSmsCampaignBroadcastWithHttpInfo($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast, $contentType); return $response; } @@ -12408,14 +15627,15 @@ public function sendSmsCampaignBroadcast($static_voucher_campaign_id, $wt_employ * * @param mixed $static_voucher_campaign_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSMSCampaignBroadcast $wt_employee_schedule_sms_campaign_broadcast (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsCampaignBroadcast'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucherCampaignBroadcast|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\EntityTooLarge|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function sendSmsCampaignBroadcastWithHttpInfo($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast) + public function sendSmsCampaignBroadcastWithHttpInfo($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast, string $contentType = self::contentTypes['sendSmsCampaignBroadcast'][0]) { - $request = $this->sendSmsCampaignBroadcastRequest($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast); + $request = $this->sendSmsCampaignBroadcastRequest($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast, $contentType); try { $options = $this->createHttpClientOption(); @@ -12458,6 +15678,21 @@ public function sendSmsCampaignBroadcastWithHttpInfo($static_voucher_campaign_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucherCampaignBroadcast' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12470,6 +15705,21 @@ public function sendSmsCampaignBroadcastWithHttpInfo($static_voucher_campaign_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12482,6 +15732,21 @@ public function sendSmsCampaignBroadcastWithHttpInfo($static_voucher_campaign_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EntityTooLarge' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12494,6 +15759,21 @@ public function sendSmsCampaignBroadcastWithHttpInfo($static_voucher_campaign_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12506,6 +15786,21 @@ public function sendSmsCampaignBroadcastWithHttpInfo($static_voucher_campaign_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12520,6 +15815,21 @@ public function sendSmsCampaignBroadcastWithHttpInfo($static_voucher_campaign_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12582,13 +15892,14 @@ public function sendSmsCampaignBroadcastWithHttpInfo($static_voucher_campaign_id * * @param mixed $static_voucher_campaign_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSMSCampaignBroadcast $wt_employee_schedule_sms_campaign_broadcast (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsCampaignBroadcast'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendSmsCampaignBroadcastAsync($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast) + public function sendSmsCampaignBroadcastAsync($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast, string $contentType = self::contentTypes['sendSmsCampaignBroadcast'][0]) { - return $this->sendSmsCampaignBroadcastAsyncWithHttpInfo($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast) + return $this->sendSmsCampaignBroadcastAsyncWithHttpInfo($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast, $contentType) ->then( function ($response) { return $response[0]; @@ -12603,14 +15914,15 @@ function ($response) { * * @param mixed $static_voucher_campaign_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSMSCampaignBroadcast $wt_employee_schedule_sms_campaign_broadcast (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsCampaignBroadcast'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendSmsCampaignBroadcastAsyncWithHttpInfo($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast) + public function sendSmsCampaignBroadcastAsyncWithHttpInfo($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast, string $contentType = self::contentTypes['sendSmsCampaignBroadcast'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucherCampaignBroadcast'; - $request = $this->sendSmsCampaignBroadcastRequest($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast); + $request = $this->sendSmsCampaignBroadcastRequest($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12620,6 +15932,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -12650,18 +15965,21 @@ function ($exception) { * * @param mixed $static_voucher_campaign_id (required) * @param \OpenAPI\Client\Model\WTEmployeeScheduleSMSCampaignBroadcast $wt_employee_schedule_sms_campaign_broadcast (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendSmsCampaignBroadcast'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendSmsCampaignBroadcastRequest($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast) + public function sendSmsCampaignBroadcastRequest($static_voucher_campaign_id, $wt_employee_schedule_sms_campaign_broadcast, string $contentType = self::contentTypes['sendSmsCampaignBroadcast'][0]) { + // verify the required parameter 'static_voucher_campaign_id' is set if ($static_voucher_campaign_id === null || (is_array($static_voucher_campaign_id) && count($static_voucher_campaign_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $static_voucher_campaign_id when calling sendSmsCampaignBroadcast' ); } + // verify the required parameter 'wt_employee_schedule_sms_campaign_broadcast' is set if ($wt_employee_schedule_sms_campaign_broadcast === null || (is_array($wt_employee_schedule_sms_campaign_broadcast) && count($wt_employee_schedule_sms_campaign_broadcast) === 0)) { throw new \InvalidArgumentException( @@ -12669,6 +15987,7 @@ public function sendSmsCampaignBroadcastRequest($static_voucher_campaign_id, $wt ); } + $resourcePath = '/v2/employee/sms/schedule/campaign/{staticVoucherCampaignID}'; $formParams = []; $queryParams = []; @@ -12688,21 +16007,17 @@ public function sendSmsCampaignBroadcastRequest($static_voucher_campaign_id, $wt } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_schedule_sms_campaign_broadcast)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_sms_campaign_broadcast)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_schedule_sms_campaign_broadcast)); } else { $httpBody = $wt_employee_schedule_sms_campaign_broadcast; } @@ -12721,12 +16036,12 @@ public function sendSmsCampaignBroadcastRequest($static_voucher_campaign_id, $wt // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -12742,10 +16057,11 @@ public function sendSmsCampaignBroadcastRequest($static_voucher_campaign_id, $wt $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -12756,14 +16072,15 @@ public function sendSmsCampaignBroadcastRequest($static_voucher_campaign_id, $wt * * Mark alerts as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAlertsRead'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function setAlertsRead() + public function setAlertsRead(string $contentType = self::contentTypes['setAlertsRead'][0]) { - list($response) = $this->setAlertsReadWithHttpInfo(); + list($response) = $this->setAlertsReadWithHttpInfo($contentType); return $response; } @@ -12772,14 +16089,15 @@ public function setAlertsRead() * * Mark alerts as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAlertsRead'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function setAlertsReadWithHttpInfo() + public function setAlertsReadWithHttpInfo(string $contentType = self::contentTypes['setAlertsRead'][0]) { - $request = $this->setAlertsReadRequest(); + $request = $this->setAlertsReadRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -12822,6 +16140,21 @@ public function setAlertsReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12834,6 +16167,21 @@ public function setAlertsReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12846,6 +16194,21 @@ public function setAlertsReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12858,6 +16221,21 @@ public function setAlertsReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12872,6 +16250,21 @@ public function setAlertsReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12924,13 +16317,14 @@ public function setAlertsReadWithHttpInfo() * * Mark alerts as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAlertsRead'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setAlertsReadAsync() + public function setAlertsReadAsync(string $contentType = self::contentTypes['setAlertsRead'][0]) { - return $this->setAlertsReadAsyncWithHttpInfo() + return $this->setAlertsReadAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -12943,14 +16337,15 @@ function ($response) { * * Mark alerts as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAlertsRead'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setAlertsReadAsyncWithHttpInfo() + public function setAlertsReadAsyncWithHttpInfo(string $contentType = self::contentTypes['setAlertsRead'][0]) { $returnType = 'bool'; - $request = $this->setAlertsReadRequest(); + $request = $this->setAlertsReadRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12960,6 +16355,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -12988,13 +16386,15 @@ function ($exception) { /** * Create request for operation 'setAlertsRead' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setAlertsRead'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setAlertsReadRequest() + public function setAlertsReadRequest(string $contentType = self::contentTypes['setAlertsRead'][0]) { + $resourcePath = '/v2/employee/alerts'; $formParams = []; $queryParams = []; @@ -13006,16 +16406,11 @@ public function setAlertsReadRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -13033,12 +16428,12 @@ public function setAlertsReadRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -13054,10 +16449,11 @@ public function setAlertsReadRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -13068,14 +16464,15 @@ public function setAlertsReadRequest() * * Mark export data files as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setExportDataFilesRead'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function setExportDataFilesRead() + public function setExportDataFilesRead(string $contentType = self::contentTypes['setExportDataFilesRead'][0]) { - list($response) = $this->setExportDataFilesReadWithHttpInfo(); + list($response) = $this->setExportDataFilesReadWithHttpInfo($contentType); return $response; } @@ -13084,14 +16481,15 @@ public function setExportDataFilesRead() * * Mark export data files as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setExportDataFilesRead'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function setExportDataFilesReadWithHttpInfo() + public function setExportDataFilesReadWithHttpInfo(string $contentType = self::contentTypes['setExportDataFilesRead'][0]) { - $request = $this->setExportDataFilesReadRequest(); + $request = $this->setExportDataFilesReadRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -13134,6 +16532,21 @@ public function setExportDataFilesReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13146,6 +16559,21 @@ public function setExportDataFilesReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13158,6 +16586,21 @@ public function setExportDataFilesReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13170,6 +16613,21 @@ public function setExportDataFilesReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13184,6 +16642,21 @@ public function setExportDataFilesReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13236,13 +16709,14 @@ public function setExportDataFilesReadWithHttpInfo() * * Mark export data files as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setExportDataFilesRead'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setExportDataFilesReadAsync() + public function setExportDataFilesReadAsync(string $contentType = self::contentTypes['setExportDataFilesRead'][0]) { - return $this->setExportDataFilesReadAsyncWithHttpInfo() + return $this->setExportDataFilesReadAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -13255,14 +16729,15 @@ function ($response) { * * Mark export data files as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setExportDataFilesRead'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setExportDataFilesReadAsyncWithHttpInfo() + public function setExportDataFilesReadAsyncWithHttpInfo(string $contentType = self::contentTypes['setExportDataFilesRead'][0]) { $returnType = 'bool'; - $request = $this->setExportDataFilesReadRequest(); + $request = $this->setExportDataFilesReadRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13272,6 +16747,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -13300,13 +16778,15 @@ function ($exception) { /** * Create request for operation 'setExportDataFilesRead' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setExportDataFilesRead'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setExportDataFilesReadRequest() + public function setExportDataFilesReadRequest(string $contentType = self::contentTypes['setExportDataFilesRead'][0]) { + $resourcePath = '/v2/employee/export/dataFiles'; $formParams = []; $queryParams = []; @@ -13318,16 +16798,11 @@ public function setExportDataFilesReadRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -13345,12 +16820,12 @@ public function setExportDataFilesReadRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -13366,10 +16841,11 @@ public function setExportDataFilesReadRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -13381,14 +16857,15 @@ public function setExportDataFilesReadRequest() * Resolve help desk request * * @param mixed $help_desk_request_id help_desk_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setHelpDeskRequestResolved'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\HelpDeskRequest|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function setHelpDeskRequestResolved($help_desk_request_id) + public function setHelpDeskRequestResolved($help_desk_request_id, string $contentType = self::contentTypes['setHelpDeskRequestResolved'][0]) { - list($response) = $this->setHelpDeskRequestResolvedWithHttpInfo($help_desk_request_id); + list($response) = $this->setHelpDeskRequestResolvedWithHttpInfo($help_desk_request_id, $contentType); return $response; } @@ -13398,14 +16875,15 @@ public function setHelpDeskRequestResolved($help_desk_request_id) * Resolve help desk request * * @param mixed $help_desk_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setHelpDeskRequestResolved'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\HelpDeskRequest|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function setHelpDeskRequestResolvedWithHttpInfo($help_desk_request_id) + public function setHelpDeskRequestResolvedWithHttpInfo($help_desk_request_id, string $contentType = self::contentTypes['setHelpDeskRequestResolved'][0]) { - $request = $this->setHelpDeskRequestResolvedRequest($help_desk_request_id); + $request = $this->setHelpDeskRequestResolvedRequest($help_desk_request_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -13448,6 +16926,21 @@ public function setHelpDeskRequestResolvedWithHttpInfo($help_desk_request_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\HelpDeskRequest' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13460,6 +16953,21 @@ public function setHelpDeskRequestResolvedWithHttpInfo($help_desk_request_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13472,6 +16980,21 @@ public function setHelpDeskRequestResolvedWithHttpInfo($help_desk_request_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13484,6 +17007,21 @@ public function setHelpDeskRequestResolvedWithHttpInfo($help_desk_request_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13498,6 +17036,21 @@ public function setHelpDeskRequestResolvedWithHttpInfo($help_desk_request_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13551,13 +17104,14 @@ public function setHelpDeskRequestResolvedWithHttpInfo($help_desk_request_id) * Resolve help desk request * * @param mixed $help_desk_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setHelpDeskRequestResolved'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setHelpDeskRequestResolvedAsync($help_desk_request_id) + public function setHelpDeskRequestResolvedAsync($help_desk_request_id, string $contentType = self::contentTypes['setHelpDeskRequestResolved'][0]) { - return $this->setHelpDeskRequestResolvedAsyncWithHttpInfo($help_desk_request_id) + return $this->setHelpDeskRequestResolvedAsyncWithHttpInfo($help_desk_request_id, $contentType) ->then( function ($response) { return $response[0]; @@ -13571,14 +17125,15 @@ function ($response) { * Resolve help desk request * * @param mixed $help_desk_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setHelpDeskRequestResolved'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setHelpDeskRequestResolvedAsyncWithHttpInfo($help_desk_request_id) + public function setHelpDeskRequestResolvedAsyncWithHttpInfo($help_desk_request_id, string $contentType = self::contentTypes['setHelpDeskRequestResolved'][0]) { $returnType = '\OpenAPI\Client\Model\HelpDeskRequest'; - $request = $this->setHelpDeskRequestResolvedRequest($help_desk_request_id); + $request = $this->setHelpDeskRequestResolvedRequest($help_desk_request_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13588,6 +17143,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -13617,12 +17175,14 @@ function ($exception) { * Create request for operation 'setHelpDeskRequestResolved' * * @param mixed $help_desk_request_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setHelpDeskRequestResolved'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setHelpDeskRequestResolvedRequest($help_desk_request_id) + public function setHelpDeskRequestResolvedRequest($help_desk_request_id, string $contentType = self::contentTypes['setHelpDeskRequestResolved'][0]) { + // verify the required parameter 'help_desk_request_id' is set if ($help_desk_request_id === null || (is_array($help_desk_request_id) && count($help_desk_request_id) === 0)) { throw new \InvalidArgumentException( @@ -13630,6 +17190,7 @@ public function setHelpDeskRequestResolvedRequest($help_desk_request_id) ); } + $resourcePath = '/v2/employee/helpDesk/request/{helpDeskRequestID}'; $formParams = []; $queryParams = []; @@ -13649,16 +17210,11 @@ public function setHelpDeskRequestResolvedRequest($help_desk_request_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -13676,12 +17232,12 @@ public function setHelpDeskRequestResolvedRequest($help_desk_request_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -13697,10 +17253,11 @@ public function setHelpDeskRequestResolvedRequest($help_desk_request_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -13711,14 +17268,15 @@ public function setHelpDeskRequestResolvedRequest($help_desk_request_id) * * Mark messages as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setMessagesRead'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function setMessagesRead() + public function setMessagesRead(string $contentType = self::contentTypes['setMessagesRead'][0]) { - list($response) = $this->setMessagesReadWithHttpInfo(); + list($response) = $this->setMessagesReadWithHttpInfo($contentType); return $response; } @@ -13727,14 +17285,15 @@ public function setMessagesRead() * * Mark messages as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setMessagesRead'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function setMessagesReadWithHttpInfo() + public function setMessagesReadWithHttpInfo(string $contentType = self::contentTypes['setMessagesRead'][0]) { - $request = $this->setMessagesReadRequest(); + $request = $this->setMessagesReadRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -13777,6 +17336,21 @@ public function setMessagesReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13789,6 +17363,21 @@ public function setMessagesReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13801,6 +17390,21 @@ public function setMessagesReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13813,6 +17417,21 @@ public function setMessagesReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13827,6 +17446,21 @@ public function setMessagesReadWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13879,13 +17513,14 @@ public function setMessagesReadWithHttpInfo() * * Mark messages as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setMessagesRead'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setMessagesReadAsync() + public function setMessagesReadAsync(string $contentType = self::contentTypes['setMessagesRead'][0]) { - return $this->setMessagesReadAsyncWithHttpInfo() + return $this->setMessagesReadAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -13898,14 +17533,15 @@ function ($response) { * * Mark messages as read * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setMessagesRead'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setMessagesReadAsyncWithHttpInfo() + public function setMessagesReadAsyncWithHttpInfo(string $contentType = self::contentTypes['setMessagesRead'][0]) { $returnType = 'bool'; - $request = $this->setMessagesReadRequest(); + $request = $this->setMessagesReadRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13915,6 +17551,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -13943,13 +17582,15 @@ function ($exception) { /** * Create request for operation 'setMessagesRead' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setMessagesRead'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setMessagesReadRequest() + public function setMessagesReadRequest(string $contentType = self::contentTypes['setMessagesRead'][0]) { + $resourcePath = '/v2/employee/messages'; $formParams = []; $queryParams = []; @@ -13961,16 +17602,11 @@ public function setMessagesReadRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -13988,12 +17624,12 @@ public function setMessagesReadRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -14009,10 +17645,11 @@ public function setMessagesReadRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -14024,14 +17661,15 @@ public function setMessagesReadRequest() * Set profile picture * * @param \OpenAPI\Client\Model\WTEmployeeCreateMediaFile $wt_employee_create_media_file wt_employee_create_media_file (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setProfilePicture'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function setProfilePicture($wt_employee_create_media_file) + public function setProfilePicture($wt_employee_create_media_file, string $contentType = self::contentTypes['setProfilePicture'][0]) { - list($response) = $this->setProfilePictureWithHttpInfo($wt_employee_create_media_file); + list($response) = $this->setProfilePictureWithHttpInfo($wt_employee_create_media_file, $contentType); return $response; } @@ -14041,14 +17679,15 @@ public function setProfilePicture($wt_employee_create_media_file) * Set profile picture * * @param \OpenAPI\Client\Model\WTEmployeeCreateMediaFile $wt_employee_create_media_file (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setProfilePicture'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function setProfilePictureWithHttpInfo($wt_employee_create_media_file) + public function setProfilePictureWithHttpInfo($wt_employee_create_media_file, string $contentType = self::contentTypes['setProfilePicture'][0]) { - $request = $this->setProfilePictureRequest($wt_employee_create_media_file); + $request = $this->setProfilePictureRequest($wt_employee_create_media_file, $contentType); try { $options = $this->createHttpClientOption(); @@ -14091,6 +17730,21 @@ public function setProfilePictureWithHttpInfo($wt_employee_create_media_file) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14103,6 +17757,21 @@ public function setProfilePictureWithHttpInfo($wt_employee_create_media_file) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14115,6 +17784,21 @@ public function setProfilePictureWithHttpInfo($wt_employee_create_media_file) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14127,6 +17811,21 @@ public function setProfilePictureWithHttpInfo($wt_employee_create_media_file) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14141,6 +17840,21 @@ public function setProfilePictureWithHttpInfo($wt_employee_create_media_file) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14194,13 +17908,14 @@ public function setProfilePictureWithHttpInfo($wt_employee_create_media_file) * Set profile picture * * @param \OpenAPI\Client\Model\WTEmployeeCreateMediaFile $wt_employee_create_media_file (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setProfilePicture'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setProfilePictureAsync($wt_employee_create_media_file) + public function setProfilePictureAsync($wt_employee_create_media_file, string $contentType = self::contentTypes['setProfilePicture'][0]) { - return $this->setProfilePictureAsyncWithHttpInfo($wt_employee_create_media_file) + return $this->setProfilePictureAsyncWithHttpInfo($wt_employee_create_media_file, $contentType) ->then( function ($response) { return $response[0]; @@ -14214,14 +17929,15 @@ function ($response) { * Set profile picture * * @param \OpenAPI\Client\Model\WTEmployeeCreateMediaFile $wt_employee_create_media_file (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setProfilePicture'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function setProfilePictureAsyncWithHttpInfo($wt_employee_create_media_file) + public function setProfilePictureAsyncWithHttpInfo($wt_employee_create_media_file, string $contentType = self::contentTypes['setProfilePicture'][0]) { $returnType = 'string'; - $request = $this->setProfilePictureRequest($wt_employee_create_media_file); + $request = $this->setProfilePictureRequest($wt_employee_create_media_file, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14231,6 +17947,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -14260,12 +17979,14 @@ function ($exception) { * Create request for operation 'setProfilePicture' * * @param \OpenAPI\Client\Model\WTEmployeeCreateMediaFile $wt_employee_create_media_file (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['setProfilePicture'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function setProfilePictureRequest($wt_employee_create_media_file) + public function setProfilePictureRequest($wt_employee_create_media_file, string $contentType = self::contentTypes['setProfilePicture'][0]) { + // verify the required parameter 'wt_employee_create_media_file' is set if ($wt_employee_create_media_file === null || (is_array($wt_employee_create_media_file) && count($wt_employee_create_media_file) === 0)) { throw new \InvalidArgumentException( @@ -14273,6 +17994,7 @@ public function setProfilePictureRequest($wt_employee_create_media_file) ); } + $resourcePath = '/v2/employee/profile/picture'; $formParams = []; $queryParams = []; @@ -14284,21 +18006,17 @@ public function setProfilePictureRequest($wt_employee_create_media_file) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_create_media_file)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_create_media_file)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_create_media_file)); } else { $httpBody = $wt_employee_create_media_file; } @@ -14317,12 +18035,12 @@ public function setProfilePictureRequest($wt_employee_create_media_file) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -14338,10 +18056,11 @@ public function setProfilePictureRequest($wt_employee_create_media_file) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -14353,14 +18072,15 @@ public function setProfilePictureRequest($wt_employee_create_media_file) * Update club members * * @param \OpenAPI\Client\Model\WTEmployeeUpdateRecords $wt_employee_update_records wt_employee_update_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateClubMembers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateClubMembers($wt_employee_update_records) + public function updateClubMembers($wt_employee_update_records, string $contentType = self::contentTypes['updateClubMembers'][0]) { - list($response) = $this->updateClubMembersWithHttpInfo($wt_employee_update_records); + list($response) = $this->updateClubMembersWithHttpInfo($wt_employee_update_records, $contentType); return $response; } @@ -14370,14 +18090,15 @@ public function updateClubMembers($wt_employee_update_records) * Update club members * * @param \OpenAPI\Client\Model\WTEmployeeUpdateRecords $wt_employee_update_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateClubMembers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateClubMembersWithHttpInfo($wt_employee_update_records) + public function updateClubMembersWithHttpInfo($wt_employee_update_records, string $contentType = self::contentTypes['updateClubMembers'][0]) { - $request = $this->updateClubMembersRequest($wt_employee_update_records); + $request = $this->updateClubMembersRequest($wt_employee_update_records, $contentType); try { $options = $this->createHttpClientOption(); @@ -14420,6 +18141,21 @@ public function updateClubMembersWithHttpInfo($wt_employee_update_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14432,6 +18168,21 @@ public function updateClubMembersWithHttpInfo($wt_employee_update_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14444,6 +18195,21 @@ public function updateClubMembersWithHttpInfo($wt_employee_update_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14456,6 +18222,21 @@ public function updateClubMembersWithHttpInfo($wt_employee_update_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14470,6 +18251,21 @@ public function updateClubMembersWithHttpInfo($wt_employee_update_records) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14523,13 +18319,14 @@ public function updateClubMembersWithHttpInfo($wt_employee_update_records) * Update club members * * @param \OpenAPI\Client\Model\WTEmployeeUpdateRecords $wt_employee_update_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateClubMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateClubMembersAsync($wt_employee_update_records) + public function updateClubMembersAsync($wt_employee_update_records, string $contentType = self::contentTypes['updateClubMembers'][0]) { - return $this->updateClubMembersAsyncWithHttpInfo($wt_employee_update_records) + return $this->updateClubMembersAsyncWithHttpInfo($wt_employee_update_records, $contentType) ->then( function ($response) { return $response[0]; @@ -14543,14 +18340,15 @@ function ($response) { * Update club members * * @param \OpenAPI\Client\Model\WTEmployeeUpdateRecords $wt_employee_update_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateClubMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateClubMembersAsyncWithHttpInfo($wt_employee_update_records) + public function updateClubMembersAsyncWithHttpInfo($wt_employee_update_records, string $contentType = self::contentTypes['updateClubMembers'][0]) { $returnType = 'string'; - $request = $this->updateClubMembersRequest($wt_employee_update_records); + $request = $this->updateClubMembersRequest($wt_employee_update_records, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14560,6 +18358,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -14589,12 +18390,14 @@ function ($exception) { * Create request for operation 'updateClubMembers' * * @param \OpenAPI\Client\Model\WTEmployeeUpdateRecords $wt_employee_update_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateClubMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateClubMembersRequest($wt_employee_update_records) + public function updateClubMembersRequest($wt_employee_update_records, string $contentType = self::contentTypes['updateClubMembers'][0]) { + // verify the required parameter 'wt_employee_update_records' is set if ($wt_employee_update_records === null || (is_array($wt_employee_update_records) && count($wt_employee_update_records) === 0)) { throw new \InvalidArgumentException( @@ -14602,6 +18405,7 @@ public function updateClubMembersRequest($wt_employee_update_records) ); } + $resourcePath = '/v2/employee/update/members'; $formParams = []; $queryParams = []; @@ -14613,21 +18417,17 @@ public function updateClubMembersRequest($wt_employee_update_records) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_update_records)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_update_records)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_update_records)); } else { $httpBody = $wt_employee_update_records; } @@ -14646,12 +18446,12 @@ public function updateClubMembersRequest($wt_employee_update_records) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -14667,10 +18467,11 @@ public function updateClubMembersRequest($wt_employee_update_records) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -14681,15 +18482,16 @@ public function updateClubMembersRequest($wt_employee_update_records) * * Changes the employee's email notification preference to enabled or disabled * - * @param \OpenAPI\Client\Model\InlineObject $inline_object inline_object (required) + * @param \OpenAPI\Client\Model\UpdateEmailNotificationPreferenceRequest $update_email_notification_preference_request update_email_notification_preference_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailNotificationPreference'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Employee|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateEmailNotificationPreference($inline_object) + public function updateEmailNotificationPreference($update_email_notification_preference_request, string $contentType = self::contentTypes['updateEmailNotificationPreference'][0]) { - list($response) = $this->updateEmailNotificationPreferenceWithHttpInfo($inline_object); + list($response) = $this->updateEmailNotificationPreferenceWithHttpInfo($update_email_notification_preference_request, $contentType); return $response; } @@ -14698,15 +18500,16 @@ public function updateEmailNotificationPreference($inline_object) * * Changes the employee's email notification preference to enabled or disabled * - * @param \OpenAPI\Client\Model\InlineObject $inline_object (required) + * @param \OpenAPI\Client\Model\UpdateEmailNotificationPreferenceRequest $update_email_notification_preference_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailNotificationPreference'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Employee|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmailNotificationPreferenceWithHttpInfo($inline_object) + public function updateEmailNotificationPreferenceWithHttpInfo($update_email_notification_preference_request, string $contentType = self::contentTypes['updateEmailNotificationPreference'][0]) { - $request = $this->updateEmailNotificationPreferenceRequest($inline_object); + $request = $this->updateEmailNotificationPreferenceRequest($update_email_notification_preference_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -14749,6 +18552,21 @@ public function updateEmailNotificationPreferenceWithHttpInfo($inline_object) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Employee' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14761,6 +18579,21 @@ public function updateEmailNotificationPreferenceWithHttpInfo($inline_object) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14773,6 +18606,21 @@ public function updateEmailNotificationPreferenceWithHttpInfo($inline_object) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14785,6 +18633,21 @@ public function updateEmailNotificationPreferenceWithHttpInfo($inline_object) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14799,6 +18662,21 @@ public function updateEmailNotificationPreferenceWithHttpInfo($inline_object) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -14851,14 +18729,15 @@ public function updateEmailNotificationPreferenceWithHttpInfo($inline_object) * * Changes the employee's email notification preference to enabled or disabled * - * @param \OpenAPI\Client\Model\InlineObject $inline_object (required) + * @param \OpenAPI\Client\Model\UpdateEmailNotificationPreferenceRequest $update_email_notification_preference_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailNotificationPreference'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateEmailNotificationPreferenceAsync($inline_object) + public function updateEmailNotificationPreferenceAsync($update_email_notification_preference_request, string $contentType = self::contentTypes['updateEmailNotificationPreference'][0]) { - return $this->updateEmailNotificationPreferenceAsyncWithHttpInfo($inline_object) + return $this->updateEmailNotificationPreferenceAsyncWithHttpInfo($update_email_notification_preference_request, $contentType) ->then( function ($response) { return $response[0]; @@ -14871,15 +18750,16 @@ function ($response) { * * Changes the employee's email notification preference to enabled or disabled * - * @param \OpenAPI\Client\Model\InlineObject $inline_object (required) + * @param \OpenAPI\Client\Model\UpdateEmailNotificationPreferenceRequest $update_email_notification_preference_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailNotificationPreference'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateEmailNotificationPreferenceAsyncWithHttpInfo($inline_object) + public function updateEmailNotificationPreferenceAsyncWithHttpInfo($update_email_notification_preference_request, string $contentType = self::contentTypes['updateEmailNotificationPreference'][0]) { $returnType = '\OpenAPI\Client\Model\Employee'; - $request = $this->updateEmailNotificationPreferenceRequest($inline_object); + $request = $this->updateEmailNotificationPreferenceRequest($update_email_notification_preference_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -14889,6 +18769,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -14917,20 +18800,23 @@ function ($exception) { /** * Create request for operation 'updateEmailNotificationPreference' * - * @param \OpenAPI\Client\Model\InlineObject $inline_object (required) + * @param \OpenAPI\Client\Model\UpdateEmailNotificationPreferenceRequest $update_email_notification_preference_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmailNotificationPreference'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateEmailNotificationPreferenceRequest($inline_object) + public function updateEmailNotificationPreferenceRequest($update_email_notification_preference_request, string $contentType = self::contentTypes['updateEmailNotificationPreference'][0]) { - // verify the required parameter 'inline_object' is set - if ($inline_object === null || (is_array($inline_object) && count($inline_object) === 0)) { + + // verify the required parameter 'update_email_notification_preference_request' is set + if ($update_email_notification_preference_request === null || (is_array($update_email_notification_preference_request) && count($update_email_notification_preference_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $inline_object when calling updateEmailNotificationPreference' + 'Missing the required parameter $update_email_notification_preference_request when calling updateEmailNotificationPreference' ); } + $resourcePath = '/v2/employee/emailNotificationPreference'; $formParams = []; $queryParams = []; @@ -14942,23 +18828,19 @@ public function updateEmailNotificationPreferenceRequest($inline_object) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($inline_object)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($inline_object)); + if (isset($update_email_notification_preference_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_email_notification_preference_request)); } else { - $httpBody = $inline_object; + $httpBody = $update_email_notification_preference_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -14975,12 +18857,12 @@ public function updateEmailNotificationPreferenceRequest($inline_object) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -14996,10 +18878,11 @@ public function updateEmailNotificationPreferenceRequest($inline_object) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -15012,14 +18895,15 @@ public function updateEmailNotificationPreferenceRequest($inline_object) * * @param string $user_id user_id (required) * @param \OpenAPI\Client\Model\WTEmployeeUpdate $wt_employee_update wt_employee_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeePeer'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Employee|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateEmployeePeer($user_id, $wt_employee_update) + public function updateEmployeePeer($user_id, $wt_employee_update, string $contentType = self::contentTypes['updateEmployeePeer'][0]) { - list($response) = $this->updateEmployeePeerWithHttpInfo($user_id, $wt_employee_update); + list($response) = $this->updateEmployeePeerWithHttpInfo($user_id, $wt_employee_update, $contentType); return $response; } @@ -15030,14 +18914,15 @@ public function updateEmployeePeer($user_id, $wt_employee_update) * * @param string $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeeUpdate $wt_employee_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeePeer'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Employee|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeePeerWithHttpInfo($user_id, $wt_employee_update) + public function updateEmployeePeerWithHttpInfo($user_id, $wt_employee_update, string $contentType = self::contentTypes['updateEmployeePeer'][0]) { - $request = $this->updateEmployeePeerRequest($user_id, $wt_employee_update); + $request = $this->updateEmployeePeerRequest($user_id, $wt_employee_update, $contentType); try { $options = $this->createHttpClientOption(); @@ -15080,6 +18965,21 @@ public function updateEmployeePeerWithHttpInfo($user_id, $wt_employee_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Employee' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15092,6 +18992,21 @@ public function updateEmployeePeerWithHttpInfo($user_id, $wt_employee_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15104,6 +19019,21 @@ public function updateEmployeePeerWithHttpInfo($user_id, $wt_employee_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15116,6 +19046,21 @@ public function updateEmployeePeerWithHttpInfo($user_id, $wt_employee_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15130,6 +19075,21 @@ public function updateEmployeePeerWithHttpInfo($user_id, $wt_employee_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -15184,13 +19144,14 @@ public function updateEmployeePeerWithHttpInfo($user_id, $wt_employee_update) * * @param string $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeeUpdate $wt_employee_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeePeer'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeePeerAsync($user_id, $wt_employee_update) + public function updateEmployeePeerAsync($user_id, $wt_employee_update, string $contentType = self::contentTypes['updateEmployeePeer'][0]) { - return $this->updateEmployeePeerAsyncWithHttpInfo($user_id, $wt_employee_update) + return $this->updateEmployeePeerAsyncWithHttpInfo($user_id, $wt_employee_update, $contentType) ->then( function ($response) { return $response[0]; @@ -15205,14 +19166,15 @@ function ($response) { * * @param string $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeeUpdate $wt_employee_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeePeer'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeePeerAsyncWithHttpInfo($user_id, $wt_employee_update) + public function updateEmployeePeerAsyncWithHttpInfo($user_id, $wt_employee_update, string $contentType = self::contentTypes['updateEmployeePeer'][0]) { $returnType = '\OpenAPI\Client\Model\Employee'; - $request = $this->updateEmployeePeerRequest($user_id, $wt_employee_update); + $request = $this->updateEmployeePeerRequest($user_id, $wt_employee_update, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -15222,6 +19184,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -15252,12 +19217,14 @@ function ($exception) { * * @param string $user_id (required) * @param \OpenAPI\Client\Model\WTEmployeeUpdate $wt_employee_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateEmployeePeer'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateEmployeePeerRequest($user_id, $wt_employee_update) + public function updateEmployeePeerRequest($user_id, $wt_employee_update, string $contentType = self::contentTypes['updateEmployeePeer'][0]) { + // verify the required parameter 'user_id' is set if ($user_id === null || (is_array($user_id) && count($user_id) === 0)) { throw new \InvalidArgumentException( @@ -15273,7 +19240,7 @@ public function updateEmployeePeerRequest($user_id, $wt_employee_update) if (!preg_match("/^[a-zA-Z0-9]+$/", $user_id)) { throw new \InvalidArgumentException("invalid value for \"user_id\" when calling EmployeesApi.updateEmployeePeer, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'wt_employee_update' is set if ($wt_employee_update === null || (is_array($wt_employee_update) && count($wt_employee_update) === 0)) { throw new \InvalidArgumentException( @@ -15281,6 +19248,7 @@ public function updateEmployeePeerRequest($user_id, $wt_employee_update) ); } + $resourcePath = '/v2/employee/peer/{userID}'; $formParams = []; $queryParams = []; @@ -15300,21 +19268,17 @@ public function updateEmployeePeerRequest($user_id, $wt_employee_update) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_update)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_update)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_update)); } else { $httpBody = $wt_employee_update; } @@ -15333,12 +19297,12 @@ public function updateEmployeePeerRequest($user_id, $wt_employee_update) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -15354,10 +19318,11 @@ public function updateEmployeePeerRequest($user_id, $wt_employee_update) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/GamingApi.php b/lib/Api/GamingApi.php index e069ce0..510d50e 100644 --- a/lib/Api/GamingApi.php +++ b/lib/Api/GamingApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createGaming' => [ + 'application/json', + ], + 'fetchAllGaming' => [ + 'application/json', + ], + 'restoreGaming' => [ + 'application/json', + ], + 'updateGaming' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive gaming * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveGaming'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Gaming|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveGaming($id) + public function archiveGaming($id, string $contentType = self::contentTypes['archiveGaming'][0]) { - list($response) = $this->archiveGamingWithHttpInfo($id); + list($response) = $this->archiveGamingWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveGaming($id) * Archive gaming * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveGaming'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Gaming|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveGamingWithHttpInfo($id) + public function archiveGamingWithHttpInfo($id, string $contentType = self::contentTypes['archiveGaming'][0]) { - $request = $this->archiveGamingRequest($id); + $request = $this->archiveGamingRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveGamingWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Gaming' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveGamingWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveGamingWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveGamingWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveGamingWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveGamingWithHttpInfo($id) * Archive gaming * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveGamingAsync($id) + public function archiveGamingAsync($id, string $contentType = self::contentTypes['archiveGaming'][0]) { - return $this->archiveGamingAsyncWithHttpInfo($id) + return $this->archiveGamingAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive gaming * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveGamingAsyncWithHttpInfo($id) + public function archiveGamingAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveGaming'][0]) { $returnType = '\OpenAPI\Client\Model\Gaming'; - $request = $this->archiveGamingRequest($id); + $request = $this->archiveGamingRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveGaming' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveGamingRequest($id) + public function archiveGamingRequest($id, string $contentType = self::contentTypes['archiveGaming'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveGamingRequest($id) ); } + $resourcePath = '/v2/gaming/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveGamingRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveGamingRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveGamingRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveGamingRequest($id) * Create gaming * * @param \OpenAPI\Client\Model\WTGamingCreateParams $wt_gaming_create_params wt_gaming_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createGaming'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Gaming|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createGaming($wt_gaming_create_params) + public function createGaming($wt_gaming_create_params, string $contentType = self::contentTypes['createGaming'][0]) { - list($response) = $this->createGamingWithHttpInfo($wt_gaming_create_params); + list($response) = $this->createGamingWithHttpInfo($wt_gaming_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createGaming($wt_gaming_create_params) * Create gaming * * @param \OpenAPI\Client\Model\WTGamingCreateParams $wt_gaming_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createGaming'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Gaming|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createGamingWithHttpInfo($wt_gaming_create_params) + public function createGamingWithHttpInfo($wt_gaming_create_params, string $contentType = self::contentTypes['createGaming'][0]) { - $request = $this->createGamingRequest($wt_gaming_create_params); + $request = $this->createGamingRequest($wt_gaming_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createGamingWithHttpInfo($wt_gaming_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Gaming' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createGamingWithHttpInfo($wt_gaming_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createGamingWithHttpInfo($wt_gaming_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createGamingWithHttpInfo($wt_gaming_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createGamingWithHttpInfo($wt_gaming_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createGamingWithHttpInfo($wt_gaming_create_params) * Create gaming * * @param \OpenAPI\Client\Model\WTGamingCreateParams $wt_gaming_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createGamingAsync($wt_gaming_create_params) + public function createGamingAsync($wt_gaming_create_params, string $contentType = self::contentTypes['createGaming'][0]) { - return $this->createGamingAsyncWithHttpInfo($wt_gaming_create_params) + return $this->createGamingAsyncWithHttpInfo($wt_gaming_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create gaming * * @param \OpenAPI\Client\Model\WTGamingCreateParams $wt_gaming_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createGamingAsyncWithHttpInfo($wt_gaming_create_params) + public function createGamingAsyncWithHttpInfo($wt_gaming_create_params, string $contentType = self::contentTypes['createGaming'][0]) { $returnType = '\OpenAPI\Client\Model\Gaming'; - $request = $this->createGamingRequest($wt_gaming_create_params); + $request = $this->createGamingRequest($wt_gaming_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createGaming' * * @param \OpenAPI\Client\Model\WTGamingCreateParams $wt_gaming_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createGamingRequest($wt_gaming_create_params) + public function createGamingRequest($wt_gaming_create_params, string $contentType = self::contentTypes['createGaming'][0]) { + // verify the required parameter 'wt_gaming_create_params' is set if ($wt_gaming_create_params === null || (is_array($wt_gaming_create_params) && count($wt_gaming_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createGamingRequest($wt_gaming_create_params) ); } + $resourcePath = '/v2/gaming'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createGamingRequest($wt_gaming_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_gaming_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_gaming_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_gaming_create_params)); } else { $httpBody = $wt_gaming_create_params; } @@ -746,12 +927,12 @@ public function createGamingRequest($wt_gaming_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createGamingRequest($wt_gaming_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createGamingRequest($wt_gaming_create_params) * Fetch all gaming * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllGaming'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllGaming($is_archive_included = null) + public function fetchAllGaming($is_archive_included = null, string $contentType = self::contentTypes['fetchAllGaming'][0]) { - list($response) = $this->fetchAllGamingWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllGamingWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllGaming($is_archive_included = null) * Fetch all gaming * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllGaming'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllGamingWithHttpInfo($is_archive_included = null) + public function fetchAllGamingWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllGaming'][0]) { - $request = $this->fetchAllGamingRequest($is_archive_included); + $request = $this->fetchAllGamingRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllGamingWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllGamingWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllGamingWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllGamingWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllGamingWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllGamingWithHttpInfo($is_archive_included = null) * Fetch all gaming * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllGamingAsync($is_archive_included = null) + public function fetchAllGamingAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllGaming'][0]) { - return $this->fetchAllGamingAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllGamingAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all gaming * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllGamingAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllGamingAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllGaming'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllGamingRequest($is_archive_included); + $request = $this->fetchAllGamingRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllGaming' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllGamingRequest($is_archive_included = null) + public function fetchAllGamingRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllGaming'][0]) { + + $resourcePath = '/v2/gaming/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllGamingRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllGamingRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllGamingRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllGamingRequest($is_archive_included = null) * Restore gaming * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreGaming'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Gaming|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreGaming($id) + public function restoreGaming($id, string $contentType = self::contentTypes['restoreGaming'][0]) { - list($response) = $this->restoreGamingWithHttpInfo($id); + list($response) = $this->restoreGamingWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restoreGaming($id) * Restore gaming * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreGaming'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Gaming|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreGamingWithHttpInfo($id) + public function restoreGamingWithHttpInfo($id, string $contentType = self::contentTypes['restoreGaming'][0]) { - $request = $this->restoreGamingRequest($id); + $request = $this->restoreGamingRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restoreGamingWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Gaming' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restoreGamingWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restoreGamingWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restoreGamingWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restoreGamingWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restoreGamingWithHttpInfo($id) * Restore gaming * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreGamingAsync($id) + public function restoreGamingAsync($id, string $contentType = self::contentTypes['restoreGaming'][0]) { - return $this->restoreGamingAsyncWithHttpInfo($id) + return $this->restoreGamingAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore gaming * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreGamingAsyncWithHttpInfo($id) + public function restoreGamingAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreGaming'][0]) { $returnType = '\OpenAPI\Client\Model\Gaming'; - $request = $this->restoreGamingRequest($id); + $request = $this->restoreGamingRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restoreGaming' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreGamingRequest($id) + public function restoreGamingRequest($id, string $contentType = self::contentTypes['restoreGaming'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restoreGamingRequest($id) ); } + $resourcePath = '/v2/gaming/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restoreGamingRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restoreGamingRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restoreGamingRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restoreGamingRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTGamingUpdateParams $wt_gaming_update_params wt_gaming_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGaming'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Gaming|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateGaming($id, $wt_gaming_update_params) + public function updateGaming($id, $wt_gaming_update_params, string $contentType = self::contentTypes['updateGaming'][0]) { - list($response) = $this->updateGamingWithHttpInfo($id, $wt_gaming_update_params); + list($response) = $this->updateGamingWithHttpInfo($id, $wt_gaming_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateGaming($id, $wt_gaming_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTGamingUpdateParams $wt_gaming_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGaming'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Gaming|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateGamingWithHttpInfo($id, $wt_gaming_update_params) + public function updateGamingWithHttpInfo($id, $wt_gaming_update_params, string $contentType = self::contentTypes['updateGaming'][0]) { - $request = $this->updateGamingRequest($id, $wt_gaming_update_params); + $request = $this->updateGamingRequest($id, $wt_gaming_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateGamingWithHttpInfo($id, $wt_gaming_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Gaming' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateGamingWithHttpInfo($id, $wt_gaming_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateGamingWithHttpInfo($id, $wt_gaming_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateGamingWithHttpInfo($id, $wt_gaming_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateGamingWithHttpInfo($id, $wt_gaming_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateGamingWithHttpInfo($id, $wt_gaming_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTGamingUpdateParams $wt_gaming_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateGamingAsync($id, $wt_gaming_update_params) + public function updateGamingAsync($id, $wt_gaming_update_params, string $contentType = self::contentTypes['updateGaming'][0]) { - return $this->updateGamingAsyncWithHttpInfo($id, $wt_gaming_update_params) + return $this->updateGamingAsyncWithHttpInfo($id, $wt_gaming_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTGamingUpdateParams $wt_gaming_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateGamingAsyncWithHttpInfo($id, $wt_gaming_update_params) + public function updateGamingAsyncWithHttpInfo($id, $wt_gaming_update_params, string $contentType = self::contentTypes['updateGaming'][0]) { $returnType = '\OpenAPI\Client\Model\Gaming'; - $request = $this->updateGamingRequest($id, $wt_gaming_update_params); + $request = $this->updateGamingRequest($id, $wt_gaming_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTGamingUpdateParams $wt_gaming_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateGaming'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateGamingRequest($id, $wt_gaming_update_params) + public function updateGamingRequest($id, $wt_gaming_update_params, string $contentType = self::contentTypes['updateGaming'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateGaming' ); } + // verify the required parameter 'wt_gaming_update_params' is set if ($wt_gaming_update_params === null || (is_array($wt_gaming_update_params) && count($wt_gaming_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateGamingRequest($id, $wt_gaming_update_params) ); } + $resourcePath = '/v2/gaming/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateGamingRequest($id, $wt_gaming_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_gaming_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_gaming_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_gaming_update_params)); } else { $httpBody = $wt_gaming_update_params; } @@ -1753,12 +2177,12 @@ public function updateGamingRequest($id, $wt_gaming_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateGamingRequest($id, $wt_gaming_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/ImageGridApi.php b/lib/Api/ImageGridApi.php index 6371cfb..d78232b 100644 --- a/lib/Api/ImageGridApi.php +++ b/lib/Api/ImageGridApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createImageGrid' => [ + 'application/json', + ], + 'fetchAllImageGrid' => [ + 'application/json', + ], + 'restoreImageGrid' => [ + 'application/json', + ], + 'updateImageGrid' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive image * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveImageGrid'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ImageGrid|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveImageGrid($id) + public function archiveImageGrid($id, string $contentType = self::contentTypes['archiveImageGrid'][0]) { - list($response) = $this->archiveImageGridWithHttpInfo($id); + list($response) = $this->archiveImageGridWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveImageGrid($id) * Archive image * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveImageGrid'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ImageGrid|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveImageGridWithHttpInfo($id) + public function archiveImageGridWithHttpInfo($id, string $contentType = self::contentTypes['archiveImageGrid'][0]) { - $request = $this->archiveImageGridRequest($id); + $request = $this->archiveImageGridRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveImageGridWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ImageGrid' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveImageGridWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveImageGridWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveImageGridWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveImageGridWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveImageGridWithHttpInfo($id) * Archive image * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveImageGridAsync($id) + public function archiveImageGridAsync($id, string $contentType = self::contentTypes['archiveImageGrid'][0]) { - return $this->archiveImageGridAsyncWithHttpInfo($id) + return $this->archiveImageGridAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive image * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveImageGridAsyncWithHttpInfo($id) + public function archiveImageGridAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveImageGrid'][0]) { $returnType = '\OpenAPI\Client\Model\ImageGrid'; - $request = $this->archiveImageGridRequest($id); + $request = $this->archiveImageGridRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveImageGrid' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveImageGridRequest($id) + public function archiveImageGridRequest($id, string $contentType = self::contentTypes['archiveImageGrid'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveImageGridRequest($id) ); } + $resourcePath = '/v2/imageGrid/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveImageGridRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveImageGridRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveImageGridRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveImageGridRequest($id) * Create image * * @param \OpenAPI\Client\Model\WTImageGridCreateParams $wt_image_grid_create_params wt_image_grid_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createImageGrid'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ImageGrid|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createImageGrid($wt_image_grid_create_params) + public function createImageGrid($wt_image_grid_create_params, string $contentType = self::contentTypes['createImageGrid'][0]) { - list($response) = $this->createImageGridWithHttpInfo($wt_image_grid_create_params); + list($response) = $this->createImageGridWithHttpInfo($wt_image_grid_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createImageGrid($wt_image_grid_create_params) * Create image * * @param \OpenAPI\Client\Model\WTImageGridCreateParams $wt_image_grid_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createImageGrid'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ImageGrid|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createImageGridWithHttpInfo($wt_image_grid_create_params) + public function createImageGridWithHttpInfo($wt_image_grid_create_params, string $contentType = self::contentTypes['createImageGrid'][0]) { - $request = $this->createImageGridRequest($wt_image_grid_create_params); + $request = $this->createImageGridRequest($wt_image_grid_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createImageGridWithHttpInfo($wt_image_grid_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ImageGrid' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createImageGridWithHttpInfo($wt_image_grid_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createImageGridWithHttpInfo($wt_image_grid_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createImageGridWithHttpInfo($wt_image_grid_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createImageGridWithHttpInfo($wt_image_grid_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createImageGridWithHttpInfo($wt_image_grid_create_params) * Create image * * @param \OpenAPI\Client\Model\WTImageGridCreateParams $wt_image_grid_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createImageGridAsync($wt_image_grid_create_params) + public function createImageGridAsync($wt_image_grid_create_params, string $contentType = self::contentTypes['createImageGrid'][0]) { - return $this->createImageGridAsyncWithHttpInfo($wt_image_grid_create_params) + return $this->createImageGridAsyncWithHttpInfo($wt_image_grid_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create image * * @param \OpenAPI\Client\Model\WTImageGridCreateParams $wt_image_grid_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createImageGridAsyncWithHttpInfo($wt_image_grid_create_params) + public function createImageGridAsyncWithHttpInfo($wt_image_grid_create_params, string $contentType = self::contentTypes['createImageGrid'][0]) { $returnType = '\OpenAPI\Client\Model\ImageGrid'; - $request = $this->createImageGridRequest($wt_image_grid_create_params); + $request = $this->createImageGridRequest($wt_image_grid_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createImageGrid' * * @param \OpenAPI\Client\Model\WTImageGridCreateParams $wt_image_grid_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createImageGridRequest($wt_image_grid_create_params) + public function createImageGridRequest($wt_image_grid_create_params, string $contentType = self::contentTypes['createImageGrid'][0]) { + // verify the required parameter 'wt_image_grid_create_params' is set if ($wt_image_grid_create_params === null || (is_array($wt_image_grid_create_params) && count($wt_image_grid_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createImageGridRequest($wt_image_grid_create_params) ); } + $resourcePath = '/v2/imageGrid'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createImageGridRequest($wt_image_grid_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_image_grid_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_image_grid_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_image_grid_create_params)); } else { $httpBody = $wt_image_grid_create_params; } @@ -746,12 +927,12 @@ public function createImageGridRequest($wt_image_grid_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createImageGridRequest($wt_image_grid_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createImageGridRequest($wt_image_grid_create_params) * Fetch all images * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllImageGrid'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllImageGrid($is_archive_included = null) + public function fetchAllImageGrid($is_archive_included = null, string $contentType = self::contentTypes['fetchAllImageGrid'][0]) { - list($response) = $this->fetchAllImageGridWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllImageGridWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllImageGrid($is_archive_included = null) * Fetch all images * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllImageGrid'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllImageGridWithHttpInfo($is_archive_included = null) + public function fetchAllImageGridWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllImageGrid'][0]) { - $request = $this->fetchAllImageGridRequest($is_archive_included); + $request = $this->fetchAllImageGridRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllImageGridWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllImageGridWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllImageGridWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllImageGridWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllImageGridWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllImageGridWithHttpInfo($is_archive_included = null) * Fetch all images * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllImageGridAsync($is_archive_included = null) + public function fetchAllImageGridAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllImageGrid'][0]) { - return $this->fetchAllImageGridAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllImageGridAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all images * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllImageGridAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllImageGridAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllImageGrid'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllImageGridRequest($is_archive_included); + $request = $this->fetchAllImageGridRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllImageGrid' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllImageGridRequest($is_archive_included = null) + public function fetchAllImageGridRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllImageGrid'][0]) { + + $resourcePath = '/v2/imageGrid/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllImageGridRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllImageGridRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllImageGridRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllImageGridRequest($is_archive_included = null) * Restore image * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreImageGrid'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ImageGrid|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreImageGrid($id) + public function restoreImageGrid($id, string $contentType = self::contentTypes['restoreImageGrid'][0]) { - list($response) = $this->restoreImageGridWithHttpInfo($id); + list($response) = $this->restoreImageGridWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restoreImageGrid($id) * Restore image * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreImageGrid'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ImageGrid|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreImageGridWithHttpInfo($id) + public function restoreImageGridWithHttpInfo($id, string $contentType = self::contentTypes['restoreImageGrid'][0]) { - $request = $this->restoreImageGridRequest($id); + $request = $this->restoreImageGridRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restoreImageGridWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ImageGrid' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restoreImageGridWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restoreImageGridWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restoreImageGridWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restoreImageGridWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restoreImageGridWithHttpInfo($id) * Restore image * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreImageGridAsync($id) + public function restoreImageGridAsync($id, string $contentType = self::contentTypes['restoreImageGrid'][0]) { - return $this->restoreImageGridAsyncWithHttpInfo($id) + return $this->restoreImageGridAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore image * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreImageGridAsyncWithHttpInfo($id) + public function restoreImageGridAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreImageGrid'][0]) { $returnType = '\OpenAPI\Client\Model\ImageGrid'; - $request = $this->restoreImageGridRequest($id); + $request = $this->restoreImageGridRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restoreImageGrid' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreImageGridRequest($id) + public function restoreImageGridRequest($id, string $contentType = self::contentTypes['restoreImageGrid'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restoreImageGridRequest($id) ); } + $resourcePath = '/v2/imageGrid/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restoreImageGridRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restoreImageGridRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restoreImageGridRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restoreImageGridRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTImageGridUpdateParams $wt_image_grid_update_params wt_image_grid_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateImageGrid'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ImageGrid|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateImageGrid($id, $wt_image_grid_update_params) + public function updateImageGrid($id, $wt_image_grid_update_params, string $contentType = self::contentTypes['updateImageGrid'][0]) { - list($response) = $this->updateImageGridWithHttpInfo($id, $wt_image_grid_update_params); + list($response) = $this->updateImageGridWithHttpInfo($id, $wt_image_grid_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateImageGrid($id, $wt_image_grid_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTImageGridUpdateParams $wt_image_grid_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateImageGrid'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ImageGrid|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateImageGridWithHttpInfo($id, $wt_image_grid_update_params) + public function updateImageGridWithHttpInfo($id, $wt_image_grid_update_params, string $contentType = self::contentTypes['updateImageGrid'][0]) { - $request = $this->updateImageGridRequest($id, $wt_image_grid_update_params); + $request = $this->updateImageGridRequest($id, $wt_image_grid_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateImageGridWithHttpInfo($id, $wt_image_grid_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ImageGrid' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateImageGridWithHttpInfo($id, $wt_image_grid_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateImageGridWithHttpInfo($id, $wt_image_grid_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateImageGridWithHttpInfo($id, $wt_image_grid_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateImageGridWithHttpInfo($id, $wt_image_grid_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateImageGridWithHttpInfo($id, $wt_image_grid_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTImageGridUpdateParams $wt_image_grid_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateImageGridAsync($id, $wt_image_grid_update_params) + public function updateImageGridAsync($id, $wt_image_grid_update_params, string $contentType = self::contentTypes['updateImageGrid'][0]) { - return $this->updateImageGridAsyncWithHttpInfo($id, $wt_image_grid_update_params) + return $this->updateImageGridAsyncWithHttpInfo($id, $wt_image_grid_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTImageGridUpdateParams $wt_image_grid_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateImageGridAsyncWithHttpInfo($id, $wt_image_grid_update_params) + public function updateImageGridAsyncWithHttpInfo($id, $wt_image_grid_update_params, string $contentType = self::contentTypes['updateImageGrid'][0]) { $returnType = '\OpenAPI\Client\Model\ImageGrid'; - $request = $this->updateImageGridRequest($id, $wt_image_grid_update_params); + $request = $this->updateImageGridRequest($id, $wt_image_grid_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTImageGridUpdateParams $wt_image_grid_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateImageGrid'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateImageGridRequest($id, $wt_image_grid_update_params) + public function updateImageGridRequest($id, $wt_image_grid_update_params, string $contentType = self::contentTypes['updateImageGrid'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateImageGrid' ); } + // verify the required parameter 'wt_image_grid_update_params' is set if ($wt_image_grid_update_params === null || (is_array($wt_image_grid_update_params) && count($wt_image_grid_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateImageGridRequest($id, $wt_image_grid_update_params) ); } + $resourcePath = '/v2/imageGrid/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateImageGridRequest($id, $wt_image_grid_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_image_grid_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_image_grid_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_image_grid_update_params)); } else { $httpBody = $wt_image_grid_update_params; } @@ -1753,12 +2177,12 @@ public function updateImageGridRequest($id, $wt_image_grid_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateImageGridRequest($id, $wt_image_grid_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/IndustriesApi.php b/lib/Api/IndustriesApi.php index 72f7ef0..c083a8e 100644 --- a/lib/Api/IndustriesApi.php +++ b/lib/Api/IndustriesApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'fetchDomainsByIndustry' => [ + 'application/json', + ], + 'fetchIndustriesIDs' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -121,14 +134,15 @@ public function getConfig() * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllIndustries'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse200[]|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchIndustry200Response[]|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllIndustries() + public function fetchAllIndustries(string $contentType = self::contentTypes['fetchAllIndustries'][0]) { - list($response) = $this->fetchAllIndustriesWithHttpInfo(); + list($response) = $this->fetchAllIndustriesWithHttpInfo($contentType); return $response; } @@ -137,14 +151,15 @@ public function fetchAllIndustries() * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllIndustries'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse200[]|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchIndustry200Response[]|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllIndustriesWithHttpInfo() + public function fetchAllIndustriesWithHttpInfo(string $contentType = self::contentTypes['fetchAllIndustries'][0]) { - $request = $this->fetchAllIndustriesRequest(); + $request = $this->fetchAllIndustriesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -183,14 +198,29 @@ public function fetchAllIndustriesWithHttpInfo() switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse200[]' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchIndustry200Response[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchIndustry200Response[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse200[]', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchIndustry200Response[]', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -199,6 +229,21 @@ public function fetchAllIndustriesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -208,11 +253,26 @@ public function fetchAllIndustriesWithHttpInfo() ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse200[]'; + $returnType = '\OpenAPI\Client\Model\FetchIndustry200Response[]'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -226,7 +286,7 @@ public function fetchAllIndustriesWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse200[]', + '\OpenAPI\Client\Model\FetchIndustry200Response[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -249,13 +309,14 @@ public function fetchAllIndustriesWithHttpInfo() * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllIndustries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllIndustriesAsync() + public function fetchAllIndustriesAsync(string $contentType = self::contentTypes['fetchAllIndustries'][0]) { - return $this->fetchAllIndustriesAsyncWithHttpInfo() + return $this->fetchAllIndustriesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -268,14 +329,15 @@ function ($response) { * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllIndustries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllIndustriesAsyncWithHttpInfo() + public function fetchAllIndustriesAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchAllIndustries'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse200[]'; - $request = $this->fetchAllIndustriesRequest(); + $returnType = '\OpenAPI\Client\Model\FetchIndustry200Response[]'; + $request = $this->fetchAllIndustriesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -285,6 +347,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -313,13 +378,15 @@ function ($exception) { /** * Create request for operation 'fetchAllIndustries' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllIndustries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllIndustriesRequest() + public function fetchAllIndustriesRequest(string $contentType = self::contentTypes['fetchAllIndustries'][0]) { + $resourcePath = '/system/industries/all'; $formParams = []; $queryParams = []; @@ -331,16 +398,11 @@ public function fetchAllIndustriesRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -358,12 +420,12 @@ public function fetchAllIndustriesRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -379,10 +441,11 @@ public function fetchAllIndustriesRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -393,14 +456,15 @@ public function fetchAllIndustriesRequest() * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDomainsByIndustry'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse20012|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchDomainsByIndustry200Response|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDomainsByIndustry() + public function fetchDomainsByIndustry(string $contentType = self::contentTypes['fetchDomainsByIndustry'][0]) { - list($response) = $this->fetchDomainsByIndustryWithHttpInfo(); + list($response) = $this->fetchDomainsByIndustryWithHttpInfo($contentType); return $response; } @@ -409,14 +473,15 @@ public function fetchDomainsByIndustry() * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDomainsByIndustry'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse20012|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchDomainsByIndustry200Response|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDomainsByIndustryWithHttpInfo() + public function fetchDomainsByIndustryWithHttpInfo(string $contentType = self::contentTypes['fetchDomainsByIndustry'][0]) { - $request = $this->fetchDomainsByIndustryRequest(); + $request = $this->fetchDomainsByIndustryRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -455,14 +520,29 @@ public function fetchDomainsByIndustryWithHttpInfo() switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse20012' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchDomainsByIndustry200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchDomainsByIndustry200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse20012', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchDomainsByIndustry200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -471,6 +551,21 @@ public function fetchDomainsByIndustryWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -480,11 +575,26 @@ public function fetchDomainsByIndustryWithHttpInfo() ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse20012'; + $returnType = '\OpenAPI\Client\Model\FetchDomainsByIndustry200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -498,7 +608,7 @@ public function fetchDomainsByIndustryWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse20012', + '\OpenAPI\Client\Model\FetchDomainsByIndustry200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -521,13 +631,14 @@ public function fetchDomainsByIndustryWithHttpInfo() * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDomainsByIndustry'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDomainsByIndustryAsync() + public function fetchDomainsByIndustryAsync(string $contentType = self::contentTypes['fetchDomainsByIndustry'][0]) { - return $this->fetchDomainsByIndustryAsyncWithHttpInfo() + return $this->fetchDomainsByIndustryAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -540,14 +651,15 @@ function ($response) { * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDomainsByIndustry'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDomainsByIndustryAsyncWithHttpInfo() + public function fetchDomainsByIndustryAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchDomainsByIndustry'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse20012'; - $request = $this->fetchDomainsByIndustryRequest(); + $returnType = '\OpenAPI\Client\Model\FetchDomainsByIndustry200Response'; + $request = $this->fetchDomainsByIndustryRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -557,6 +669,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -585,13 +700,15 @@ function ($exception) { /** * Create request for operation 'fetchDomainsByIndustry' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDomainsByIndustry'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDomainsByIndustryRequest() + public function fetchDomainsByIndustryRequest(string $contentType = self::contentTypes['fetchDomainsByIndustry'][0]) { + $resourcePath = '/system/industries/domains'; $formParams = []; $queryParams = []; @@ -603,16 +720,11 @@ public function fetchDomainsByIndustryRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -630,12 +742,12 @@ public function fetchDomainsByIndustryRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -651,10 +763,11 @@ public function fetchDomainsByIndustryRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -665,14 +778,15 @@ public function fetchDomainsByIndustryRequest() * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchIndustriesIDs'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\InternalServerError */ - public function fetchIndustriesIDs() + public function fetchIndustriesIDs(string $contentType = self::contentTypes['fetchIndustriesIDs'][0]) { - list($response) = $this->fetchIndustriesIDsWithHttpInfo(); + list($response) = $this->fetchIndustriesIDsWithHttpInfo($contentType); return $response; } @@ -681,14 +795,15 @@ public function fetchIndustriesIDs() * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchIndustriesIDs'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchIndustriesIDsWithHttpInfo() + public function fetchIndustriesIDsWithHttpInfo(string $contentType = self::contentTypes['fetchIndustriesIDs'][0]) { - $request = $this->fetchIndustriesIDsRequest(); + $request = $this->fetchIndustriesIDsRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -731,6 +846,21 @@ public function fetchIndustriesIDsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -743,6 +873,21 @@ public function fetchIndustriesIDsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -757,6 +902,21 @@ public function fetchIndustriesIDsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -793,13 +953,14 @@ public function fetchIndustriesIDsWithHttpInfo() * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchIndustriesIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchIndustriesIDsAsync() + public function fetchIndustriesIDsAsync(string $contentType = self::contentTypes['fetchIndustriesIDs'][0]) { - return $this->fetchIndustriesIDsAsyncWithHttpInfo() + return $this->fetchIndustriesIDsAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -812,14 +973,15 @@ function ($response) { * * Fetch all industries * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchIndustriesIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchIndustriesIDsAsyncWithHttpInfo() + public function fetchIndustriesIDsAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchIndustriesIDs'][0]) { $returnType = 'mixed'; - $request = $this->fetchIndustriesIDsRequest(); + $request = $this->fetchIndustriesIDsRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -829,6 +991,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -857,13 +1022,15 @@ function ($exception) { /** * Create request for operation 'fetchIndustriesIDs' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchIndustriesIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchIndustriesIDsRequest() + public function fetchIndustriesIDsRequest(string $contentType = self::contentTypes['fetchIndustriesIDs'][0]) { + $resourcePath = '/system/industries/trimmed'; $formParams = []; $queryParams = []; @@ -875,16 +1042,11 @@ public function fetchIndustriesIDsRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -902,12 +1064,12 @@ public function fetchIndustriesIDsRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -923,10 +1085,11 @@ public function fetchIndustriesIDsRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/InfoGenesisReportsApi.php b/lib/Api/InfoGenesisReportsApi.php index 039e9a4..0a0a037 100644 --- a/lib/Api/InfoGenesisReportsApi.php +++ b/lib/Api/InfoGenesisReportsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'countAdCreditsRefunds' => [ + 'application/json', + ], + 'countDynamicVoucherRedemptions' => [ + 'application/json', + ], + 'countDynamicVoucherRefunds' => [ + 'application/json', + ], + 'countMembershipPointsRedemptions' => [ + 'application/json', + ], + 'countMembershipPointsRefunds' => [ + 'application/json', + ], + 'countMembershipTierRedemptions' => [ + 'application/json', + ], + 'countMembershipTierRefunds' => [ + 'application/json', + ], + 'countMerchantCreditRedemptions' => [ + 'application/json', + ], + 'countMerchantCreditRefunds' => [ + 'application/json', + ], + 'countStaticVoucherRedemptions' => [ + 'application/json', + ], + 'countStaticVoucherRefunds' => [ + 'application/json', + ], + 'fetchInfoGenesisAuthorizations' => [ + 'application/json', + ], + 'fetchInfoGenesisCampaignData' => [ + 'application/json', + ], + 'fetchInfoGenesisLookupRequests' => [ + 'application/json', + ], + 'fetchInfoGenesisLookupRequestsErrors' => [ + 'application/json', + ], + 'fetchInfoGenesisRedeemedStaticVouchers' => [ + 'application/json', + ], + 'fetchInfoGenesisRedeemedUniquePostingIDs' => [ + 'application/json', + ], + 'fetchInfoGenesisRedemptions' => [ + 'application/json', + ], + 'fetchInfoGenesisRefundedRoutingIDs' => [ + 'application/json', + ], + 'fetchInfoGenesisRefundedStaticVouchers' => [ + 'application/json', + ], + 'fetchInfoGenesisRefunds' => [ + 'application/json', + ], + 'fetchInfoGenesisRequest' => [ + 'application/json', + ], + 'fetchInfoGenesisRequests' => [ + 'application/json', + ], + 'fetchInfoGenesisResponseErrors' => [ + 'application/json', + ], + 'fetchInfoGenesisResponses' => [ + 'application/json', + ], + 'fetchInfoGenesisTransactionsWithUniquePostingIDs' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +207,15 @@ public function getConfig() * Count redeemed ad credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAdCreditsRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countAdCreditsRedemptions($wt_info_genesis_record_filter_parameters) + public function countAdCreditsRedemptions($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countAdCreditsRedemptions'][0]) { - list($response) = $this->countAdCreditsRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countAdCreditsRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -139,14 +225,15 @@ public function countAdCreditsRedemptions($wt_info_genesis_record_filter_paramet * Count redeemed ad credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAdCreditsRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countAdCreditsRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countAdCreditsRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countAdCreditsRedemptions'][0]) { - $request = $this->countAdCreditsRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countAdCreditsRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +276,21 @@ public function countAdCreditsRedemptionsWithHttpInfo($wt_info_genesis_record_fi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +303,21 @@ public function countAdCreditsRedemptionsWithHttpInfo($wt_info_genesis_record_fi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +330,21 @@ public function countAdCreditsRedemptionsWithHttpInfo($wt_info_genesis_record_fi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +357,21 @@ public function countAdCreditsRedemptionsWithHttpInfo($wt_info_genesis_record_fi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +386,21 @@ public function countAdCreditsRedemptionsWithHttpInfo($wt_info_genesis_record_fi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +454,14 @@ public function countAdCreditsRedemptionsWithHttpInfo($wt_info_genesis_record_fi * Count redeemed ad credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAdCreditsRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countAdCreditsRedemptionsAsync($wt_info_genesis_record_filter_parameters) + public function countAdCreditsRedemptionsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countAdCreditsRedemptions'][0]) { - return $this->countAdCreditsRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countAdCreditsRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +475,15 @@ function ($response) { * Count redeemed ad credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAdCreditsRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countAdCreditsRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countAdCreditsRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countAdCreditsRedemptions'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countAdCreditsRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countAdCreditsRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +493,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +525,14 @@ function ($exception) { * Create request for operation 'countAdCreditsRedemptions' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAdCreditsRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countAdCreditsRedemptionsRequest($wt_info_genesis_record_filter_parameters) + public function countAdCreditsRedemptionsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countAdCreditsRedemptions'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +540,7 @@ public function countAdCreditsRedemptionsRequest($wt_info_genesis_record_filter_ ); } + $resourcePath = '/v2/pos/infogenesis/count/adCredits/redemptions'; $formParams = []; $queryParams = []; @@ -382,21 +552,17 @@ public function countAdCreditsRedemptionsRequest($wt_info_genesis_record_filter_ - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -415,12 +581,12 @@ public function countAdCreditsRedemptionsRequest($wt_info_genesis_record_filter_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -436,10 +602,11 @@ public function countAdCreditsRedemptionsRequest($wt_info_genesis_record_filter_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -451,14 +618,15 @@ public function countAdCreditsRedemptionsRequest($wt_info_genesis_record_filter_ * Count refunded ad credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAdCreditsRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countAdCreditsRefunds($wt_info_genesis_record_filter_parameters) + public function countAdCreditsRefunds($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countAdCreditsRefunds'][0]) { - list($response) = $this->countAdCreditsRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countAdCreditsRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -468,14 +636,15 @@ public function countAdCreditsRefunds($wt_info_genesis_record_filter_parameters) * Count refunded ad credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAdCreditsRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countAdCreditsRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countAdCreditsRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countAdCreditsRefunds'][0]) { - $request = $this->countAdCreditsRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countAdCreditsRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -518,6 +687,21 @@ public function countAdCreditsRefundsWithHttpInfo($wt_info_genesis_record_filter $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -530,6 +714,21 @@ public function countAdCreditsRefundsWithHttpInfo($wt_info_genesis_record_filter $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -542,6 +741,21 @@ public function countAdCreditsRefundsWithHttpInfo($wt_info_genesis_record_filter $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -554,6 +768,21 @@ public function countAdCreditsRefundsWithHttpInfo($wt_info_genesis_record_filter $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -568,6 +797,21 @@ public function countAdCreditsRefundsWithHttpInfo($wt_info_genesis_record_filter $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -621,13 +865,14 @@ public function countAdCreditsRefundsWithHttpInfo($wt_info_genesis_record_filter * Count refunded ad credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAdCreditsRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countAdCreditsRefundsAsync($wt_info_genesis_record_filter_parameters) + public function countAdCreditsRefundsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countAdCreditsRefunds'][0]) { - return $this->countAdCreditsRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countAdCreditsRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -641,14 +886,15 @@ function ($response) { * Count refunded ad credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAdCreditsRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countAdCreditsRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countAdCreditsRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countAdCreditsRefunds'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countAdCreditsRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countAdCreditsRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -658,6 +904,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -687,12 +936,14 @@ function ($exception) { * Create request for operation 'countAdCreditsRefunds' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countAdCreditsRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countAdCreditsRefundsRequest($wt_info_genesis_record_filter_parameters) + public function countAdCreditsRefundsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countAdCreditsRefunds'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -700,6 +951,7 @@ public function countAdCreditsRefundsRequest($wt_info_genesis_record_filter_para ); } + $resourcePath = '/v2/pos/infogenesis/count/adCredits/refunds'; $formParams = []; $queryParams = []; @@ -711,21 +963,17 @@ public function countAdCreditsRefundsRequest($wt_info_genesis_record_filter_para - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -744,12 +992,12 @@ public function countAdCreditsRefundsRequest($wt_info_genesis_record_filter_para // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -765,10 +1013,11 @@ public function countAdCreditsRefundsRequest($wt_info_genesis_record_filter_para $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -780,14 +1029,15 @@ public function countAdCreditsRefundsRequest($wt_info_genesis_record_filter_para * Count dynamic voucher redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDynamicVoucherRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countDynamicVoucherRedemptions($wt_info_genesis_record_filter_parameters) + public function countDynamicVoucherRedemptions($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countDynamicVoucherRedemptions'][0]) { - list($response) = $this->countDynamicVoucherRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countDynamicVoucherRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -797,14 +1047,15 @@ public function countDynamicVoucherRedemptions($wt_info_genesis_record_filter_pa * Count dynamic voucher redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDynamicVoucherRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countDynamicVoucherRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countDynamicVoucherRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countDynamicVoucherRedemptions'][0]) { - $request = $this->countDynamicVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countDynamicVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -847,6 +1098,21 @@ public function countDynamicVoucherRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -859,6 +1125,21 @@ public function countDynamicVoucherRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -871,6 +1152,21 @@ public function countDynamicVoucherRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -883,6 +1179,21 @@ public function countDynamicVoucherRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -897,6 +1208,21 @@ public function countDynamicVoucherRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -950,13 +1276,14 @@ public function countDynamicVoucherRedemptionsWithHttpInfo($wt_info_genesis_reco * Count dynamic voucher redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDynamicVoucherRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countDynamicVoucherRedemptionsAsync($wt_info_genesis_record_filter_parameters) + public function countDynamicVoucherRedemptionsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countDynamicVoucherRedemptions'][0]) { - return $this->countDynamicVoucherRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countDynamicVoucherRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -970,14 +1297,15 @@ function ($response) { * Count dynamic voucher redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDynamicVoucherRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countDynamicVoucherRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countDynamicVoucherRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countDynamicVoucherRedemptions'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countDynamicVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countDynamicVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -987,6 +1315,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1016,12 +1347,14 @@ function ($exception) { * Create request for operation 'countDynamicVoucherRedemptions' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDynamicVoucherRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countDynamicVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters) + public function countDynamicVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countDynamicVoucherRedemptions'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -1029,6 +1362,7 @@ public function countDynamicVoucherRedemptionsRequest($wt_info_genesis_record_fi ); } + $resourcePath = '/v2/pos/infogenesis/count/dynamicVoucher/redemptions'; $formParams = []; $queryParams = []; @@ -1040,21 +1374,17 @@ public function countDynamicVoucherRedemptionsRequest($wt_info_genesis_record_fi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -1073,12 +1403,12 @@ public function countDynamicVoucherRedemptionsRequest($wt_info_genesis_record_fi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1094,10 +1424,11 @@ public function countDynamicVoucherRedemptionsRequest($wt_info_genesis_record_fi $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1109,14 +1440,15 @@ public function countDynamicVoucherRedemptionsRequest($wt_info_genesis_record_fi * Count dynamic voucher refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDynamicVoucherRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countDynamicVoucherRefunds($wt_info_genesis_record_filter_parameters) + public function countDynamicVoucherRefunds($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countDynamicVoucherRefunds'][0]) { - list($response) = $this->countDynamicVoucherRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countDynamicVoucherRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -1126,14 +1458,15 @@ public function countDynamicVoucherRefunds($wt_info_genesis_record_filter_parame * Count dynamic voucher refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDynamicVoucherRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countDynamicVoucherRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countDynamicVoucherRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countDynamicVoucherRefunds'][0]) { - $request = $this->countDynamicVoucherRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countDynamicVoucherRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -1176,6 +1509,21 @@ public function countDynamicVoucherRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1188,6 +1536,21 @@ public function countDynamicVoucherRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1200,6 +1563,21 @@ public function countDynamicVoucherRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1212,6 +1590,21 @@ public function countDynamicVoucherRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1226,6 +1619,21 @@ public function countDynamicVoucherRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1279,13 +1687,14 @@ public function countDynamicVoucherRefundsWithHttpInfo($wt_info_genesis_record_f * Count dynamic voucher refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDynamicVoucherRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countDynamicVoucherRefundsAsync($wt_info_genesis_record_filter_parameters) + public function countDynamicVoucherRefundsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countDynamicVoucherRefunds'][0]) { - return $this->countDynamicVoucherRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countDynamicVoucherRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -1299,14 +1708,15 @@ function ($response) { * Count dynamic voucher refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDynamicVoucherRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countDynamicVoucherRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countDynamicVoucherRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countDynamicVoucherRefunds'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countDynamicVoucherRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countDynamicVoucherRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1316,6 +1726,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1345,12 +1758,14 @@ function ($exception) { * Create request for operation 'countDynamicVoucherRefunds' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countDynamicVoucherRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countDynamicVoucherRefundsRequest($wt_info_genesis_record_filter_parameters) + public function countDynamicVoucherRefundsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countDynamicVoucherRefunds'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -1358,6 +1773,7 @@ public function countDynamicVoucherRefundsRequest($wt_info_genesis_record_filter ); } + $resourcePath = '/v2/pos/infogenesis/count/dynamicVoucher/refunds'; $formParams = []; $queryParams = []; @@ -1369,21 +1785,17 @@ public function countDynamicVoucherRefundsRequest($wt_info_genesis_record_filter - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -1402,12 +1814,12 @@ public function countDynamicVoucherRefundsRequest($wt_info_genesis_record_filter // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1423,10 +1835,11 @@ public function countDynamicVoucherRefundsRequest($wt_info_genesis_record_filter $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1438,14 +1851,15 @@ public function countDynamicVoucherRefundsRequest($wt_info_genesis_record_filter * Count redeemed membership points * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipPointsRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countMembershipPointsRedemptions($wt_info_genesis_record_filter_parameters) + public function countMembershipPointsRedemptions($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipPointsRedemptions'][0]) { - list($response) = $this->countMembershipPointsRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countMembershipPointsRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -1455,14 +1869,15 @@ public function countMembershipPointsRedemptions($wt_info_genesis_record_filter_ * Count redeemed membership points * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipPointsRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countMembershipPointsRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMembershipPointsRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipPointsRedemptions'][0]) { - $request = $this->countMembershipPointsRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMembershipPointsRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -1505,6 +1920,21 @@ public function countMembershipPointsRedemptionsWithHttpInfo($wt_info_genesis_re $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1517,6 +1947,21 @@ public function countMembershipPointsRedemptionsWithHttpInfo($wt_info_genesis_re $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1529,6 +1974,21 @@ public function countMembershipPointsRedemptionsWithHttpInfo($wt_info_genesis_re $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1541,6 +2001,21 @@ public function countMembershipPointsRedemptionsWithHttpInfo($wt_info_genesis_re $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1555,6 +2030,21 @@ public function countMembershipPointsRedemptionsWithHttpInfo($wt_info_genesis_re $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1608,13 +2098,14 @@ public function countMembershipPointsRedemptionsWithHttpInfo($wt_info_genesis_re * Count redeemed membership points * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipPointsRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMembershipPointsRedemptionsAsync($wt_info_genesis_record_filter_parameters) + public function countMembershipPointsRedemptionsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipPointsRedemptions'][0]) { - return $this->countMembershipPointsRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countMembershipPointsRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -1628,14 +2119,15 @@ function ($response) { * Count redeemed membership points * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipPointsRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMembershipPointsRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMembershipPointsRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipPointsRedemptions'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countMembershipPointsRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMembershipPointsRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1645,6 +2137,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1674,12 +2169,14 @@ function ($exception) { * Create request for operation 'countMembershipPointsRedemptions' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipPointsRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countMembershipPointsRedemptionsRequest($wt_info_genesis_record_filter_parameters) + public function countMembershipPointsRedemptionsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipPointsRedemptions'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -1687,6 +2184,7 @@ public function countMembershipPointsRedemptionsRequest($wt_info_genesis_record_ ); } + $resourcePath = '/v2/pos/infogenesis/count/membershipPoints/redemptions'; $formParams = []; $queryParams = []; @@ -1698,21 +2196,17 @@ public function countMembershipPointsRedemptionsRequest($wt_info_genesis_record_ - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -1731,12 +2225,12 @@ public function countMembershipPointsRedemptionsRequest($wt_info_genesis_record_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1752,10 +2246,11 @@ public function countMembershipPointsRedemptionsRequest($wt_info_genesis_record_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1767,14 +2262,15 @@ public function countMembershipPointsRedemptionsRequest($wt_info_genesis_record_ * Count refunded membership points * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipPointsRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countMembershipPointsRefunds($wt_info_genesis_record_filter_parameters) + public function countMembershipPointsRefunds($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipPointsRefunds'][0]) { - list($response) = $this->countMembershipPointsRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countMembershipPointsRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -1784,14 +2280,15 @@ public function countMembershipPointsRefunds($wt_info_genesis_record_filter_para * Count refunded membership points * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipPointsRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countMembershipPointsRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMembershipPointsRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipPointsRefunds'][0]) { - $request = $this->countMembershipPointsRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMembershipPointsRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -1834,6 +2331,21 @@ public function countMembershipPointsRefundsWithHttpInfo($wt_info_genesis_record $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1846,6 +2358,21 @@ public function countMembershipPointsRefundsWithHttpInfo($wt_info_genesis_record $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1858,6 +2385,21 @@ public function countMembershipPointsRefundsWithHttpInfo($wt_info_genesis_record $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1870,6 +2412,21 @@ public function countMembershipPointsRefundsWithHttpInfo($wt_info_genesis_record $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1884,6 +2441,21 @@ public function countMembershipPointsRefundsWithHttpInfo($wt_info_genesis_record $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1937,13 +2509,14 @@ public function countMembershipPointsRefundsWithHttpInfo($wt_info_genesis_record * Count refunded membership points * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipPointsRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMembershipPointsRefundsAsync($wt_info_genesis_record_filter_parameters) + public function countMembershipPointsRefundsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipPointsRefunds'][0]) { - return $this->countMembershipPointsRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countMembershipPointsRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -1957,14 +2530,15 @@ function ($response) { * Count refunded membership points * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipPointsRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMembershipPointsRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMembershipPointsRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipPointsRefunds'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countMembershipPointsRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMembershipPointsRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1974,6 +2548,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2003,12 +2580,14 @@ function ($exception) { * Create request for operation 'countMembershipPointsRefunds' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipPointsRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countMembershipPointsRefundsRequest($wt_info_genesis_record_filter_parameters) + public function countMembershipPointsRefundsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipPointsRefunds'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -2016,6 +2595,7 @@ public function countMembershipPointsRefundsRequest($wt_info_genesis_record_filt ); } + $resourcePath = '/v2/pos/infogenesis/count/membershipPoints/refunds'; $formParams = []; $queryParams = []; @@ -2027,21 +2607,17 @@ public function countMembershipPointsRefundsRequest($wt_info_genesis_record_filt - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -2060,12 +2636,12 @@ public function countMembershipPointsRefundsRequest($wt_info_genesis_record_filt // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2081,10 +2657,11 @@ public function countMembershipPointsRefundsRequest($wt_info_genesis_record_filt $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2096,14 +2673,15 @@ public function countMembershipPointsRefundsRequest($wt_info_genesis_record_filt * Count tier redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipTierRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countMembershipTierRedemptions($wt_info_genesis_record_filter_parameters) + public function countMembershipTierRedemptions($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipTierRedemptions'][0]) { - list($response) = $this->countMembershipTierRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countMembershipTierRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -2113,14 +2691,15 @@ public function countMembershipTierRedemptions($wt_info_genesis_record_filter_pa * Count tier redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipTierRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countMembershipTierRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMembershipTierRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipTierRedemptions'][0]) { - $request = $this->countMembershipTierRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMembershipTierRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -2163,6 +2742,21 @@ public function countMembershipTierRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2175,6 +2769,21 @@ public function countMembershipTierRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2187,6 +2796,21 @@ public function countMembershipTierRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2199,6 +2823,21 @@ public function countMembershipTierRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2213,6 +2852,21 @@ public function countMembershipTierRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2266,13 +2920,14 @@ public function countMembershipTierRedemptionsWithHttpInfo($wt_info_genesis_reco * Count tier redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipTierRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMembershipTierRedemptionsAsync($wt_info_genesis_record_filter_parameters) + public function countMembershipTierRedemptionsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipTierRedemptions'][0]) { - return $this->countMembershipTierRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countMembershipTierRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -2286,14 +2941,15 @@ function ($response) { * Count tier redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipTierRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMembershipTierRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMembershipTierRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipTierRedemptions'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countMembershipTierRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMembershipTierRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2303,6 +2959,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2332,12 +2991,14 @@ function ($exception) { * Create request for operation 'countMembershipTierRedemptions' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipTierRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countMembershipTierRedemptionsRequest($wt_info_genesis_record_filter_parameters) + public function countMembershipTierRedemptionsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipTierRedemptions'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -2345,6 +3006,7 @@ public function countMembershipTierRedemptionsRequest($wt_info_genesis_record_fi ); } + $resourcePath = '/v2/pos/infogenesis/count/membershipTier/redemptions'; $formParams = []; $queryParams = []; @@ -2356,21 +3018,17 @@ public function countMembershipTierRedemptionsRequest($wt_info_genesis_record_fi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -2389,12 +3047,12 @@ public function countMembershipTierRedemptionsRequest($wt_info_genesis_record_fi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2410,10 +3068,11 @@ public function countMembershipTierRedemptionsRequest($wt_info_genesis_record_fi $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2425,14 +3084,15 @@ public function countMembershipTierRedemptionsRequest($wt_info_genesis_record_fi * Count tier refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipTierRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countMembershipTierRefunds($wt_info_genesis_record_filter_parameters) + public function countMembershipTierRefunds($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipTierRefunds'][0]) { - list($response) = $this->countMembershipTierRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countMembershipTierRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -2442,14 +3102,15 @@ public function countMembershipTierRefunds($wt_info_genesis_record_filter_parame * Count tier refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipTierRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countMembershipTierRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMembershipTierRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipTierRefunds'][0]) { - $request = $this->countMembershipTierRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMembershipTierRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -2492,6 +3153,21 @@ public function countMembershipTierRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2504,6 +3180,21 @@ public function countMembershipTierRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2516,6 +3207,21 @@ public function countMembershipTierRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2528,6 +3234,21 @@ public function countMembershipTierRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2542,6 +3263,21 @@ public function countMembershipTierRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2595,13 +3331,14 @@ public function countMembershipTierRefundsWithHttpInfo($wt_info_genesis_record_f * Count tier refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipTierRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMembershipTierRefundsAsync($wt_info_genesis_record_filter_parameters) + public function countMembershipTierRefundsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipTierRefunds'][0]) { - return $this->countMembershipTierRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countMembershipTierRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -2615,14 +3352,15 @@ function ($response) { * Count tier refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipTierRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMembershipTierRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMembershipTierRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipTierRefunds'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countMembershipTierRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMembershipTierRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2632,6 +3370,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2661,12 +3402,14 @@ function ($exception) { * Create request for operation 'countMembershipTierRefunds' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMembershipTierRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countMembershipTierRefundsRequest($wt_info_genesis_record_filter_parameters) + public function countMembershipTierRefundsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMembershipTierRefunds'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -2674,6 +3417,7 @@ public function countMembershipTierRefundsRequest($wt_info_genesis_record_filter ); } + $resourcePath = '/v2/pos/infogenesis/count/membershipTier/refunds'; $formParams = []; $queryParams = []; @@ -2685,21 +3429,17 @@ public function countMembershipTierRefundsRequest($wt_info_genesis_record_filter - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -2718,12 +3458,12 @@ public function countMembershipTierRefundsRequest($wt_info_genesis_record_filter // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2739,10 +3479,11 @@ public function countMembershipTierRefundsRequest($wt_info_genesis_record_filter $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2754,14 +3495,15 @@ public function countMembershipTierRefundsRequest($wt_info_genesis_record_filter * Count redeemed merchant credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMerchantCreditRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countMerchantCreditRedemptions($wt_info_genesis_record_filter_parameters) + public function countMerchantCreditRedemptions($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMerchantCreditRedemptions'][0]) { - list($response) = $this->countMerchantCreditRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countMerchantCreditRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -2771,14 +3513,15 @@ public function countMerchantCreditRedemptions($wt_info_genesis_record_filter_pa * Count redeemed merchant credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMerchantCreditRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countMerchantCreditRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMerchantCreditRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMerchantCreditRedemptions'][0]) { - $request = $this->countMerchantCreditRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMerchantCreditRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -2821,6 +3564,21 @@ public function countMerchantCreditRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2833,6 +3591,21 @@ public function countMerchantCreditRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2845,6 +3618,21 @@ public function countMerchantCreditRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2857,6 +3645,21 @@ public function countMerchantCreditRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2871,6 +3674,21 @@ public function countMerchantCreditRedemptionsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2924,13 +3742,14 @@ public function countMerchantCreditRedemptionsWithHttpInfo($wt_info_genesis_reco * Count redeemed merchant credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMerchantCreditRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMerchantCreditRedemptionsAsync($wt_info_genesis_record_filter_parameters) + public function countMerchantCreditRedemptionsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMerchantCreditRedemptions'][0]) { - return $this->countMerchantCreditRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countMerchantCreditRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -2944,14 +3763,15 @@ function ($response) { * Count redeemed merchant credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMerchantCreditRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMerchantCreditRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMerchantCreditRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMerchantCreditRedemptions'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countMerchantCreditRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMerchantCreditRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2961,6 +3781,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2990,12 +3813,14 @@ function ($exception) { * Create request for operation 'countMerchantCreditRedemptions' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMerchantCreditRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countMerchantCreditRedemptionsRequest($wt_info_genesis_record_filter_parameters) + public function countMerchantCreditRedemptionsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMerchantCreditRedemptions'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -3003,6 +3828,7 @@ public function countMerchantCreditRedemptionsRequest($wt_info_genesis_record_fi ); } + $resourcePath = '/v2/pos/infogenesis/count/merchantCredit/redemptions'; $formParams = []; $queryParams = []; @@ -3014,21 +3840,17 @@ public function countMerchantCreditRedemptionsRequest($wt_info_genesis_record_fi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -3047,12 +3869,12 @@ public function countMerchantCreditRedemptionsRequest($wt_info_genesis_record_fi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3068,10 +3890,11 @@ public function countMerchantCreditRedemptionsRequest($wt_info_genesis_record_fi $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3083,14 +3906,15 @@ public function countMerchantCreditRedemptionsRequest($wt_info_genesis_record_fi * Count refunded merchant credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMerchantCreditRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countMerchantCreditRefunds($wt_info_genesis_record_filter_parameters) + public function countMerchantCreditRefunds($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMerchantCreditRefunds'][0]) { - list($response) = $this->countMerchantCreditRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countMerchantCreditRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -3100,14 +3924,15 @@ public function countMerchantCreditRefunds($wt_info_genesis_record_filter_parame * Count refunded merchant credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMerchantCreditRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countMerchantCreditRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMerchantCreditRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMerchantCreditRefunds'][0]) { - $request = $this->countMerchantCreditRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMerchantCreditRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -3150,6 +3975,21 @@ public function countMerchantCreditRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3162,6 +4002,21 @@ public function countMerchantCreditRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3174,6 +4029,21 @@ public function countMerchantCreditRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3186,6 +4056,21 @@ public function countMerchantCreditRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3200,6 +4085,21 @@ public function countMerchantCreditRefundsWithHttpInfo($wt_info_genesis_record_f $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3253,13 +4153,14 @@ public function countMerchantCreditRefundsWithHttpInfo($wt_info_genesis_record_f * Count refunded merchant credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMerchantCreditRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMerchantCreditRefundsAsync($wt_info_genesis_record_filter_parameters) + public function countMerchantCreditRefundsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMerchantCreditRefunds'][0]) { - return $this->countMerchantCreditRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countMerchantCreditRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -3273,14 +4174,15 @@ function ($response) { * Count refunded merchant credits * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMerchantCreditRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countMerchantCreditRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countMerchantCreditRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMerchantCreditRefunds'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countMerchantCreditRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countMerchantCreditRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3290,6 +4192,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3319,12 +4224,14 @@ function ($exception) { * Create request for operation 'countMerchantCreditRefunds' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countMerchantCreditRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countMerchantCreditRefundsRequest($wt_info_genesis_record_filter_parameters) + public function countMerchantCreditRefundsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countMerchantCreditRefunds'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -3332,6 +4239,7 @@ public function countMerchantCreditRefundsRequest($wt_info_genesis_record_filter ); } + $resourcePath = '/v2/pos/infogenesis/count/merchantCredit/refunds'; $formParams = []; $queryParams = []; @@ -3343,21 +4251,17 @@ public function countMerchantCreditRefundsRequest($wt_info_genesis_record_filter - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -3376,12 +4280,12 @@ public function countMerchantCreditRefundsRequest($wt_info_genesis_record_filter // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3397,10 +4301,11 @@ public function countMerchantCreditRefundsRequest($wt_info_genesis_record_filter $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3412,14 +4317,15 @@ public function countMerchantCreditRefundsRequest($wt_info_genesis_record_filter * Count static voucher redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countStaticVoucherRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countStaticVoucherRedemptions($wt_info_genesis_record_filter_parameters) + public function countStaticVoucherRedemptions($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countStaticVoucherRedemptions'][0]) { - list($response) = $this->countStaticVoucherRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countStaticVoucherRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -3429,14 +4335,15 @@ public function countStaticVoucherRedemptions($wt_info_genesis_record_filter_par * Count static voucher redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countStaticVoucherRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countStaticVoucherRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countStaticVoucherRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countStaticVoucherRedemptions'][0]) { - $request = $this->countStaticVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countStaticVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -3479,6 +4386,21 @@ public function countStaticVoucherRedemptionsWithHttpInfo($wt_info_genesis_recor $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3491,6 +4413,21 @@ public function countStaticVoucherRedemptionsWithHttpInfo($wt_info_genesis_recor $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3503,6 +4440,21 @@ public function countStaticVoucherRedemptionsWithHttpInfo($wt_info_genesis_recor $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3515,6 +4467,21 @@ public function countStaticVoucherRedemptionsWithHttpInfo($wt_info_genesis_recor $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3529,6 +4496,21 @@ public function countStaticVoucherRedemptionsWithHttpInfo($wt_info_genesis_recor $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3582,13 +4564,14 @@ public function countStaticVoucherRedemptionsWithHttpInfo($wt_info_genesis_recor * Count static voucher redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countStaticVoucherRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countStaticVoucherRedemptionsAsync($wt_info_genesis_record_filter_parameters) + public function countStaticVoucherRedemptionsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countStaticVoucherRedemptions'][0]) { - return $this->countStaticVoucherRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countStaticVoucherRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -3602,14 +4585,15 @@ function ($response) { * Count static voucher redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countStaticVoucherRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countStaticVoucherRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countStaticVoucherRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countStaticVoucherRedemptions'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countStaticVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countStaticVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3619,6 +4603,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3648,12 +4635,14 @@ function ($exception) { * Create request for operation 'countStaticVoucherRedemptions' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countStaticVoucherRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countStaticVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters) + public function countStaticVoucherRedemptionsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countStaticVoucherRedemptions'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -3661,6 +4650,7 @@ public function countStaticVoucherRedemptionsRequest($wt_info_genesis_record_fil ); } + $resourcePath = '/v2/pos/infogenesis/count/staticVoucher/redemptions'; $formParams = []; $queryParams = []; @@ -3672,21 +4662,17 @@ public function countStaticVoucherRedemptionsRequest($wt_info_genesis_record_fil - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -3705,12 +4691,12 @@ public function countStaticVoucherRedemptionsRequest($wt_info_genesis_record_fil // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3726,10 +4712,11 @@ public function countStaticVoucherRedemptionsRequest($wt_info_genesis_record_fil $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3741,14 +4728,15 @@ public function countStaticVoucherRedemptionsRequest($wt_info_genesis_record_fil * Count static voucher refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countStaticVoucherRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countStaticVoucherRefunds($wt_info_genesis_record_filter_parameters) + public function countStaticVoucherRefunds($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countStaticVoucherRefunds'][0]) { - list($response) = $this->countStaticVoucherRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->countStaticVoucherRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -3758,14 +4746,15 @@ public function countStaticVoucherRefunds($wt_info_genesis_record_filter_paramet * Count static voucher refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countStaticVoucherRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countStaticVoucherRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countStaticVoucherRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countStaticVoucherRefunds'][0]) { - $request = $this->countStaticVoucherRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countStaticVoucherRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -3808,6 +4797,21 @@ public function countStaticVoucherRefundsWithHttpInfo($wt_info_genesis_record_fi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3820,6 +4824,21 @@ public function countStaticVoucherRefundsWithHttpInfo($wt_info_genesis_record_fi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3832,6 +4851,21 @@ public function countStaticVoucherRefundsWithHttpInfo($wt_info_genesis_record_fi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3844,6 +4878,21 @@ public function countStaticVoucherRefundsWithHttpInfo($wt_info_genesis_record_fi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3858,6 +4907,21 @@ public function countStaticVoucherRefundsWithHttpInfo($wt_info_genesis_record_fi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3911,13 +4975,14 @@ public function countStaticVoucherRefundsWithHttpInfo($wt_info_genesis_record_fi * Count static voucher refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countStaticVoucherRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countStaticVoucherRefundsAsync($wt_info_genesis_record_filter_parameters) + public function countStaticVoucherRefundsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countStaticVoucherRefunds'][0]) { - return $this->countStaticVoucherRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->countStaticVoucherRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -3931,14 +4996,15 @@ function ($response) { * Count static voucher refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countStaticVoucherRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countStaticVoucherRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function countStaticVoucherRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countStaticVoucherRefunds'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countStaticVoucherRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->countStaticVoucherRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3948,6 +5014,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3977,12 +5046,14 @@ function ($exception) { * Create request for operation 'countStaticVoucherRefunds' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countStaticVoucherRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countStaticVoucherRefundsRequest($wt_info_genesis_record_filter_parameters) + public function countStaticVoucherRefundsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['countStaticVoucherRefunds'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -3990,6 +5061,7 @@ public function countStaticVoucherRefundsRequest($wt_info_genesis_record_filter_ ); } + $resourcePath = '/v2/pos/infogenesis/count/staticVoucher/refunds'; $formParams = []; $queryParams = []; @@ -4001,21 +5073,17 @@ public function countStaticVoucherRefundsRequest($wt_info_genesis_record_filter_ - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -4034,12 +5102,12 @@ public function countStaticVoucherRefundsRequest($wt_info_genesis_record_filter_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4055,10 +5123,11 @@ public function countStaticVoucherRefundsRequest($wt_info_genesis_record_filter_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4070,14 +5139,15 @@ public function countStaticVoucherRefundsRequest($wt_info_genesis_record_filter_ * Fetch InfoGenesis authorizations * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisAuthorizations'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisAuthorizations($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisAuthorizations($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisAuthorizations'][0]) { - list($response) = $this->fetchInfoGenesisAuthorizationsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->fetchInfoGenesisAuthorizationsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -4087,14 +5157,15 @@ public function fetchInfoGenesisAuthorizations($wt_info_genesis_record_filter_pa * Fetch InfoGenesis authorizations * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisAuthorizations'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisAuthorizationsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisAuthorizationsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisAuthorizations'][0]) { - $request = $this->fetchInfoGenesisAuthorizationsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->fetchInfoGenesisAuthorizationsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -4137,6 +5208,21 @@ public function fetchInfoGenesisAuthorizationsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Request[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4149,6 +5235,21 @@ public function fetchInfoGenesisAuthorizationsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4161,6 +5262,21 @@ public function fetchInfoGenesisAuthorizationsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4173,6 +5289,21 @@ public function fetchInfoGenesisAuthorizationsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4187,6 +5318,21 @@ public function fetchInfoGenesisAuthorizationsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4240,13 +5386,14 @@ public function fetchInfoGenesisAuthorizationsWithHttpInfo($wt_info_genesis_reco * Fetch InfoGenesis authorizations * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisAuthorizations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisAuthorizationsAsync($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisAuthorizationsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisAuthorizations'][0]) { - return $this->fetchInfoGenesisAuthorizationsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->fetchInfoGenesisAuthorizationsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -4260,14 +5407,15 @@ function ($response) { * Fetch InfoGenesis authorizations * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisAuthorizations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisAuthorizationsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisAuthorizationsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisAuthorizations'][0]) { $returnType = '\OpenAPI\Client\Model\Request[]'; - $request = $this->fetchInfoGenesisAuthorizationsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->fetchInfoGenesisAuthorizationsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4277,6 +5425,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4306,12 +5457,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisAuthorizations' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisAuthorizations'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisAuthorizationsRequest($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisAuthorizationsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisAuthorizations'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -4319,6 +5472,7 @@ public function fetchInfoGenesisAuthorizationsRequest($wt_info_genesis_record_fi ); } + $resourcePath = '/v2/pos/infogenesis/authorizations'; $formParams = []; $queryParams = []; @@ -4330,21 +5484,17 @@ public function fetchInfoGenesisAuthorizationsRequest($wt_info_genesis_record_fi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -4363,12 +5513,12 @@ public function fetchInfoGenesisAuthorizationsRequest($wt_info_genesis_record_fi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4384,10 +5534,11 @@ public function fetchInfoGenesisAuthorizationsRequest($wt_info_genesis_record_fi $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4399,14 +5550,15 @@ public function fetchInfoGenesisAuthorizationsRequest($wt_info_genesis_record_fi * Fetch campaign information * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisCampaignData'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisCampaignData($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisCampaignData($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisCampaignData'][0]) { - list($response) = $this->fetchInfoGenesisCampaignDataWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->fetchInfoGenesisCampaignDataWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -4416,14 +5568,15 @@ public function fetchInfoGenesisCampaignData($wt_info_genesis_record_filter_para * Fetch campaign information * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisCampaignData'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisCampaignDataWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisCampaignDataWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisCampaignData'][0]) { - $request = $this->fetchInfoGenesisCampaignDataRequest($wt_info_genesis_record_filter_parameters); + $request = $this->fetchInfoGenesisCampaignDataRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -4466,6 +5619,21 @@ public function fetchInfoGenesisCampaignDataWithHttpInfo($wt_info_genesis_record $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4478,6 +5646,21 @@ public function fetchInfoGenesisCampaignDataWithHttpInfo($wt_info_genesis_record $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4490,6 +5673,21 @@ public function fetchInfoGenesisCampaignDataWithHttpInfo($wt_info_genesis_record $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4502,6 +5700,21 @@ public function fetchInfoGenesisCampaignDataWithHttpInfo($wt_info_genesis_record $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4516,6 +5729,21 @@ public function fetchInfoGenesisCampaignDataWithHttpInfo($wt_info_genesis_record $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4569,13 +5797,14 @@ public function fetchInfoGenesisCampaignDataWithHttpInfo($wt_info_genesis_record * Fetch campaign information * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisCampaignData'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisCampaignDataAsync($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisCampaignDataAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisCampaignData'][0]) { - return $this->fetchInfoGenesisCampaignDataAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->fetchInfoGenesisCampaignDataAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -4589,14 +5818,15 @@ function ($response) { * Fetch campaign information * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisCampaignData'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisCampaignDataAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisCampaignDataAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisCampaignData'][0]) { $returnType = 'bool'; - $request = $this->fetchInfoGenesisCampaignDataRequest($wt_info_genesis_record_filter_parameters); + $request = $this->fetchInfoGenesisCampaignDataRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4606,6 +5836,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4635,12 +5868,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisCampaignData' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisCampaignData'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisCampaignDataRequest($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisCampaignDataRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisCampaignData'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -4648,6 +5883,7 @@ public function fetchInfoGenesisCampaignDataRequest($wt_info_genesis_record_filt ); } + $resourcePath = '/v2/pos/infogenesis/campaign'; $formParams = []; $queryParams = []; @@ -4659,21 +5895,17 @@ public function fetchInfoGenesisCampaignDataRequest($wt_info_genesis_record_filt - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -4692,12 +5924,12 @@ public function fetchInfoGenesisCampaignDataRequest($wt_info_genesis_record_filt // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4713,10 +5945,11 @@ public function fetchInfoGenesisCampaignDataRequest($wt_info_genesis_record_filt $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4728,14 +5961,15 @@ public function fetchInfoGenesisCampaignDataRequest($wt_info_genesis_record_filt * Fetch InfoGenesis lookup requests * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisLookupRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisLookupRequests($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisLookupRequests($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisLookupRequests'][0]) { - list($response) = $this->fetchInfoGenesisLookupRequestsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->fetchInfoGenesisLookupRequestsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -4745,14 +5979,15 @@ public function fetchInfoGenesisLookupRequests($wt_info_genesis_record_filter_pa * Fetch InfoGenesis lookup requests * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisLookupRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisLookupRequestsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisLookupRequestsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisLookupRequests'][0]) { - $request = $this->fetchInfoGenesisLookupRequestsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->fetchInfoGenesisLookupRequestsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -4795,6 +6030,21 @@ public function fetchInfoGenesisLookupRequestsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Request[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4807,6 +6057,21 @@ public function fetchInfoGenesisLookupRequestsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4819,6 +6084,21 @@ public function fetchInfoGenesisLookupRequestsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4831,6 +6111,21 @@ public function fetchInfoGenesisLookupRequestsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4845,6 +6140,21 @@ public function fetchInfoGenesisLookupRequestsWithHttpInfo($wt_info_genesis_reco $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4898,13 +6208,14 @@ public function fetchInfoGenesisLookupRequestsWithHttpInfo($wt_info_genesis_reco * Fetch InfoGenesis lookup requests * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisLookupRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisLookupRequestsAsync($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisLookupRequestsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisLookupRequests'][0]) { - return $this->fetchInfoGenesisLookupRequestsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->fetchInfoGenesisLookupRequestsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -4918,14 +6229,15 @@ function ($response) { * Fetch InfoGenesis lookup requests * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisLookupRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisLookupRequestsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisLookupRequestsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisLookupRequests'][0]) { $returnType = '\OpenAPI\Client\Model\Request[]'; - $request = $this->fetchInfoGenesisLookupRequestsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->fetchInfoGenesisLookupRequestsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4935,6 +6247,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4964,12 +6279,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisLookupRequests' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisLookupRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisLookupRequestsRequest($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisLookupRequestsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisLookupRequests'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -4977,6 +6294,7 @@ public function fetchInfoGenesisLookupRequestsRequest($wt_info_genesis_record_fi ); } + $resourcePath = '/v2/pos/infogenesis/requests/lookup'; $formParams = []; $queryParams = []; @@ -4988,21 +6306,17 @@ public function fetchInfoGenesisLookupRequestsRequest($wt_info_genesis_record_fi - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -5021,12 +6335,12 @@ public function fetchInfoGenesisLookupRequestsRequest($wt_info_genesis_record_fi // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5042,10 +6356,11 @@ public function fetchInfoGenesisLookupRequestsRequest($wt_info_genesis_record_fi $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5057,14 +6372,15 @@ public function fetchInfoGenesisLookupRequestsRequest($wt_info_genesis_record_fi * Fetch InfoGenesis lookup request errors * * @param \OpenAPI\Client\Model\WTInfoGenesisLookupRequestErrors $wt_info_genesis_lookup_request_errors wt_info_genesis_lookup_request_errors (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisLookupRequestsErrors'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisLookupRequestsErrors($wt_info_genesis_lookup_request_errors) + public function fetchInfoGenesisLookupRequestsErrors($wt_info_genesis_lookup_request_errors, string $contentType = self::contentTypes['fetchInfoGenesisLookupRequestsErrors'][0]) { - list($response) = $this->fetchInfoGenesisLookupRequestsErrorsWithHttpInfo($wt_info_genesis_lookup_request_errors); + list($response) = $this->fetchInfoGenesisLookupRequestsErrorsWithHttpInfo($wt_info_genesis_lookup_request_errors, $contentType); return $response; } @@ -5074,14 +6390,15 @@ public function fetchInfoGenesisLookupRequestsErrors($wt_info_genesis_lookup_req * Fetch InfoGenesis lookup request errors * * @param \OpenAPI\Client\Model\WTInfoGenesisLookupRequestErrors $wt_info_genesis_lookup_request_errors (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisLookupRequestsErrors'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisLookupRequestsErrorsWithHttpInfo($wt_info_genesis_lookup_request_errors) + public function fetchInfoGenesisLookupRequestsErrorsWithHttpInfo($wt_info_genesis_lookup_request_errors, string $contentType = self::contentTypes['fetchInfoGenesisLookupRequestsErrors'][0]) { - $request = $this->fetchInfoGenesisLookupRequestsErrorsRequest($wt_info_genesis_lookup_request_errors); + $request = $this->fetchInfoGenesisLookupRequestsErrorsRequest($wt_info_genesis_lookup_request_errors, $contentType); try { $options = $this->createHttpClientOption(); @@ -5124,6 +6441,21 @@ public function fetchInfoGenesisLookupRequestsErrorsWithHttpInfo($wt_info_genesi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Request[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5136,6 +6468,21 @@ public function fetchInfoGenesisLookupRequestsErrorsWithHttpInfo($wt_info_genesi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5148,6 +6495,21 @@ public function fetchInfoGenesisLookupRequestsErrorsWithHttpInfo($wt_info_genesi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5160,6 +6522,21 @@ public function fetchInfoGenesisLookupRequestsErrorsWithHttpInfo($wt_info_genesi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5174,6 +6551,21 @@ public function fetchInfoGenesisLookupRequestsErrorsWithHttpInfo($wt_info_genesi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5227,13 +6619,14 @@ public function fetchInfoGenesisLookupRequestsErrorsWithHttpInfo($wt_info_genesi * Fetch InfoGenesis lookup request errors * * @param \OpenAPI\Client\Model\WTInfoGenesisLookupRequestErrors $wt_info_genesis_lookup_request_errors (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisLookupRequestsErrors'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisLookupRequestsErrorsAsync($wt_info_genesis_lookup_request_errors) + public function fetchInfoGenesisLookupRequestsErrorsAsync($wt_info_genesis_lookup_request_errors, string $contentType = self::contentTypes['fetchInfoGenesisLookupRequestsErrors'][0]) { - return $this->fetchInfoGenesisLookupRequestsErrorsAsyncWithHttpInfo($wt_info_genesis_lookup_request_errors) + return $this->fetchInfoGenesisLookupRequestsErrorsAsyncWithHttpInfo($wt_info_genesis_lookup_request_errors, $contentType) ->then( function ($response) { return $response[0]; @@ -5247,14 +6640,15 @@ function ($response) { * Fetch InfoGenesis lookup request errors * * @param \OpenAPI\Client\Model\WTInfoGenesisLookupRequestErrors $wt_info_genesis_lookup_request_errors (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisLookupRequestsErrors'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisLookupRequestsErrorsAsyncWithHttpInfo($wt_info_genesis_lookup_request_errors) + public function fetchInfoGenesisLookupRequestsErrorsAsyncWithHttpInfo($wt_info_genesis_lookup_request_errors, string $contentType = self::contentTypes['fetchInfoGenesisLookupRequestsErrors'][0]) { $returnType = '\OpenAPI\Client\Model\Request[]'; - $request = $this->fetchInfoGenesisLookupRequestsErrorsRequest($wt_info_genesis_lookup_request_errors); + $request = $this->fetchInfoGenesisLookupRequestsErrorsRequest($wt_info_genesis_lookup_request_errors, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5264,6 +6658,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5293,12 +6690,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisLookupRequestsErrors' * * @param \OpenAPI\Client\Model\WTInfoGenesisLookupRequestErrors $wt_info_genesis_lookup_request_errors (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisLookupRequestsErrors'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisLookupRequestsErrorsRequest($wt_info_genesis_lookup_request_errors) + public function fetchInfoGenesisLookupRequestsErrorsRequest($wt_info_genesis_lookup_request_errors, string $contentType = self::contentTypes['fetchInfoGenesisLookupRequestsErrors'][0]) { + // verify the required parameter 'wt_info_genesis_lookup_request_errors' is set if ($wt_info_genesis_lookup_request_errors === null || (is_array($wt_info_genesis_lookup_request_errors) && count($wt_info_genesis_lookup_request_errors) === 0)) { throw new \InvalidArgumentException( @@ -5306,6 +6705,7 @@ public function fetchInfoGenesisLookupRequestsErrorsRequest($wt_info_genesis_loo ); } + $resourcePath = '/v2/pos/infogenesis/requests/lookup/errors'; $formParams = []; $queryParams = []; @@ -5317,21 +6717,17 @@ public function fetchInfoGenesisLookupRequestsErrorsRequest($wt_info_genesis_loo - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_lookup_request_errors)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_lookup_request_errors)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_lookup_request_errors)); } else { $httpBody = $wt_info_genesis_lookup_request_errors; } @@ -5350,12 +6746,12 @@ public function fetchInfoGenesisLookupRequestsErrorsRequest($wt_info_genesis_loo // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5371,10 +6767,11 @@ public function fetchInfoGenesisLookupRequestsErrorsRequest($wt_info_genesis_loo $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5386,14 +6783,15 @@ public function fetchInfoGenesisLookupRequestsErrorsRequest($wt_info_genesis_loo * Fetch redeemed static vouchers * * @param \OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs $wt_info_genesis_unique_posting_ids wt_info_genesis_unique_posting_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedeemedStaticVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisRedeemedStaticVouchers($wt_info_genesis_unique_posting_ids) + public function fetchInfoGenesisRedeemedStaticVouchers($wt_info_genesis_unique_posting_ids, string $contentType = self::contentTypes['fetchInfoGenesisRedeemedStaticVouchers'][0]) { - list($response) = $this->fetchInfoGenesisRedeemedStaticVouchersWithHttpInfo($wt_info_genesis_unique_posting_ids); + list($response) = $this->fetchInfoGenesisRedeemedStaticVouchersWithHttpInfo($wt_info_genesis_unique_posting_ids, $contentType); return $response; } @@ -5403,14 +6801,15 @@ public function fetchInfoGenesisRedeemedStaticVouchers($wt_info_genesis_unique_p * Fetch redeemed static vouchers * * @param \OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs $wt_info_genesis_unique_posting_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedeemedStaticVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisRedeemedStaticVouchersWithHttpInfo($wt_info_genesis_unique_posting_ids) + public function fetchInfoGenesisRedeemedStaticVouchersWithHttpInfo($wt_info_genesis_unique_posting_ids, string $contentType = self::contentTypes['fetchInfoGenesisRedeemedStaticVouchers'][0]) { - $request = $this->fetchInfoGenesisRedeemedStaticVouchersRequest($wt_info_genesis_unique_posting_ids); + $request = $this->fetchInfoGenesisRedeemedStaticVouchersRequest($wt_info_genesis_unique_posting_ids, $contentType); try { $options = $this->createHttpClientOption(); @@ -5453,6 +6852,21 @@ public function fetchInfoGenesisRedeemedStaticVouchersWithHttpInfo($wt_info_gene $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5465,6 +6879,21 @@ public function fetchInfoGenesisRedeemedStaticVouchersWithHttpInfo($wt_info_gene $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5477,6 +6906,21 @@ public function fetchInfoGenesisRedeemedStaticVouchersWithHttpInfo($wt_info_gene $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5489,6 +6933,21 @@ public function fetchInfoGenesisRedeemedStaticVouchersWithHttpInfo($wt_info_gene $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5503,6 +6962,21 @@ public function fetchInfoGenesisRedeemedStaticVouchersWithHttpInfo($wt_info_gene $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5556,13 +7030,14 @@ public function fetchInfoGenesisRedeemedStaticVouchersWithHttpInfo($wt_info_gene * Fetch redeemed static vouchers * * @param \OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs $wt_info_genesis_unique_posting_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedeemedStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRedeemedStaticVouchersAsync($wt_info_genesis_unique_posting_ids) + public function fetchInfoGenesisRedeemedStaticVouchersAsync($wt_info_genesis_unique_posting_ids, string $contentType = self::contentTypes['fetchInfoGenesisRedeemedStaticVouchers'][0]) { - return $this->fetchInfoGenesisRedeemedStaticVouchersAsyncWithHttpInfo($wt_info_genesis_unique_posting_ids) + return $this->fetchInfoGenesisRedeemedStaticVouchersAsyncWithHttpInfo($wt_info_genesis_unique_posting_ids, $contentType) ->then( function ($response) { return $response[0]; @@ -5576,14 +7051,15 @@ function ($response) { * Fetch redeemed static vouchers * * @param \OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs $wt_info_genesis_unique_posting_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedeemedStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRedeemedStaticVouchersAsyncWithHttpInfo($wt_info_genesis_unique_posting_ids) + public function fetchInfoGenesisRedeemedStaticVouchersAsyncWithHttpInfo($wt_info_genesis_unique_posting_ids, string $contentType = self::contentTypes['fetchInfoGenesisRedeemedStaticVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucher[]'; - $request = $this->fetchInfoGenesisRedeemedStaticVouchersRequest($wt_info_genesis_unique_posting_ids); + $request = $this->fetchInfoGenesisRedeemedStaticVouchersRequest($wt_info_genesis_unique_posting_ids, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5593,6 +7069,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5622,12 +7101,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisRedeemedStaticVouchers' * * @param \OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs $wt_info_genesis_unique_posting_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedeemedStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisRedeemedStaticVouchersRequest($wt_info_genesis_unique_posting_ids) + public function fetchInfoGenesisRedeemedStaticVouchersRequest($wt_info_genesis_unique_posting_ids, string $contentType = self::contentTypes['fetchInfoGenesisRedeemedStaticVouchers'][0]) { + // verify the required parameter 'wt_info_genesis_unique_posting_ids' is set if ($wt_info_genesis_unique_posting_ids === null || (is_array($wt_info_genesis_unique_posting_ids) && count($wt_info_genesis_unique_posting_ids) === 0)) { throw new \InvalidArgumentException( @@ -5635,6 +7116,7 @@ public function fetchInfoGenesisRedeemedStaticVouchersRequest($wt_info_genesis_u ); } + $resourcePath = '/v2/pos/infogenesis/staticVouchers/redeemed'; $formParams = []; $queryParams = []; @@ -5646,21 +7128,17 @@ public function fetchInfoGenesisRedeemedStaticVouchersRequest($wt_info_genesis_u - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_unique_posting_ids)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_unique_posting_ids)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_unique_posting_ids)); } else { $httpBody = $wt_info_genesis_unique_posting_ids; } @@ -5679,12 +7157,12 @@ public function fetchInfoGenesisRedeemedStaticVouchersRequest($wt_info_genesis_u // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5700,10 +7178,11 @@ public function fetchInfoGenesisRedeemedStaticVouchersRequest($wt_info_genesis_u $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5716,14 +7195,15 @@ public function fetchInfoGenesisRedeemedStaticVouchersRequest($wt_info_genesis_u * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedeemedUniquePostingIDs'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisRedeemedUniquePostingIDs($start_date_time, $end_date_time) + public function fetchInfoGenesisRedeemedUniquePostingIDs($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisRedeemedUniquePostingIDs'][0]) { - list($response) = $this->fetchInfoGenesisRedeemedUniquePostingIDsWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchInfoGenesisRedeemedUniquePostingIDsWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -5734,14 +7214,15 @@ public function fetchInfoGenesisRedeemedUniquePostingIDs($start_date_time, $end_ * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedeemedUniquePostingIDs'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisRedeemedUniquePostingIDsWithHttpInfo($start_date_time, $end_date_time) + public function fetchInfoGenesisRedeemedUniquePostingIDsWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisRedeemedUniquePostingIDs'][0]) { - $request = $this->fetchInfoGenesisRedeemedUniquePostingIDsRequest($start_date_time, $end_date_time); + $request = $this->fetchInfoGenesisRedeemedUniquePostingIDsRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -5784,6 +7265,21 @@ public function fetchInfoGenesisRedeemedUniquePostingIDsWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5796,6 +7292,21 @@ public function fetchInfoGenesisRedeemedUniquePostingIDsWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5808,6 +7319,21 @@ public function fetchInfoGenesisRedeemedUniquePostingIDsWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5820,6 +7346,21 @@ public function fetchInfoGenesisRedeemedUniquePostingIDsWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5834,6 +7375,21 @@ public function fetchInfoGenesisRedeemedUniquePostingIDsWithHttpInfo($start_date $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5888,13 +7444,14 @@ public function fetchInfoGenesisRedeemedUniquePostingIDsWithHttpInfo($start_date * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedeemedUniquePostingIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRedeemedUniquePostingIDsAsync($start_date_time, $end_date_time) + public function fetchInfoGenesisRedeemedUniquePostingIDsAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisRedeemedUniquePostingIDs'][0]) { - return $this->fetchInfoGenesisRedeemedUniquePostingIDsAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchInfoGenesisRedeemedUniquePostingIDsAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -5909,14 +7466,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedeemedUniquePostingIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRedeemedUniquePostingIDsAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchInfoGenesisRedeemedUniquePostingIDsAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisRedeemedUniquePostingIDs'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchInfoGenesisRedeemedUniquePostingIDsRequest($start_date_time, $end_date_time); + $request = $this->fetchInfoGenesisRedeemedUniquePostingIDsRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5926,6 +7484,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5956,18 +7517,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedeemedUniquePostingIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisRedeemedUniquePostingIDsRequest($start_date_time, $end_date_time) + public function fetchInfoGenesisRedeemedUniquePostingIDsRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisRedeemedUniquePostingIDs'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchInfoGenesisRedeemedUniquePostingIDs' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -5975,6 +7539,7 @@ public function fetchInfoGenesisRedeemedUniquePostingIDsRequest($start_date_time ); } + $resourcePath = '/v2/pos/infogenesis/postingIDs/redeemed'; $formParams = []; $queryParams = []; @@ -5983,41 +7548,32 @@ public function fetchInfoGenesisRedeemedUniquePostingIDsRequest($start_date_time $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6035,12 +7591,12 @@ public function fetchInfoGenesisRedeemedUniquePostingIDsRequest($start_date_time // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6056,10 +7612,11 @@ public function fetchInfoGenesisRedeemedUniquePostingIDsRequest($start_date_time $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6071,14 +7628,15 @@ public function fetchInfoGenesisRedeemedUniquePostingIDsRequest($start_date_time * Fetch InfoGenesis redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisRedemptions($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisRedemptions($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisRedemptions'][0]) { - list($response) = $this->fetchInfoGenesisRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->fetchInfoGenesisRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -6088,14 +7646,15 @@ public function fetchInfoGenesisRedemptions($wt_info_genesis_record_filter_param * Fetch InfoGenesis redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedemptions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisRedemptionsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisRedemptions'][0]) { - $request = $this->fetchInfoGenesisRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->fetchInfoGenesisRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -6138,6 +7697,21 @@ public function fetchInfoGenesisRedemptionsWithHttpInfo($wt_info_genesis_record_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Request[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6150,6 +7724,21 @@ public function fetchInfoGenesisRedemptionsWithHttpInfo($wt_info_genesis_record_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6162,6 +7751,21 @@ public function fetchInfoGenesisRedemptionsWithHttpInfo($wt_info_genesis_record_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6174,6 +7778,21 @@ public function fetchInfoGenesisRedemptionsWithHttpInfo($wt_info_genesis_record_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6188,6 +7807,21 @@ public function fetchInfoGenesisRedemptionsWithHttpInfo($wt_info_genesis_record_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6241,13 +7875,14 @@ public function fetchInfoGenesisRedemptionsWithHttpInfo($wt_info_genesis_record_ * Fetch InfoGenesis redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRedemptionsAsync($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisRedemptionsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisRedemptions'][0]) { - return $this->fetchInfoGenesisRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->fetchInfoGenesisRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -6261,14 +7896,15 @@ function ($response) { * Fetch InfoGenesis redemptions * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisRedemptionsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisRedemptions'][0]) { $returnType = '\OpenAPI\Client\Model\Request[]'; - $request = $this->fetchInfoGenesisRedemptionsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->fetchInfoGenesisRedemptionsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6278,6 +7914,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6307,12 +7946,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisRedemptions' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRedemptions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisRedemptionsRequest($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisRedemptionsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisRedemptions'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -6320,6 +7961,7 @@ public function fetchInfoGenesisRedemptionsRequest($wt_info_genesis_record_filte ); } + $resourcePath = '/v2/pos/infogenesis/redemptions'; $formParams = []; $queryParams = []; @@ -6331,21 +7973,17 @@ public function fetchInfoGenesisRedemptionsRequest($wt_info_genesis_record_filte - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -6364,12 +8002,12 @@ public function fetchInfoGenesisRedemptionsRequest($wt_info_genesis_record_filte // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6385,10 +8023,11 @@ public function fetchInfoGenesisRedemptionsRequest($wt_info_genesis_record_filte $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6401,14 +8040,15 @@ public function fetchInfoGenesisRedemptionsRequest($wt_info_genesis_record_filte * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefundedRoutingIDs'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisRefundedRoutingIDs($start_date_time, $end_date_time) + public function fetchInfoGenesisRefundedRoutingIDs($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisRefundedRoutingIDs'][0]) { - list($response) = $this->fetchInfoGenesisRefundedRoutingIDsWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchInfoGenesisRefundedRoutingIDsWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -6419,14 +8059,15 @@ public function fetchInfoGenesisRefundedRoutingIDs($start_date_time, $end_date_t * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefundedRoutingIDs'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisRefundedRoutingIDsWithHttpInfo($start_date_time, $end_date_time) + public function fetchInfoGenesisRefundedRoutingIDsWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisRefundedRoutingIDs'][0]) { - $request = $this->fetchInfoGenesisRefundedRoutingIDsRequest($start_date_time, $end_date_time); + $request = $this->fetchInfoGenesisRefundedRoutingIDsRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -6469,6 +8110,21 @@ public function fetchInfoGenesisRefundedRoutingIDsWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6481,6 +8137,21 @@ public function fetchInfoGenesisRefundedRoutingIDsWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6493,6 +8164,21 @@ public function fetchInfoGenesisRefundedRoutingIDsWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6505,6 +8191,21 @@ public function fetchInfoGenesisRefundedRoutingIDsWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6519,6 +8220,21 @@ public function fetchInfoGenesisRefundedRoutingIDsWithHttpInfo($start_date_time, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6573,13 +8289,14 @@ public function fetchInfoGenesisRefundedRoutingIDsWithHttpInfo($start_date_time, * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefundedRoutingIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRefundedRoutingIDsAsync($start_date_time, $end_date_time) + public function fetchInfoGenesisRefundedRoutingIDsAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisRefundedRoutingIDs'][0]) { - return $this->fetchInfoGenesisRefundedRoutingIDsAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchInfoGenesisRefundedRoutingIDsAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -6594,14 +8311,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefundedRoutingIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRefundedRoutingIDsAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchInfoGenesisRefundedRoutingIDsAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisRefundedRoutingIDs'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchInfoGenesisRefundedRoutingIDsRequest($start_date_time, $end_date_time); + $request = $this->fetchInfoGenesisRefundedRoutingIDsRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6611,6 +8329,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6641,18 +8362,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefundedRoutingIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisRefundedRoutingIDsRequest($start_date_time, $end_date_time) + public function fetchInfoGenesisRefundedRoutingIDsRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisRefundedRoutingIDs'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchInfoGenesisRefundedRoutingIDs' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -6660,6 +8384,7 @@ public function fetchInfoGenesisRefundedRoutingIDsRequest($start_date_time, $end ); } + $resourcePath = '/v2/pos/infogenesis/routingIDs/refunded'; $formParams = []; $queryParams = []; @@ -6668,41 +8393,32 @@ public function fetchInfoGenesisRefundedRoutingIDsRequest($start_date_time, $end $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6720,12 +8436,12 @@ public function fetchInfoGenesisRefundedRoutingIDsRequest($start_date_time, $end // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6741,10 +8457,11 @@ public function fetchInfoGenesisRefundedRoutingIDsRequest($start_date_time, $end $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6756,14 +8473,15 @@ public function fetchInfoGenesisRefundedRoutingIDsRequest($start_date_time, $end * Fetch refunded static vouchers * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefundedStaticVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisRefundedStaticVouchers($wt_info_genesis_routing_ids) + public function fetchInfoGenesisRefundedStaticVouchers($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisRefundedStaticVouchers'][0]) { - list($response) = $this->fetchInfoGenesisRefundedStaticVouchersWithHttpInfo($wt_info_genesis_routing_ids); + list($response) = $this->fetchInfoGenesisRefundedStaticVouchersWithHttpInfo($wt_info_genesis_routing_ids, $contentType); return $response; } @@ -6773,14 +8491,15 @@ public function fetchInfoGenesisRefundedStaticVouchers($wt_info_genesis_routing_ * Fetch refunded static vouchers * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefundedStaticVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisRefundedStaticVouchersWithHttpInfo($wt_info_genesis_routing_ids) + public function fetchInfoGenesisRefundedStaticVouchersWithHttpInfo($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisRefundedStaticVouchers'][0]) { - $request = $this->fetchInfoGenesisRefundedStaticVouchersRequest($wt_info_genesis_routing_ids); + $request = $this->fetchInfoGenesisRefundedStaticVouchersRequest($wt_info_genesis_routing_ids, $contentType); try { $options = $this->createHttpClientOption(); @@ -6823,6 +8542,21 @@ public function fetchInfoGenesisRefundedStaticVouchersWithHttpInfo($wt_info_gene $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6835,6 +8569,21 @@ public function fetchInfoGenesisRefundedStaticVouchersWithHttpInfo($wt_info_gene $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6847,6 +8596,21 @@ public function fetchInfoGenesisRefundedStaticVouchersWithHttpInfo($wt_info_gene $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6859,6 +8623,21 @@ public function fetchInfoGenesisRefundedStaticVouchersWithHttpInfo($wt_info_gene $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6873,6 +8652,21 @@ public function fetchInfoGenesisRefundedStaticVouchersWithHttpInfo($wt_info_gene $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6926,13 +8720,14 @@ public function fetchInfoGenesisRefundedStaticVouchersWithHttpInfo($wt_info_gene * Fetch refunded static vouchers * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefundedStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRefundedStaticVouchersAsync($wt_info_genesis_routing_ids) + public function fetchInfoGenesisRefundedStaticVouchersAsync($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisRefundedStaticVouchers'][0]) { - return $this->fetchInfoGenesisRefundedStaticVouchersAsyncWithHttpInfo($wt_info_genesis_routing_ids) + return $this->fetchInfoGenesisRefundedStaticVouchersAsyncWithHttpInfo($wt_info_genesis_routing_ids, $contentType) ->then( function ($response) { return $response[0]; @@ -6946,14 +8741,15 @@ function ($response) { * Fetch refunded static vouchers * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefundedStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRefundedStaticVouchersAsyncWithHttpInfo($wt_info_genesis_routing_ids) + public function fetchInfoGenesisRefundedStaticVouchersAsyncWithHttpInfo($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisRefundedStaticVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucher[]'; - $request = $this->fetchInfoGenesisRefundedStaticVouchersRequest($wt_info_genesis_routing_ids); + $request = $this->fetchInfoGenesisRefundedStaticVouchersRequest($wt_info_genesis_routing_ids, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6963,6 +8759,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6992,12 +8791,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisRefundedStaticVouchers' * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefundedStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisRefundedStaticVouchersRequest($wt_info_genesis_routing_ids) + public function fetchInfoGenesisRefundedStaticVouchersRequest($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisRefundedStaticVouchers'][0]) { + // verify the required parameter 'wt_info_genesis_routing_ids' is set if ($wt_info_genesis_routing_ids === null || (is_array($wt_info_genesis_routing_ids) && count($wt_info_genesis_routing_ids) === 0)) { throw new \InvalidArgumentException( @@ -7005,6 +8806,7 @@ public function fetchInfoGenesisRefundedStaticVouchersRequest($wt_info_genesis_r ); } + $resourcePath = '/v2/pos/infogenesis/staticVouchers/refunded'; $formParams = []; $queryParams = []; @@ -7016,21 +8818,17 @@ public function fetchInfoGenesisRefundedStaticVouchersRequest($wt_info_genesis_r - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_routing_ids)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_routing_ids)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_routing_ids)); } else { $httpBody = $wt_info_genesis_routing_ids; } @@ -7049,12 +8847,12 @@ public function fetchInfoGenesisRefundedStaticVouchersRequest($wt_info_genesis_r // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7070,10 +8868,11 @@ public function fetchInfoGenesisRefundedStaticVouchersRequest($wt_info_genesis_r $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7085,14 +8884,15 @@ public function fetchInfoGenesisRefundedStaticVouchersRequest($wt_info_genesis_r * Fetch InfoGenesis refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisRefunds($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisRefunds($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisRefunds'][0]) { - list($response) = $this->fetchInfoGenesisRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters); + list($response) = $this->fetchInfoGenesisRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType); return $response; } @@ -7102,14 +8902,15 @@ public function fetchInfoGenesisRefunds($wt_info_genesis_record_filter_parameter * Fetch InfoGenesis refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefunds'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisRefundsWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisRefunds'][0]) { - $request = $this->fetchInfoGenesisRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->fetchInfoGenesisRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); try { $options = $this->createHttpClientOption(); @@ -7152,6 +8953,21 @@ public function fetchInfoGenesisRefundsWithHttpInfo($wt_info_genesis_record_filt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Request[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7164,6 +8980,21 @@ public function fetchInfoGenesisRefundsWithHttpInfo($wt_info_genesis_record_filt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7176,6 +9007,21 @@ public function fetchInfoGenesisRefundsWithHttpInfo($wt_info_genesis_record_filt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7188,6 +9034,21 @@ public function fetchInfoGenesisRefundsWithHttpInfo($wt_info_genesis_record_filt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7202,6 +9063,21 @@ public function fetchInfoGenesisRefundsWithHttpInfo($wt_info_genesis_record_filt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7255,13 +9131,14 @@ public function fetchInfoGenesisRefundsWithHttpInfo($wt_info_genesis_record_filt * Fetch InfoGenesis refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRefundsAsync($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisRefundsAsync($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisRefunds'][0]) { - return $this->fetchInfoGenesisRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + return $this->fetchInfoGenesisRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, $contentType) ->then( function ($response) { return $response[0]; @@ -7275,14 +9152,15 @@ function ($response) { * Fetch InfoGenesis refunds * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisRefundsAsyncWithHttpInfo($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisRefunds'][0]) { $returnType = '\OpenAPI\Client\Model\Request[]'; - $request = $this->fetchInfoGenesisRefundsRequest($wt_info_genesis_record_filter_parameters); + $request = $this->fetchInfoGenesisRefundsRequest($wt_info_genesis_record_filter_parameters, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7292,6 +9170,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7321,12 +9202,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisRefunds' * * @param \OpenAPI\Client\Model\WTInfoGenesisRecordFilterParameters $wt_info_genesis_record_filter_parameters (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRefunds'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisRefundsRequest($wt_info_genesis_record_filter_parameters) + public function fetchInfoGenesisRefundsRequest($wt_info_genesis_record_filter_parameters, string $contentType = self::contentTypes['fetchInfoGenesisRefunds'][0]) { + // verify the required parameter 'wt_info_genesis_record_filter_parameters' is set if ($wt_info_genesis_record_filter_parameters === null || (is_array($wt_info_genesis_record_filter_parameters) && count($wt_info_genesis_record_filter_parameters) === 0)) { throw new \InvalidArgumentException( @@ -7334,6 +9217,7 @@ public function fetchInfoGenesisRefundsRequest($wt_info_genesis_record_filter_pa ); } + $resourcePath = '/v2/pos/infogenesis/refunds'; $formParams = []; $queryParams = []; @@ -7345,21 +9229,17 @@ public function fetchInfoGenesisRefundsRequest($wt_info_genesis_record_filter_pa - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_record_filter_parameters)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_record_filter_parameters)); } else { $httpBody = $wt_info_genesis_record_filter_parameters; } @@ -7378,12 +9258,12 @@ public function fetchInfoGenesisRefundsRequest($wt_info_genesis_record_filter_pa // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7399,10 +9279,11 @@ public function fetchInfoGenesisRefundsRequest($wt_info_genesis_record_filter_pa $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7414,14 +9295,15 @@ public function fetchInfoGenesisRefundsRequest($wt_info_genesis_record_filter_pa * Fetch InfoGenesis request with transaction ID * * @param string $transaction_id transaction_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRequest'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Request|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisRequest($transaction_id) + public function fetchInfoGenesisRequest($transaction_id, string $contentType = self::contentTypes['fetchInfoGenesisRequest'][0]) { - list($response) = $this->fetchInfoGenesisRequestWithHttpInfo($transaction_id); + list($response) = $this->fetchInfoGenesisRequestWithHttpInfo($transaction_id, $contentType); return $response; } @@ -7431,14 +9313,15 @@ public function fetchInfoGenesisRequest($transaction_id) * Fetch InfoGenesis request with transaction ID * * @param string $transaction_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRequest'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Request|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisRequestWithHttpInfo($transaction_id) + public function fetchInfoGenesisRequestWithHttpInfo($transaction_id, string $contentType = self::contentTypes['fetchInfoGenesisRequest'][0]) { - $request = $this->fetchInfoGenesisRequestRequest($transaction_id); + $request = $this->fetchInfoGenesisRequestRequest($transaction_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -7481,6 +9364,21 @@ public function fetchInfoGenesisRequestWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Request' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7493,6 +9391,21 @@ public function fetchInfoGenesisRequestWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7505,6 +9418,21 @@ public function fetchInfoGenesisRequestWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7517,6 +9445,21 @@ public function fetchInfoGenesisRequestWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7531,6 +9474,21 @@ public function fetchInfoGenesisRequestWithHttpInfo($transaction_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7584,13 +9542,14 @@ public function fetchInfoGenesisRequestWithHttpInfo($transaction_id) * Fetch InfoGenesis request with transaction ID * * @param string $transaction_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRequest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRequestAsync($transaction_id) + public function fetchInfoGenesisRequestAsync($transaction_id, string $contentType = self::contentTypes['fetchInfoGenesisRequest'][0]) { - return $this->fetchInfoGenesisRequestAsyncWithHttpInfo($transaction_id) + return $this->fetchInfoGenesisRequestAsyncWithHttpInfo($transaction_id, $contentType) ->then( function ($response) { return $response[0]; @@ -7604,14 +9563,15 @@ function ($response) { * Fetch InfoGenesis request with transaction ID * * @param string $transaction_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRequest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRequestAsyncWithHttpInfo($transaction_id) + public function fetchInfoGenesisRequestAsyncWithHttpInfo($transaction_id, string $contentType = self::contentTypes['fetchInfoGenesisRequest'][0]) { $returnType = '\OpenAPI\Client\Model\Request'; - $request = $this->fetchInfoGenesisRequestRequest($transaction_id); + $request = $this->fetchInfoGenesisRequestRequest($transaction_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7621,6 +9581,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7650,12 +9613,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisRequest' * * @param string $transaction_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRequest'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisRequestRequest($transaction_id) + public function fetchInfoGenesisRequestRequest($transaction_id, string $contentType = self::contentTypes['fetchInfoGenesisRequest'][0]) { + // verify the required parameter 'transaction_id' is set if ($transaction_id === null || (is_array($transaction_id) && count($transaction_id) === 0)) { throw new \InvalidArgumentException( @@ -7663,6 +9628,7 @@ public function fetchInfoGenesisRequestRequest($transaction_id) ); } + $resourcePath = '/v2/pos/infogenesis/request/{transactionID}'; $formParams = []; $queryParams = []; @@ -7682,16 +9648,11 @@ public function fetchInfoGenesisRequestRequest($transaction_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -7709,12 +9670,12 @@ public function fetchInfoGenesisRequestRequest($transaction_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7730,10 +9691,11 @@ public function fetchInfoGenesisRequestRequest($transaction_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7745,14 +9707,15 @@ public function fetchInfoGenesisRequestRequest($transaction_id) * Fetch InfoGenesis requests with routing IDs * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisRequests($wt_info_genesis_routing_ids) + public function fetchInfoGenesisRequests($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisRequests'][0]) { - list($response) = $this->fetchInfoGenesisRequestsWithHttpInfo($wt_info_genesis_routing_ids); + list($response) = $this->fetchInfoGenesisRequestsWithHttpInfo($wt_info_genesis_routing_ids, $contentType); return $response; } @@ -7762,14 +9725,15 @@ public function fetchInfoGenesisRequests($wt_info_genesis_routing_ids) * Fetch InfoGenesis requests with routing IDs * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisRequestsWithHttpInfo($wt_info_genesis_routing_ids) + public function fetchInfoGenesisRequestsWithHttpInfo($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisRequests'][0]) { - $request = $this->fetchInfoGenesisRequestsRequest($wt_info_genesis_routing_ids); + $request = $this->fetchInfoGenesisRequestsRequest($wt_info_genesis_routing_ids, $contentType); try { $options = $this->createHttpClientOption(); @@ -7812,6 +9776,21 @@ public function fetchInfoGenesisRequestsWithHttpInfo($wt_info_genesis_routing_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Request[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7824,6 +9803,21 @@ public function fetchInfoGenesisRequestsWithHttpInfo($wt_info_genesis_routing_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7836,6 +9830,21 @@ public function fetchInfoGenesisRequestsWithHttpInfo($wt_info_genesis_routing_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7848,6 +9857,21 @@ public function fetchInfoGenesisRequestsWithHttpInfo($wt_info_genesis_routing_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7862,6 +9886,21 @@ public function fetchInfoGenesisRequestsWithHttpInfo($wt_info_genesis_routing_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7915,13 +9954,14 @@ public function fetchInfoGenesisRequestsWithHttpInfo($wt_info_genesis_routing_id * Fetch InfoGenesis requests with routing IDs * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRequestsAsync($wt_info_genesis_routing_ids) + public function fetchInfoGenesisRequestsAsync($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisRequests'][0]) { - return $this->fetchInfoGenesisRequestsAsyncWithHttpInfo($wt_info_genesis_routing_ids) + return $this->fetchInfoGenesisRequestsAsyncWithHttpInfo($wt_info_genesis_routing_ids, $contentType) ->then( function ($response) { return $response[0]; @@ -7935,14 +9975,15 @@ function ($response) { * Fetch InfoGenesis requests with routing IDs * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisRequestsAsyncWithHttpInfo($wt_info_genesis_routing_ids) + public function fetchInfoGenesisRequestsAsyncWithHttpInfo($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisRequests'][0]) { $returnType = '\OpenAPI\Client\Model\Request[]'; - $request = $this->fetchInfoGenesisRequestsRequest($wt_info_genesis_routing_ids); + $request = $this->fetchInfoGenesisRequestsRequest($wt_info_genesis_routing_ids, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7952,6 +9993,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7981,12 +10025,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisRequests' * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisRequestsRequest($wt_info_genesis_routing_ids) + public function fetchInfoGenesisRequestsRequest($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisRequests'][0]) { + // verify the required parameter 'wt_info_genesis_routing_ids' is set if ($wt_info_genesis_routing_ids === null || (is_array($wt_info_genesis_routing_ids) && count($wt_info_genesis_routing_ids) === 0)) { throw new \InvalidArgumentException( @@ -7994,6 +10040,7 @@ public function fetchInfoGenesisRequestsRequest($wt_info_genesis_routing_ids) ); } + $resourcePath = '/v2/pos/infogenesis/requests'; $formParams = []; $queryParams = []; @@ -8005,21 +10052,17 @@ public function fetchInfoGenesisRequestsRequest($wt_info_genesis_routing_ids) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_routing_ids)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_routing_ids)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_routing_ids)); } else { $httpBody = $wt_info_genesis_routing_ids; } @@ -8038,12 +10081,12 @@ public function fetchInfoGenesisRequestsRequest($wt_info_genesis_routing_ids) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8059,10 +10102,11 @@ public function fetchInfoGenesisRequestsRequest($wt_info_genesis_routing_ids) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8075,14 +10119,15 @@ public function fetchInfoGenesisRequestsRequest($wt_info_genesis_routing_ids) * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisResponseErrors'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Response[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisResponseErrors($start_date_time, $end_date_time) + public function fetchInfoGenesisResponseErrors($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisResponseErrors'][0]) { - list($response) = $this->fetchInfoGenesisResponseErrorsWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchInfoGenesisResponseErrorsWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -8093,14 +10138,15 @@ public function fetchInfoGenesisResponseErrors($start_date_time, $end_date_time) * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisResponseErrors'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Response[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisResponseErrorsWithHttpInfo($start_date_time, $end_date_time) + public function fetchInfoGenesisResponseErrorsWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisResponseErrors'][0]) { - $request = $this->fetchInfoGenesisResponseErrorsRequest($start_date_time, $end_date_time); + $request = $this->fetchInfoGenesisResponseErrorsRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -8143,6 +10189,21 @@ public function fetchInfoGenesisResponseErrorsWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Response[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8155,6 +10216,21 @@ public function fetchInfoGenesisResponseErrorsWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8167,6 +10243,21 @@ public function fetchInfoGenesisResponseErrorsWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8179,6 +10270,21 @@ public function fetchInfoGenesisResponseErrorsWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8193,6 +10299,21 @@ public function fetchInfoGenesisResponseErrorsWithHttpInfo($start_date_time, $en $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8247,13 +10368,14 @@ public function fetchInfoGenesisResponseErrorsWithHttpInfo($start_date_time, $en * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisResponseErrors'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisResponseErrorsAsync($start_date_time, $end_date_time) + public function fetchInfoGenesisResponseErrorsAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisResponseErrors'][0]) { - return $this->fetchInfoGenesisResponseErrorsAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchInfoGenesisResponseErrorsAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -8268,14 +10390,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisResponseErrors'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisResponseErrorsAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchInfoGenesisResponseErrorsAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisResponseErrors'][0]) { $returnType = '\OpenAPI\Client\Model\Response[]'; - $request = $this->fetchInfoGenesisResponseErrorsRequest($start_date_time, $end_date_time); + $request = $this->fetchInfoGenesisResponseErrorsRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8285,6 +10408,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8315,18 +10441,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisResponseErrors'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisResponseErrorsRequest($start_date_time, $end_date_time) + public function fetchInfoGenesisResponseErrorsRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchInfoGenesisResponseErrors'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchInfoGenesisResponseErrors' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -8334,6 +10463,7 @@ public function fetchInfoGenesisResponseErrorsRequest($start_date_time, $end_dat ); } + $resourcePath = '/v2/pos/infogenesis/responses/errors'; $formParams = []; $queryParams = []; @@ -8342,41 +10472,32 @@ public function fetchInfoGenesisResponseErrorsRequest($start_date_time, $end_dat $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -8394,12 +10515,12 @@ public function fetchInfoGenesisResponseErrorsRequest($start_date_time, $end_dat // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8415,10 +10536,11 @@ public function fetchInfoGenesisResponseErrorsRequest($start_date_time, $end_dat $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8430,14 +10552,15 @@ public function fetchInfoGenesisResponseErrorsRequest($start_date_time, $end_dat * Fetch InfoGenesis responses with routing IDs * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisResponses'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Response[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisResponses($wt_info_genesis_routing_ids) + public function fetchInfoGenesisResponses($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisResponses'][0]) { - list($response) = $this->fetchInfoGenesisResponsesWithHttpInfo($wt_info_genesis_routing_ids); + list($response) = $this->fetchInfoGenesisResponsesWithHttpInfo($wt_info_genesis_routing_ids, $contentType); return $response; } @@ -8447,14 +10570,15 @@ public function fetchInfoGenesisResponses($wt_info_genesis_routing_ids) * Fetch InfoGenesis responses with routing IDs * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisResponses'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Response[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisResponsesWithHttpInfo($wt_info_genesis_routing_ids) + public function fetchInfoGenesisResponsesWithHttpInfo($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisResponses'][0]) { - $request = $this->fetchInfoGenesisResponsesRequest($wt_info_genesis_routing_ids); + $request = $this->fetchInfoGenesisResponsesRequest($wt_info_genesis_routing_ids, $contentType); try { $options = $this->createHttpClientOption(); @@ -8497,6 +10621,21 @@ public function fetchInfoGenesisResponsesWithHttpInfo($wt_info_genesis_routing_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Response[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8509,6 +10648,21 @@ public function fetchInfoGenesisResponsesWithHttpInfo($wt_info_genesis_routing_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8521,6 +10675,21 @@ public function fetchInfoGenesisResponsesWithHttpInfo($wt_info_genesis_routing_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8533,6 +10702,21 @@ public function fetchInfoGenesisResponsesWithHttpInfo($wt_info_genesis_routing_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8547,6 +10731,21 @@ public function fetchInfoGenesisResponsesWithHttpInfo($wt_info_genesis_routing_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8600,13 +10799,14 @@ public function fetchInfoGenesisResponsesWithHttpInfo($wt_info_genesis_routing_i * Fetch InfoGenesis responses with routing IDs * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisResponses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisResponsesAsync($wt_info_genesis_routing_ids) + public function fetchInfoGenesisResponsesAsync($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisResponses'][0]) { - return $this->fetchInfoGenesisResponsesAsyncWithHttpInfo($wt_info_genesis_routing_ids) + return $this->fetchInfoGenesisResponsesAsyncWithHttpInfo($wt_info_genesis_routing_ids, $contentType) ->then( function ($response) { return $response[0]; @@ -8620,14 +10820,15 @@ function ($response) { * Fetch InfoGenesis responses with routing IDs * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisResponses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisResponsesAsyncWithHttpInfo($wt_info_genesis_routing_ids) + public function fetchInfoGenesisResponsesAsyncWithHttpInfo($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisResponses'][0]) { $returnType = '\OpenAPI\Client\Model\Response[]'; - $request = $this->fetchInfoGenesisResponsesRequest($wt_info_genesis_routing_ids); + $request = $this->fetchInfoGenesisResponsesRequest($wt_info_genesis_routing_ids, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8637,6 +10838,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8666,12 +10870,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisResponses' * * @param \OpenAPI\Client\Model\WTInfoGenesisRoutingIDs $wt_info_genesis_routing_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisResponses'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisResponsesRequest($wt_info_genesis_routing_ids) + public function fetchInfoGenesisResponsesRequest($wt_info_genesis_routing_ids, string $contentType = self::contentTypes['fetchInfoGenesisResponses'][0]) { + // verify the required parameter 'wt_info_genesis_routing_ids' is set if ($wt_info_genesis_routing_ids === null || (is_array($wt_info_genesis_routing_ids) && count($wt_info_genesis_routing_ids) === 0)) { throw new \InvalidArgumentException( @@ -8679,6 +10885,7 @@ public function fetchInfoGenesisResponsesRequest($wt_info_genesis_routing_ids) ); } + $resourcePath = '/v2/pos/infogenesis/responses'; $formParams = []; $queryParams = []; @@ -8690,21 +10897,17 @@ public function fetchInfoGenesisResponsesRequest($wt_info_genesis_routing_ids) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_routing_ids)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_routing_ids)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_routing_ids)); } else { $httpBody = $wt_info_genesis_routing_ids; } @@ -8723,12 +10926,12 @@ public function fetchInfoGenesisResponsesRequest($wt_info_genesis_routing_ids) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8744,10 +10947,11 @@ public function fetchInfoGenesisResponsesRequest($wt_info_genesis_routing_ids) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8759,14 +10963,15 @@ public function fetchInfoGenesisResponsesRequest($wt_info_genesis_routing_ids) * Fetch InfoGenesis transactions * * @param \OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs $wt_info_genesis_unique_posting_ids wt_info_genesis_unique_posting_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisTransactionsWithUniquePostingIDs'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInfoGenesisTransactionsWithUniquePostingIDs($wt_info_genesis_unique_posting_ids) + public function fetchInfoGenesisTransactionsWithUniquePostingIDs($wt_info_genesis_unique_posting_ids, string $contentType = self::contentTypes['fetchInfoGenesisTransactionsWithUniquePostingIDs'][0]) { - list($response) = $this->fetchInfoGenesisTransactionsWithUniquePostingIDsWithHttpInfo($wt_info_genesis_unique_posting_ids); + list($response) = $this->fetchInfoGenesisTransactionsWithUniquePostingIDsWithHttpInfo($wt_info_genesis_unique_posting_ids, $contentType); return $response; } @@ -8776,14 +10981,15 @@ public function fetchInfoGenesisTransactionsWithUniquePostingIDs($wt_info_genesi * Fetch InfoGenesis transactions * * @param \OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs $wt_info_genesis_unique_posting_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisTransactionsWithUniquePostingIDs'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Request[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInfoGenesisTransactionsWithUniquePostingIDsWithHttpInfo($wt_info_genesis_unique_posting_ids) + public function fetchInfoGenesisTransactionsWithUniquePostingIDsWithHttpInfo($wt_info_genesis_unique_posting_ids, string $contentType = self::contentTypes['fetchInfoGenesisTransactionsWithUniquePostingIDs'][0]) { - $request = $this->fetchInfoGenesisTransactionsWithUniquePostingIDsRequest($wt_info_genesis_unique_posting_ids); + $request = $this->fetchInfoGenesisTransactionsWithUniquePostingIDsRequest($wt_info_genesis_unique_posting_ids, $contentType); try { $options = $this->createHttpClientOption(); @@ -8826,6 +11032,21 @@ public function fetchInfoGenesisTransactionsWithUniquePostingIDsWithHttpInfo($wt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Request[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8838,6 +11059,21 @@ public function fetchInfoGenesisTransactionsWithUniquePostingIDsWithHttpInfo($wt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8850,6 +11086,21 @@ public function fetchInfoGenesisTransactionsWithUniquePostingIDsWithHttpInfo($wt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8862,6 +11113,21 @@ public function fetchInfoGenesisTransactionsWithUniquePostingIDsWithHttpInfo($wt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8876,6 +11142,21 @@ public function fetchInfoGenesisTransactionsWithUniquePostingIDsWithHttpInfo($wt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8929,13 +11210,14 @@ public function fetchInfoGenesisTransactionsWithUniquePostingIDsWithHttpInfo($wt * Fetch InfoGenesis transactions * * @param \OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs $wt_info_genesis_unique_posting_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisTransactionsWithUniquePostingIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisTransactionsWithUniquePostingIDsAsync($wt_info_genesis_unique_posting_ids) + public function fetchInfoGenesisTransactionsWithUniquePostingIDsAsync($wt_info_genesis_unique_posting_ids, string $contentType = self::contentTypes['fetchInfoGenesisTransactionsWithUniquePostingIDs'][0]) { - return $this->fetchInfoGenesisTransactionsWithUniquePostingIDsAsyncWithHttpInfo($wt_info_genesis_unique_posting_ids) + return $this->fetchInfoGenesisTransactionsWithUniquePostingIDsAsyncWithHttpInfo($wt_info_genesis_unique_posting_ids, $contentType) ->then( function ($response) { return $response[0]; @@ -8949,14 +11231,15 @@ function ($response) { * Fetch InfoGenesis transactions * * @param \OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs $wt_info_genesis_unique_posting_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisTransactionsWithUniquePostingIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInfoGenesisTransactionsWithUniquePostingIDsAsyncWithHttpInfo($wt_info_genesis_unique_posting_ids) + public function fetchInfoGenesisTransactionsWithUniquePostingIDsAsyncWithHttpInfo($wt_info_genesis_unique_posting_ids, string $contentType = self::contentTypes['fetchInfoGenesisTransactionsWithUniquePostingIDs'][0]) { $returnType = '\OpenAPI\Client\Model\Request[]'; - $request = $this->fetchInfoGenesisTransactionsWithUniquePostingIDsRequest($wt_info_genesis_unique_posting_ids); + $request = $this->fetchInfoGenesisTransactionsWithUniquePostingIDsRequest($wt_info_genesis_unique_posting_ids, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8966,6 +11249,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8995,12 +11281,14 @@ function ($exception) { * Create request for operation 'fetchInfoGenesisTransactionsWithUniquePostingIDs' * * @param \OpenAPI\Client\Model\WTInfoGenesisUniquePostingIDs $wt_info_genesis_unique_posting_ids (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInfoGenesisTransactionsWithUniquePostingIDs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInfoGenesisTransactionsWithUniquePostingIDsRequest($wt_info_genesis_unique_posting_ids) + public function fetchInfoGenesisTransactionsWithUniquePostingIDsRequest($wt_info_genesis_unique_posting_ids, string $contentType = self::contentTypes['fetchInfoGenesisTransactionsWithUniquePostingIDs'][0]) { + // verify the required parameter 'wt_info_genesis_unique_posting_ids' is set if ($wt_info_genesis_unique_posting_ids === null || (is_array($wt_info_genesis_unique_posting_ids) && count($wt_info_genesis_unique_posting_ids) === 0)) { throw new \InvalidArgumentException( @@ -9008,6 +11296,7 @@ public function fetchInfoGenesisTransactionsWithUniquePostingIDsRequest($wt_info ); } + $resourcePath = '/v2/pos/infogenesis/transactions'; $formParams = []; $queryParams = []; @@ -9019,21 +11308,17 @@ public function fetchInfoGenesisTransactionsWithUniquePostingIDsRequest($wt_info - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_info_genesis_unique_posting_ids)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_unique_posting_ids)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_info_genesis_unique_posting_ids)); } else { $httpBody = $wt_info_genesis_unique_posting_ids; } @@ -9052,12 +11337,12 @@ public function fetchInfoGenesisTransactionsWithUniquePostingIDsRequest($wt_info // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -9073,10 +11358,11 @@ public function fetchInfoGenesisTransactionsWithUniquePostingIDsRequest($wt_info $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/IntegratedTerminalsApi.php b/lib/Api/IntegratedTerminalsApi.php index 62716c3..349ad9d 100644 --- a/lib/Api/IntegratedTerminalsApi.php +++ b/lib/Api/IntegratedTerminalsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createPOSMachine' => [ + 'application/json', + ], + 'fetchAllPOSMachines' => [ + 'application/json', + ], + 'restorePOSMachine' => [ + 'application/json', + ], + 'updatePOSMachine' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive POS machine * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePOSMachine'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTPosMachine|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archivePOSMachine($id) + public function archivePOSMachine($id, string $contentType = self::contentTypes['archivePOSMachine'][0]) { - list($response) = $this->archivePOSMachineWithHttpInfo($id); + list($response) = $this->archivePOSMachineWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archivePOSMachine($id) * Archive POS machine * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePOSMachine'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTPosMachine|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archivePOSMachineWithHttpInfo($id) + public function archivePOSMachineWithHttpInfo($id, string $contentType = self::contentTypes['archivePOSMachine'][0]) { - $request = $this->archivePOSMachineRequest($id); + $request = $this->archivePOSMachineRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archivePOSMachineWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTPosMachine' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archivePOSMachineWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archivePOSMachineWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archivePOSMachineWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archivePOSMachineWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archivePOSMachineWithHttpInfo($id) * Archive POS machine * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePOSMachineAsync($id) + public function archivePOSMachineAsync($id, string $contentType = self::contentTypes['archivePOSMachine'][0]) { - return $this->archivePOSMachineAsyncWithHttpInfo($id) + return $this->archivePOSMachineAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive POS machine * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePOSMachineAsyncWithHttpInfo($id) + public function archivePOSMachineAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archivePOSMachine'][0]) { $returnType = '\OpenAPI\Client\Model\WTPosMachine'; - $request = $this->archivePOSMachineRequest($id); + $request = $this->archivePOSMachineRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archivePOSMachine' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archivePOSMachineRequest($id) + public function archivePOSMachineRequest($id, string $contentType = self::contentTypes['archivePOSMachine'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archivePOSMachineRequest($id) ); } + $resourcePath = '/v2/pos/machine/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archivePOSMachineRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archivePOSMachineRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archivePOSMachineRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archivePOSMachineRequest($id) * Create POS machine * * @param \OpenAPI\Client\Model\WTPosMachineCreateParams $wt_pos_machine_create_params wt_pos_machine_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPOSMachine'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTPosMachine|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createPOSMachine($wt_pos_machine_create_params) + public function createPOSMachine($wt_pos_machine_create_params, string $contentType = self::contentTypes['createPOSMachine'][0]) { - list($response) = $this->createPOSMachineWithHttpInfo($wt_pos_machine_create_params); + list($response) = $this->createPOSMachineWithHttpInfo($wt_pos_machine_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createPOSMachine($wt_pos_machine_create_params) * Create POS machine * * @param \OpenAPI\Client\Model\WTPosMachineCreateParams $wt_pos_machine_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPOSMachine'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTPosMachine|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createPOSMachineWithHttpInfo($wt_pos_machine_create_params) + public function createPOSMachineWithHttpInfo($wt_pos_machine_create_params, string $contentType = self::contentTypes['createPOSMachine'][0]) { - $request = $this->createPOSMachineRequest($wt_pos_machine_create_params); + $request = $this->createPOSMachineRequest($wt_pos_machine_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createPOSMachineWithHttpInfo($wt_pos_machine_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTPosMachine' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createPOSMachineWithHttpInfo($wt_pos_machine_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createPOSMachineWithHttpInfo($wt_pos_machine_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createPOSMachineWithHttpInfo($wt_pos_machine_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createPOSMachineWithHttpInfo($wt_pos_machine_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createPOSMachineWithHttpInfo($wt_pos_machine_create_params) * Create POS machine * * @param \OpenAPI\Client\Model\WTPosMachineCreateParams $wt_pos_machine_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPOSMachineAsync($wt_pos_machine_create_params) + public function createPOSMachineAsync($wt_pos_machine_create_params, string $contentType = self::contentTypes['createPOSMachine'][0]) { - return $this->createPOSMachineAsyncWithHttpInfo($wt_pos_machine_create_params) + return $this->createPOSMachineAsyncWithHttpInfo($wt_pos_machine_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create POS machine * * @param \OpenAPI\Client\Model\WTPosMachineCreateParams $wt_pos_machine_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPOSMachineAsyncWithHttpInfo($wt_pos_machine_create_params) + public function createPOSMachineAsyncWithHttpInfo($wt_pos_machine_create_params, string $contentType = self::contentTypes['createPOSMachine'][0]) { $returnType = '\OpenAPI\Client\Model\WTPosMachine'; - $request = $this->createPOSMachineRequest($wt_pos_machine_create_params); + $request = $this->createPOSMachineRequest($wt_pos_machine_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createPOSMachine' * * @param \OpenAPI\Client\Model\WTPosMachineCreateParams $wt_pos_machine_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createPOSMachineRequest($wt_pos_machine_create_params) + public function createPOSMachineRequest($wt_pos_machine_create_params, string $contentType = self::contentTypes['createPOSMachine'][0]) { + // verify the required parameter 'wt_pos_machine_create_params' is set if ($wt_pos_machine_create_params === null || (is_array($wt_pos_machine_create_params) && count($wt_pos_machine_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createPOSMachineRequest($wt_pos_machine_create_params) ); } + $resourcePath = '/v2/pos/machine'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createPOSMachineRequest($wt_pos_machine_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_pos_machine_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_pos_machine_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_pos_machine_create_params)); } else { $httpBody = $wt_pos_machine_create_params; } @@ -746,12 +927,12 @@ public function createPOSMachineRequest($wt_pos_machine_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createPOSMachineRequest($wt_pos_machine_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createPOSMachineRequest($wt_pos_machine_create_params) * Fetch all POS machines * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPOSMachines'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllPOSMachines($is_archive_included = null) + public function fetchAllPOSMachines($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPOSMachines'][0]) { - list($response) = $this->fetchAllPOSMachinesWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllPOSMachinesWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllPOSMachines($is_archive_included = null) * Fetch all POS machines * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPOSMachines'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllPOSMachinesWithHttpInfo($is_archive_included = null) + public function fetchAllPOSMachinesWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPOSMachines'][0]) { - $request = $this->fetchAllPOSMachinesRequest($is_archive_included); + $request = $this->fetchAllPOSMachinesRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllPOSMachinesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllPOSMachinesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllPOSMachinesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllPOSMachinesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllPOSMachinesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllPOSMachinesWithHttpInfo($is_archive_included = null) * Fetch all POS machines * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPOSMachines'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllPOSMachinesAsync($is_archive_included = null) + public function fetchAllPOSMachinesAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPOSMachines'][0]) { - return $this->fetchAllPOSMachinesAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllPOSMachinesAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all POS machines * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPOSMachines'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllPOSMachinesAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllPOSMachinesAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPOSMachines'][0]) { $returnType = 'mixed[]'; - $request = $this->fetchAllPOSMachinesRequest($is_archive_included); + $request = $this->fetchAllPOSMachinesRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllPOSMachines' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPOSMachines'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllPOSMachinesRequest($is_archive_included = null) + public function fetchAllPOSMachinesRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPOSMachines'][0]) { + + $resourcePath = '/v2/pos/machine/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllPOSMachinesRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllPOSMachinesRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllPOSMachinesRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllPOSMachinesRequest($is_archive_included = null) * Restore POS machine * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePOSMachine'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTPosMachine|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restorePOSMachine($id) + public function restorePOSMachine($id, string $contentType = self::contentTypes['restorePOSMachine'][0]) { - list($response) = $this->restorePOSMachineWithHttpInfo($id); + list($response) = $this->restorePOSMachineWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restorePOSMachine($id) * Restore POS machine * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePOSMachine'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTPosMachine|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restorePOSMachineWithHttpInfo($id) + public function restorePOSMachineWithHttpInfo($id, string $contentType = self::contentTypes['restorePOSMachine'][0]) { - $request = $this->restorePOSMachineRequest($id); + $request = $this->restorePOSMachineRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restorePOSMachineWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTPosMachine' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restorePOSMachineWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restorePOSMachineWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restorePOSMachineWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restorePOSMachineWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restorePOSMachineWithHttpInfo($id) * Restore POS machine * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restorePOSMachineAsync($id) + public function restorePOSMachineAsync($id, string $contentType = self::contentTypes['restorePOSMachine'][0]) { - return $this->restorePOSMachineAsyncWithHttpInfo($id) + return $this->restorePOSMachineAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore POS machine * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restorePOSMachineAsyncWithHttpInfo($id) + public function restorePOSMachineAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restorePOSMachine'][0]) { $returnType = '\OpenAPI\Client\Model\WTPosMachine'; - $request = $this->restorePOSMachineRequest($id); + $request = $this->restorePOSMachineRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restorePOSMachine' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restorePOSMachineRequest($id) + public function restorePOSMachineRequest($id, string $contentType = self::contentTypes['restorePOSMachine'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restorePOSMachineRequest($id) ); } + $resourcePath = '/v2/pos/machine/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restorePOSMachineRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restorePOSMachineRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restorePOSMachineRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restorePOSMachineRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTPosMachineUpdateParams $wt_pos_machine_update_params wt_pos_machine_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePOSMachine'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTPosMachine|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updatePOSMachine($id, $wt_pos_machine_update_params) + public function updatePOSMachine($id, $wt_pos_machine_update_params, string $contentType = self::contentTypes['updatePOSMachine'][0]) { - list($response) = $this->updatePOSMachineWithHttpInfo($id, $wt_pos_machine_update_params); + list($response) = $this->updatePOSMachineWithHttpInfo($id, $wt_pos_machine_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updatePOSMachine($id, $wt_pos_machine_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPosMachineUpdateParams $wt_pos_machine_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePOSMachine'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTPosMachine|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updatePOSMachineWithHttpInfo($id, $wt_pos_machine_update_params) + public function updatePOSMachineWithHttpInfo($id, $wt_pos_machine_update_params, string $contentType = self::contentTypes['updatePOSMachine'][0]) { - $request = $this->updatePOSMachineRequest($id, $wt_pos_machine_update_params); + $request = $this->updatePOSMachineRequest($id, $wt_pos_machine_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updatePOSMachineWithHttpInfo($id, $wt_pos_machine_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTPosMachine' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updatePOSMachineWithHttpInfo($id, $wt_pos_machine_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updatePOSMachineWithHttpInfo($id, $wt_pos_machine_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updatePOSMachineWithHttpInfo($id, $wt_pos_machine_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updatePOSMachineWithHttpInfo($id, $wt_pos_machine_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updatePOSMachineWithHttpInfo($id, $wt_pos_machine_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPosMachineUpdateParams $wt_pos_machine_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePOSMachineAsync($id, $wt_pos_machine_update_params) + public function updatePOSMachineAsync($id, $wt_pos_machine_update_params, string $contentType = self::contentTypes['updatePOSMachine'][0]) { - return $this->updatePOSMachineAsyncWithHttpInfo($id, $wt_pos_machine_update_params) + return $this->updatePOSMachineAsyncWithHttpInfo($id, $wt_pos_machine_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPosMachineUpdateParams $wt_pos_machine_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePOSMachineAsyncWithHttpInfo($id, $wt_pos_machine_update_params) + public function updatePOSMachineAsyncWithHttpInfo($id, $wt_pos_machine_update_params, string $contentType = self::contentTypes['updatePOSMachine'][0]) { $returnType = '\OpenAPI\Client\Model\WTPosMachine'; - $request = $this->updatePOSMachineRequest($id, $wt_pos_machine_update_params); + $request = $this->updatePOSMachineRequest($id, $wt_pos_machine_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPosMachineUpdateParams $wt_pos_machine_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePOSMachine'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePOSMachineRequest($id, $wt_pos_machine_update_params) + public function updatePOSMachineRequest($id, $wt_pos_machine_update_params, string $contentType = self::contentTypes['updatePOSMachine'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updatePOSMachine' ); } + // verify the required parameter 'wt_pos_machine_update_params' is set if ($wt_pos_machine_update_params === null || (is_array($wt_pos_machine_update_params) && count($wt_pos_machine_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updatePOSMachineRequest($id, $wt_pos_machine_update_params) ); } + $resourcePath = '/v2/pos/machine/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updatePOSMachineRequest($id, $wt_pos_machine_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_pos_machine_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_pos_machine_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_pos_machine_update_params)); } else { $httpBody = $wt_pos_machine_update_params; } @@ -1753,12 +2177,12 @@ public function updatePOSMachineRequest($id, $wt_pos_machine_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updatePOSMachineRequest($id, $wt_pos_machine_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/InteractionsApi.php b/lib/Api/InteractionsApi.php index 2de689b..440190e 100644 --- a/lib/Api/InteractionsApi.php +++ b/lib/Api/InteractionsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createAdvertisementCreditScan' => [ + 'application/json', + ], + 'createEmployeeVCard' => [ + 'application/json', + ], + 'createIcsFile' => [ + 'application/json', + ], + 'createVirtualBusinessCardVCard' => [ + 'application/json', + ], + 'fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID' => [ + 'application/json', + ], + 'fetchCustomerTicketsWithToken' => [ + 'application/json', + ], + 'fetchDynamicVoucherWithVoucherID' => [ + 'application/json', + ], + 'fetchMemberInformation' => [ + 'application/json', + ], + 'fetchStaticVoucherWithVoucherID' => [ + 'application/json', + ], + 'fetchWalletPageWithToken' => [ + 'application/json', + ], + 'fetchWalletPaymentObjectsWithToken' => [ + 'application/json', + ], + 'findByVanityHandle' => [ + 'application/json', + ], + 'identifyItem' => [ + 'application/json', + ], + 'requestMerchantURLRedirect' => [ + 'application/json', + ], + 'subscribeEmail' => [ + 'application/json', + ], + 'subscribeSms' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,15 +177,16 @@ public function getConfig() * Update ticket * * @param mixed $id id (required) - * @param \OpenAPI\Client\Model\InlineObject4 $inline_object4 inline_object4 (required) + * @param \OpenAPI\Client\Model\ClaimTicketRequest $claim_ticket_request claim_ticket_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['claimTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Ticket|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function claimTicket($id, $inline_object4) + public function claimTicket($id, $claim_ticket_request, string $contentType = self::contentTypes['claimTicket'][0]) { - list($response) = $this->claimTicketWithHttpInfo($id, $inline_object4); + list($response) = $this->claimTicketWithHttpInfo($id, $claim_ticket_request, $contentType); return $response; } @@ -140,15 +196,16 @@ public function claimTicket($id, $inline_object4) * Update ticket * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject4 $inline_object4 (required) + * @param \OpenAPI\Client\Model\ClaimTicketRequest $claim_ticket_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['claimTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Ticket|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function claimTicketWithHttpInfo($id, $inline_object4) + public function claimTicketWithHttpInfo($id, $claim_ticket_request, string $contentType = self::contentTypes['claimTicket'][0]) { - $request = $this->claimTicketRequest($id, $inline_object4); + $request = $this->claimTicketRequest($id, $claim_ticket_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -191,6 +248,21 @@ public function claimTicketWithHttpInfo($id, $inline_object4) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Ticket' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -203,6 +275,21 @@ public function claimTicketWithHttpInfo($id, $inline_object4) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -215,6 +302,21 @@ public function claimTicketWithHttpInfo($id, $inline_object4) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -229,6 +331,21 @@ public function claimTicketWithHttpInfo($id, $inline_object4) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -274,14 +391,15 @@ public function claimTicketWithHttpInfo($id, $inline_object4) * Update ticket * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject4 $inline_object4 (required) + * @param \OpenAPI\Client\Model\ClaimTicketRequest $claim_ticket_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['claimTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function claimTicketAsync($id, $inline_object4) + public function claimTicketAsync($id, $claim_ticket_request, string $contentType = self::contentTypes['claimTicket'][0]) { - return $this->claimTicketAsyncWithHttpInfo($id, $inline_object4) + return $this->claimTicketAsyncWithHttpInfo($id, $claim_ticket_request, $contentType) ->then( function ($response) { return $response[0]; @@ -295,15 +413,16 @@ function ($response) { * Update ticket * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject4 $inline_object4 (required) + * @param \OpenAPI\Client\Model\ClaimTicketRequest $claim_ticket_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['claimTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function claimTicketAsyncWithHttpInfo($id, $inline_object4) + public function claimTicketAsyncWithHttpInfo($id, $claim_ticket_request, string $contentType = self::contentTypes['claimTicket'][0]) { $returnType = '\OpenAPI\Client\Model\Ticket'; - $request = $this->claimTicketRequest($id, $inline_object4); + $request = $this->claimTicketRequest($id, $claim_ticket_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -313,6 +432,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -342,26 +464,30 @@ function ($exception) { * Create request for operation 'claimTicket' * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject4 $inline_object4 (required) + * @param \OpenAPI\Client\Model\ClaimTicketRequest $claim_ticket_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['claimTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function claimTicketRequest($id, $inline_object4) + public function claimTicketRequest($id, $claim_ticket_request, string $contentType = self::contentTypes['claimTicket'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling claimTicket' ); } - // verify the required parameter 'inline_object4' is set - if ($inline_object4 === null || (is_array($inline_object4) && count($inline_object4) === 0)) { + + // verify the required parameter 'claim_ticket_request' is set + if ($claim_ticket_request === null || (is_array($claim_ticket_request) && count($claim_ticket_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $inline_object4 when calling claimTicket' + 'Missing the required parameter $claim_ticket_request when calling claimTicket' ); } + $resourcePath = '/wallet/ticket/claim/{id}'; $formParams = []; $queryParams = []; @@ -381,23 +507,19 @@ public function claimTicketRequest($id, $inline_object4) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($inline_object4)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($inline_object4)); + if (isset($claim_ticket_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($claim_ticket_request)); } else { - $httpBody = $inline_object4; + $httpBody = $claim_ticket_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -414,12 +536,12 @@ public function claimTicketRequest($id, $inline_object4) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -435,10 +557,11 @@ public function claimTicketRequest($id, $inline_object4) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -450,14 +573,15 @@ public function claimTicketRequest($id, $inline_object4) * Create ad credit scan * * @param mixed $ad_credit_id ad_credit_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAdvertisementCreditScan'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\AdvertisementCreditScan|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createAdvertisementCreditScan($ad_credit_id) + public function createAdvertisementCreditScan($ad_credit_id, string $contentType = self::contentTypes['createAdvertisementCreditScan'][0]) { - list($response) = $this->createAdvertisementCreditScanWithHttpInfo($ad_credit_id); + list($response) = $this->createAdvertisementCreditScanWithHttpInfo($ad_credit_id, $contentType); return $response; } @@ -467,14 +591,15 @@ public function createAdvertisementCreditScan($ad_credit_id) * Create ad credit scan * * @param mixed $ad_credit_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAdvertisementCreditScan'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\AdvertisementCreditScan|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createAdvertisementCreditScanWithHttpInfo($ad_credit_id) + public function createAdvertisementCreditScanWithHttpInfo($ad_credit_id, string $contentType = self::contentTypes['createAdvertisementCreditScan'][0]) { - $request = $this->createAdvertisementCreditScanRequest($ad_credit_id); + $request = $this->createAdvertisementCreditScanRequest($ad_credit_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -517,6 +642,21 @@ public function createAdvertisementCreditScanWithHttpInfo($ad_credit_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AdvertisementCreditScan' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -529,6 +669,21 @@ public function createAdvertisementCreditScanWithHttpInfo($ad_credit_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -541,6 +696,21 @@ public function createAdvertisementCreditScanWithHttpInfo($ad_credit_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -555,6 +725,21 @@ public function createAdvertisementCreditScanWithHttpInfo($ad_credit_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -600,13 +785,14 @@ public function createAdvertisementCreditScanWithHttpInfo($ad_credit_id) * Create ad credit scan * * @param mixed $ad_credit_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAdvertisementCreditScan'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAdvertisementCreditScanAsync($ad_credit_id) + public function createAdvertisementCreditScanAsync($ad_credit_id, string $contentType = self::contentTypes['createAdvertisementCreditScan'][0]) { - return $this->createAdvertisementCreditScanAsyncWithHttpInfo($ad_credit_id) + return $this->createAdvertisementCreditScanAsyncWithHttpInfo($ad_credit_id, $contentType) ->then( function ($response) { return $response[0]; @@ -620,14 +806,15 @@ function ($response) { * Create ad credit scan * * @param mixed $ad_credit_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAdvertisementCreditScan'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAdvertisementCreditScanAsyncWithHttpInfo($ad_credit_id) + public function createAdvertisementCreditScanAsyncWithHttpInfo($ad_credit_id, string $contentType = self::contentTypes['createAdvertisementCreditScan'][0]) { $returnType = '\OpenAPI\Client\Model\AdvertisementCreditScan'; - $request = $this->createAdvertisementCreditScanRequest($ad_credit_id); + $request = $this->createAdvertisementCreditScanRequest($ad_credit_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -637,6 +824,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -666,12 +856,14 @@ function ($exception) { * Create request for operation 'createAdvertisementCreditScan' * * @param mixed $ad_credit_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createAdvertisementCreditScan'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createAdvertisementCreditScanRequest($ad_credit_id) + public function createAdvertisementCreditScanRequest($ad_credit_id, string $contentType = self::contentTypes['createAdvertisementCreditScan'][0]) { + // verify the required parameter 'ad_credit_id' is set if ($ad_credit_id === null || (is_array($ad_credit_id) && count($ad_credit_id) === 0)) { throw new \InvalidArgumentException( @@ -679,6 +871,7 @@ public function createAdvertisementCreditScanRequest($ad_credit_id) ); } + $resourcePath = '/wallet/advertisementCredit/scan/{adCreditID}'; $formParams = []; $queryParams = []; @@ -698,16 +891,11 @@ public function createAdvertisementCreditScanRequest($ad_credit_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -725,12 +913,12 @@ public function createAdvertisementCreditScanRequest($ad_credit_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -746,10 +934,11 @@ public function createAdvertisementCreditScanRequest($ad_credit_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -761,14 +950,15 @@ public function createAdvertisementCreditScanRequest($ad_credit_id) * Fetch an employee's VCard * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeVCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createEmployeeVCard($id) + public function createEmployeeVCard($id, string $contentType = self::contentTypes['createEmployeeVCard'][0]) { - list($response) = $this->createEmployeeVCardWithHttpInfo($id); + list($response) = $this->createEmployeeVCardWithHttpInfo($id, $contentType); return $response; } @@ -778,14 +968,15 @@ public function createEmployeeVCard($id) * Fetch an employee's VCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeVCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeVCardWithHttpInfo($id) + public function createEmployeeVCardWithHttpInfo($id, string $contentType = self::contentTypes['createEmployeeVCard'][0]) { - $request = $this->createEmployeeVCardRequest($id); + $request = $this->createEmployeeVCardRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -828,6 +1019,21 @@ public function createEmployeeVCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -840,6 +1046,21 @@ public function createEmployeeVCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -852,6 +1073,21 @@ public function createEmployeeVCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -866,6 +1102,21 @@ public function createEmployeeVCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -911,13 +1162,14 @@ public function createEmployeeVCardWithHttpInfo($id) * Fetch an employee's VCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeVCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeVCardAsync($id) + public function createEmployeeVCardAsync($id, string $contentType = self::contentTypes['createEmployeeVCard'][0]) { - return $this->createEmployeeVCardAsyncWithHttpInfo($id) + return $this->createEmployeeVCardAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -931,14 +1183,15 @@ function ($response) { * Fetch an employee's VCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeVCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeVCardAsyncWithHttpInfo($id) + public function createEmployeeVCardAsyncWithHttpInfo($id, string $contentType = self::contentTypes['createEmployeeVCard'][0]) { $returnType = 'string'; - $request = $this->createEmployeeVCardRequest($id); + $request = $this->createEmployeeVCardRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -948,6 +1201,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -977,12 +1233,14 @@ function ($exception) { * Create request for operation 'createEmployeeVCard' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createEmployeeVCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createEmployeeVCardRequest($id) + public function createEmployeeVCardRequest($id, string $contentType = self::contentTypes['createEmployeeVCard'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -990,6 +1248,7 @@ public function createEmployeeVCardRequest($id) ); } + $resourcePath = '/wallet/employee/vcard/{id}'; $formParams = []; $queryParams = []; @@ -1009,16 +1268,11 @@ public function createEmployeeVCardRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1036,12 +1290,12 @@ public function createEmployeeVCardRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1057,10 +1311,11 @@ public function createEmployeeVCardRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1072,14 +1327,15 @@ public function createEmployeeVCardRequest($id) * Fetch ICS for live event * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createIcsFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createIcsFile($id) + public function createIcsFile($id, string $contentType = self::contentTypes['createIcsFile'][0]) { - list($response) = $this->createIcsFileWithHttpInfo($id); + list($response) = $this->createIcsFileWithHttpInfo($id, $contentType); return $response; } @@ -1089,14 +1345,15 @@ public function createIcsFile($id) * Fetch ICS for live event * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createIcsFile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createIcsFileWithHttpInfo($id) + public function createIcsFileWithHttpInfo($id, string $contentType = self::contentTypes['createIcsFile'][0]) { - $request = $this->createIcsFileRequest($id); + $request = $this->createIcsFileRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1139,6 +1396,21 @@ public function createIcsFileWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1151,6 +1423,21 @@ public function createIcsFileWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1163,6 +1450,21 @@ public function createIcsFileWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1177,6 +1479,21 @@ public function createIcsFileWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1222,13 +1539,14 @@ public function createIcsFileWithHttpInfo($id) * Fetch ICS for live event * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createIcsFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createIcsFileAsync($id) + public function createIcsFileAsync($id, string $contentType = self::contentTypes['createIcsFile'][0]) { - return $this->createIcsFileAsyncWithHttpInfo($id) + return $this->createIcsFileAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1242,14 +1560,15 @@ function ($response) { * Fetch ICS for live event * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createIcsFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createIcsFileAsyncWithHttpInfo($id) + public function createIcsFileAsyncWithHttpInfo($id, string $contentType = self::contentTypes['createIcsFile'][0]) { $returnType = 'mixed'; - $request = $this->createIcsFileRequest($id); + $request = $this->createIcsFileRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1259,6 +1578,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1288,12 +1610,14 @@ function ($exception) { * Create request for operation 'createIcsFile' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createIcsFile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createIcsFileRequest($id) + public function createIcsFileRequest($id, string $contentType = self::contentTypes['createIcsFile'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1301,6 +1625,7 @@ public function createIcsFileRequest($id) ); } + $resourcePath = '/wallet/liveevent/ics/{id}'; $formParams = []; $queryParams = []; @@ -1320,16 +1645,11 @@ public function createIcsFileRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1347,12 +1667,12 @@ public function createIcsFileRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1368,10 +1688,11 @@ public function createIcsFileRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1383,14 +1704,15 @@ public function createIcsFileRequest($id) * Fetch an employee's VCard * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVirtualBusinessCardVCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createVirtualBusinessCardVCard($id) + public function createVirtualBusinessCardVCard($id, string $contentType = self::contentTypes['createVirtualBusinessCardVCard'][0]) { - list($response) = $this->createVirtualBusinessCardVCardWithHttpInfo($id); + list($response) = $this->createVirtualBusinessCardVCardWithHttpInfo($id, $contentType); return $response; } @@ -1400,14 +1722,15 @@ public function createVirtualBusinessCardVCard($id) * Fetch an employee's VCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVirtualBusinessCardVCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createVirtualBusinessCardVCardWithHttpInfo($id) + public function createVirtualBusinessCardVCardWithHttpInfo($id, string $contentType = self::contentTypes['createVirtualBusinessCardVCard'][0]) { - $request = $this->createVirtualBusinessCardVCardRequest($id); + $request = $this->createVirtualBusinessCardVCardRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1450,6 +1773,21 @@ public function createVirtualBusinessCardVCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1462,6 +1800,21 @@ public function createVirtualBusinessCardVCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1474,6 +1827,21 @@ public function createVirtualBusinessCardVCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1488,6 +1856,21 @@ public function createVirtualBusinessCardVCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1533,13 +1916,14 @@ public function createVirtualBusinessCardVCardWithHttpInfo($id) * Fetch an employee's VCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVirtualBusinessCardVCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createVirtualBusinessCardVCardAsync($id) + public function createVirtualBusinessCardVCardAsync($id, string $contentType = self::contentTypes['createVirtualBusinessCardVCard'][0]) { - return $this->createVirtualBusinessCardVCardAsyncWithHttpInfo($id) + return $this->createVirtualBusinessCardVCardAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1553,14 +1937,15 @@ function ($response) { * Fetch an employee's VCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVirtualBusinessCardVCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createVirtualBusinessCardVCardAsyncWithHttpInfo($id) + public function createVirtualBusinessCardVCardAsyncWithHttpInfo($id, string $contentType = self::contentTypes['createVirtualBusinessCardVCard'][0]) { $returnType = 'string'; - $request = $this->createVirtualBusinessCardVCardRequest($id); + $request = $this->createVirtualBusinessCardVCardRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1570,6 +1955,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1599,12 +1987,14 @@ function ($exception) { * Create request for operation 'createVirtualBusinessCardVCard' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVirtualBusinessCardVCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createVirtualBusinessCardVCardRequest($id) + public function createVirtualBusinessCardVCardRequest($id, string $contentType = self::contentTypes['createVirtualBusinessCardVCard'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1612,6 +2002,7 @@ public function createVirtualBusinessCardVCardRequest($id) ); } + $resourcePath = '/wallet/virtualBusinessCard/vCard/{id}'; $formParams = []; $queryParams = []; @@ -1631,16 +2022,11 @@ public function createVirtualBusinessCardVCardRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1658,12 +2044,12 @@ public function createVirtualBusinessCardVCardRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1679,10 +2065,11 @@ public function createVirtualBusinessCardVCardRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1694,14 +2081,15 @@ public function createVirtualBusinessCardVCardRequest($id) * Fetch a customer's static vouchers on the basis of a given voucher ID * * @param mixed $voucher_id voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse20010[]|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner[]|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID($voucher_id) + public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID($voucher_id, string $contentType = self::contentTypes['fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID'][0]) { - list($response) = $this->fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDWithHttpInfo($voucher_id); + list($response) = $this->fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDWithHttpInfo($voucher_id, $contentType); return $response; } @@ -1711,14 +2099,15 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID($vouch * Fetch a customer's static vouchers on the basis of a given voucher ID * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse20010[]|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner[]|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDWithHttpInfo($voucher_id) + public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDWithHttpInfo($voucher_id, string $contentType = self::contentTypes['fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID'][0]) { - $request = $this->fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDRequest($voucher_id); + $request = $this->fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDRequest($voucher_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1757,14 +2146,29 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDWithHtt switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse20010[]' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse20010[]', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner[]', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1773,6 +2177,21 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1785,6 +2204,21 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDWithHtt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1794,11 +2228,26 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDWithHtt ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse20010[]'; + $returnType = '\OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner[]'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1812,7 +2261,7 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDWithHtt case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse20010[]', + '\OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1844,13 +2293,14 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDWithHtt * Fetch a customer's static vouchers on the basis of a given voucher ID * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDAsync($voucher_id) + public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDAsync($voucher_id, string $contentType = self::contentTypes['fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID'][0]) { - return $this->fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDAsyncWithHttpInfo($voucher_id) + return $this->fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDAsyncWithHttpInfo($voucher_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1864,14 +2314,15 @@ function ($response) { * Fetch a customer's static vouchers on the basis of a given voucher ID * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDAsyncWithHttpInfo($voucher_id) + public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDAsyncWithHttpInfo($voucher_id, string $contentType = self::contentTypes['fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse20010[]'; - $request = $this->fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDRequest($voucher_id); + $returnType = '\OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner[]'; + $request = $this->fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDRequest($voucher_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1881,6 +2332,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1910,12 +2364,14 @@ function ($exception) { * Create request for operation 'fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID' * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDRequest($voucher_id) + public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDRequest($voucher_id, string $contentType = self::contentTypes['fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID'][0]) { + // verify the required parameter 'voucher_id' is set if ($voucher_id === null || (is_array($voucher_id) && count($voucher_id) === 0)) { throw new \InvalidArgumentException( @@ -1923,6 +2379,7 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDRequest ); } + $resourcePath = '/wallet/staticVoucher/all'; $formParams = []; $queryParams = []; @@ -1931,30 +2388,23 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDRequest $multipart = false; // query params - if ($voucher_id !== null) { - if('form' === 'form' && is_array($voucher_id)) { - foreach($voucher_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['voucherID'] = $voucher_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $voucher_id, + 'voucherID', // param base name + 'mixed', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1972,12 +2422,12 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDRequest // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1993,10 +2443,11 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDRequest $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2007,15 +2458,16 @@ public function fetchAllStaticVouchersAssociatedWithCustomerWithVoucherIDRequest * * Update ticket * - * @param \OpenAPI\Client\Model\InlineObject5 $inline_object5 inline_object5 (required) + * @param \OpenAPI\Client\Model\FetchCustomerTicketsWithTokenRequest $fetch_customer_tickets_with_token_request fetch_customer_tickets_with_token_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchCustomerTicketsWithToken'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Ticket[]|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchCustomerTicketsWithToken($inline_object5) + public function fetchCustomerTicketsWithToken($fetch_customer_tickets_with_token_request, string $contentType = self::contentTypes['fetchCustomerTicketsWithToken'][0]) { - list($response) = $this->fetchCustomerTicketsWithTokenWithHttpInfo($inline_object5); + list($response) = $this->fetchCustomerTicketsWithTokenWithHttpInfo($fetch_customer_tickets_with_token_request, $contentType); return $response; } @@ -2024,15 +2476,16 @@ public function fetchCustomerTicketsWithToken($inline_object5) * * Update ticket * - * @param \OpenAPI\Client\Model\InlineObject5 $inline_object5 (required) + * @param \OpenAPI\Client\Model\FetchCustomerTicketsWithTokenRequest $fetch_customer_tickets_with_token_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchCustomerTicketsWithToken'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Ticket[]|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchCustomerTicketsWithTokenWithHttpInfo($inline_object5) + public function fetchCustomerTicketsWithTokenWithHttpInfo($fetch_customer_tickets_with_token_request, string $contentType = self::contentTypes['fetchCustomerTicketsWithToken'][0]) { - $request = $this->fetchCustomerTicketsWithTokenRequest($inline_object5); + $request = $this->fetchCustomerTicketsWithTokenRequest($fetch_customer_tickets_with_token_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -2075,6 +2528,21 @@ public function fetchCustomerTicketsWithTokenWithHttpInfo($inline_object5) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Ticket[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2087,6 +2555,21 @@ public function fetchCustomerTicketsWithTokenWithHttpInfo($inline_object5) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2099,6 +2582,21 @@ public function fetchCustomerTicketsWithTokenWithHttpInfo($inline_object5) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2113,6 +2611,21 @@ public function fetchCustomerTicketsWithTokenWithHttpInfo($inline_object5) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2157,14 +2670,15 @@ public function fetchCustomerTicketsWithTokenWithHttpInfo($inline_object5) * * Update ticket * - * @param \OpenAPI\Client\Model\InlineObject5 $inline_object5 (required) + * @param \OpenAPI\Client\Model\FetchCustomerTicketsWithTokenRequest $fetch_customer_tickets_with_token_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchCustomerTicketsWithToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchCustomerTicketsWithTokenAsync($inline_object5) + public function fetchCustomerTicketsWithTokenAsync($fetch_customer_tickets_with_token_request, string $contentType = self::contentTypes['fetchCustomerTicketsWithToken'][0]) { - return $this->fetchCustomerTicketsWithTokenAsyncWithHttpInfo($inline_object5) + return $this->fetchCustomerTicketsWithTokenAsyncWithHttpInfo($fetch_customer_tickets_with_token_request, $contentType) ->then( function ($response) { return $response[0]; @@ -2177,15 +2691,16 @@ function ($response) { * * Update ticket * - * @param \OpenAPI\Client\Model\InlineObject5 $inline_object5 (required) + * @param \OpenAPI\Client\Model\FetchCustomerTicketsWithTokenRequest $fetch_customer_tickets_with_token_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchCustomerTicketsWithToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchCustomerTicketsWithTokenAsyncWithHttpInfo($inline_object5) + public function fetchCustomerTicketsWithTokenAsyncWithHttpInfo($fetch_customer_tickets_with_token_request, string $contentType = self::contentTypes['fetchCustomerTicketsWithToken'][0]) { $returnType = '\OpenAPI\Client\Model\Ticket[]'; - $request = $this->fetchCustomerTicketsWithTokenRequest($inline_object5); + $request = $this->fetchCustomerTicketsWithTokenRequest($fetch_customer_tickets_with_token_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2195,6 +2710,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2223,20 +2741,23 @@ function ($exception) { /** * Create request for operation 'fetchCustomerTicketsWithToken' * - * @param \OpenAPI\Client\Model\InlineObject5 $inline_object5 (required) + * @param \OpenAPI\Client\Model\FetchCustomerTicketsWithTokenRequest $fetch_customer_tickets_with_token_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchCustomerTicketsWithToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchCustomerTicketsWithTokenRequest($inline_object5) + public function fetchCustomerTicketsWithTokenRequest($fetch_customer_tickets_with_token_request, string $contentType = self::contentTypes['fetchCustomerTicketsWithToken'][0]) { - // verify the required parameter 'inline_object5' is set - if ($inline_object5 === null || (is_array($inline_object5) && count($inline_object5) === 0)) { + + // verify the required parameter 'fetch_customer_tickets_with_token_request' is set + if ($fetch_customer_tickets_with_token_request === null || (is_array($fetch_customer_tickets_with_token_request) && count($fetch_customer_tickets_with_token_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $inline_object5 when calling fetchCustomerTicketsWithToken' + 'Missing the required parameter $fetch_customer_tickets_with_token_request when calling fetchCustomerTicketsWithToken' ); } + $resourcePath = '/wallet/tickets/fetchCustomerTicketsWithToken'; $formParams = []; $queryParams = []; @@ -2248,23 +2769,19 @@ public function fetchCustomerTicketsWithTokenRequest($inline_object5) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($inline_object5)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($inline_object5)); + if (isset($fetch_customer_tickets_with_token_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($fetch_customer_tickets_with_token_request)); } else { - $httpBody = $inline_object5; + $httpBody = $fetch_customer_tickets_with_token_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2281,12 +2798,12 @@ public function fetchCustomerTicketsWithTokenRequest($inline_object5) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2302,10 +2819,11 @@ public function fetchCustomerTicketsWithTokenRequest($inline_object5) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2317,14 +2835,15 @@ public function fetchCustomerTicketsWithTokenRequest($inline_object5) * Fetch dynamic voucher * * @param mixed $voucher_id voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherWithVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DynamicVoucher|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDynamicVoucherWithVoucherID($voucher_id) + public function fetchDynamicVoucherWithVoucherID($voucher_id, string $contentType = self::contentTypes['fetchDynamicVoucherWithVoucherID'][0]) { - list($response) = $this->fetchDynamicVoucherWithVoucherIDWithHttpInfo($voucher_id); + list($response) = $this->fetchDynamicVoucherWithVoucherIDWithHttpInfo($voucher_id, $contentType); return $response; } @@ -2334,14 +2853,15 @@ public function fetchDynamicVoucherWithVoucherID($voucher_id) * Fetch dynamic voucher * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherWithVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DynamicVoucher|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDynamicVoucherWithVoucherIDWithHttpInfo($voucher_id) + public function fetchDynamicVoucherWithVoucherIDWithHttpInfo($voucher_id, string $contentType = self::contentTypes['fetchDynamicVoucherWithVoucherID'][0]) { - $request = $this->fetchDynamicVoucherWithVoucherIDRequest($voucher_id); + $request = $this->fetchDynamicVoucherWithVoucherIDRequest($voucher_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2384,6 +2904,21 @@ public function fetchDynamicVoucherWithVoucherIDWithHttpInfo($voucher_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DynamicVoucher' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2396,6 +2931,21 @@ public function fetchDynamicVoucherWithVoucherIDWithHttpInfo($voucher_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2408,6 +2958,21 @@ public function fetchDynamicVoucherWithVoucherIDWithHttpInfo($voucher_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2422,6 +2987,21 @@ public function fetchDynamicVoucherWithVoucherIDWithHttpInfo($voucher_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2467,13 +3047,14 @@ public function fetchDynamicVoucherWithVoucherIDWithHttpInfo($voucher_id) * Fetch dynamic voucher * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherWithVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDynamicVoucherWithVoucherIDAsync($voucher_id) + public function fetchDynamicVoucherWithVoucherIDAsync($voucher_id, string $contentType = self::contentTypes['fetchDynamicVoucherWithVoucherID'][0]) { - return $this->fetchDynamicVoucherWithVoucherIDAsyncWithHttpInfo($voucher_id) + return $this->fetchDynamicVoucherWithVoucherIDAsyncWithHttpInfo($voucher_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2487,14 +3068,15 @@ function ($response) { * Fetch dynamic voucher * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherWithVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDynamicVoucherWithVoucherIDAsyncWithHttpInfo($voucher_id) + public function fetchDynamicVoucherWithVoucherIDAsyncWithHttpInfo($voucher_id, string $contentType = self::contentTypes['fetchDynamicVoucherWithVoucherID'][0]) { $returnType = '\OpenAPI\Client\Model\DynamicVoucher'; - $request = $this->fetchDynamicVoucherWithVoucherIDRequest($voucher_id); + $request = $this->fetchDynamicVoucherWithVoucherIDRequest($voucher_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2504,6 +3086,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2533,12 +3118,14 @@ function ($exception) { * Create request for operation 'fetchDynamicVoucherWithVoucherID' * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherWithVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDynamicVoucherWithVoucherIDRequest($voucher_id) + public function fetchDynamicVoucherWithVoucherIDRequest($voucher_id, string $contentType = self::contentTypes['fetchDynamicVoucherWithVoucherID'][0]) { + // verify the required parameter 'voucher_id' is set if ($voucher_id === null || (is_array($voucher_id) && count($voucher_id) === 0)) { throw new \InvalidArgumentException( @@ -2546,6 +3133,7 @@ public function fetchDynamicVoucherWithVoucherIDRequest($voucher_id) ); } + $resourcePath = '/wallet/dynamicVoucher/{voucherID}'; $formParams = []; $queryParams = []; @@ -2565,16 +3153,11 @@ public function fetchDynamicVoucherWithVoucherIDRequest($voucher_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2592,12 +3175,12 @@ public function fetchDynamicVoucherWithVoucherIDRequest($voucher_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2613,10 +3196,11 @@ public function fetchDynamicVoucherWithVoucherIDRequest($voucher_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2629,14 +3213,15 @@ public function fetchDynamicVoucherWithVoucherIDRequest($voucher_id) * * @param string $member_id member_id (required) * @param string $merchant_id merchant_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberInformation'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Member|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMemberInformation($member_id, $merchant_id) + public function fetchMemberInformation($member_id, $merchant_id, string $contentType = self::contentTypes['fetchMemberInformation'][0]) { - list($response) = $this->fetchMemberInformationWithHttpInfo($member_id, $merchant_id); + list($response) = $this->fetchMemberInformationWithHttpInfo($member_id, $merchant_id, $contentType); return $response; } @@ -2647,14 +3232,15 @@ public function fetchMemberInformation($member_id, $merchant_id) * * @param string $member_id (required) * @param string $merchant_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberInformation'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Member|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMemberInformationWithHttpInfo($member_id, $merchant_id) + public function fetchMemberInformationWithHttpInfo($member_id, $merchant_id, string $contentType = self::contentTypes['fetchMemberInformation'][0]) { - $request = $this->fetchMemberInformationRequest($member_id, $merchant_id); + $request = $this->fetchMemberInformationRequest($member_id, $merchant_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2697,6 +3283,21 @@ public function fetchMemberInformationWithHttpInfo($member_id, $merchant_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Member' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2709,6 +3310,21 @@ public function fetchMemberInformationWithHttpInfo($member_id, $merchant_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2721,6 +3337,21 @@ public function fetchMemberInformationWithHttpInfo($member_id, $merchant_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2735,6 +3366,21 @@ public function fetchMemberInformationWithHttpInfo($member_id, $merchant_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2781,13 +3427,14 @@ public function fetchMemberInformationWithHttpInfo($member_id, $merchant_id) * * @param string $member_id (required) * @param string $merchant_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberInformation'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMemberInformationAsync($member_id, $merchant_id) + public function fetchMemberInformationAsync($member_id, $merchant_id, string $contentType = self::contentTypes['fetchMemberInformation'][0]) { - return $this->fetchMemberInformationAsyncWithHttpInfo($member_id, $merchant_id) + return $this->fetchMemberInformationAsyncWithHttpInfo($member_id, $merchant_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2802,14 +3449,15 @@ function ($response) { * * @param string $member_id (required) * @param string $merchant_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberInformation'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMemberInformationAsyncWithHttpInfo($member_id, $merchant_id) + public function fetchMemberInformationAsyncWithHttpInfo($member_id, $merchant_id, string $contentType = self::contentTypes['fetchMemberInformation'][0]) { $returnType = '\OpenAPI\Client\Model\Member'; - $request = $this->fetchMemberInformationRequest($member_id, $merchant_id); + $request = $this->fetchMemberInformationRequest($member_id, $merchant_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2819,6 +3467,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2849,18 +3500,21 @@ function ($exception) { * * @param string $member_id (required) * @param string $merchant_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMemberInformation'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMemberInformationRequest($member_id, $merchant_id) + public function fetchMemberInformationRequest($member_id, $merchant_id, string $contentType = self::contentTypes['fetchMemberInformation'][0]) { + // verify the required parameter 'member_id' is set if ($member_id === null || (is_array($member_id) && count($member_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $member_id when calling fetchMemberInformation' ); } + // verify the required parameter 'merchant_id' is set if ($merchant_id === null || (is_array($merchant_id) && count($merchant_id) === 0)) { throw new \InvalidArgumentException( @@ -2876,7 +3530,7 @@ public function fetchMemberInformationRequest($member_id, $merchant_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id)) { throw new \InvalidArgumentException("invalid value for \"merchant_id\" when calling InteractionsApi.fetchMemberInformation, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/wallet/member'; $formParams = []; @@ -2886,41 +3540,32 @@ public function fetchMemberInformationRequest($member_id, $merchant_id) $multipart = false; // query params - if ($member_id !== null) { - if('form' === 'form' && is_array($member_id)) { - foreach($member_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['memberID'] = $member_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $member_id, + 'memberID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($merchant_id !== null) { - if('form' === 'form' && is_array($merchant_id)) { - foreach($merchant_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['merchantID'] = $merchant_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $merchant_id, + 'merchantID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2938,12 +3583,12 @@ public function fetchMemberInformationRequest($member_id, $merchant_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2959,10 +3604,11 @@ public function fetchMemberInformationRequest($member_id, $merchant_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2974,14 +3620,15 @@ public function fetchMemberInformationRequest($member_id, $merchant_id) * Fetch static voucher * * @param mixed $voucher_id voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherWithVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucher|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchStaticVoucherWithVoucherID($voucher_id) + public function fetchStaticVoucherWithVoucherID($voucher_id, string $contentType = self::contentTypes['fetchStaticVoucherWithVoucherID'][0]) { - list($response) = $this->fetchStaticVoucherWithVoucherIDWithHttpInfo($voucher_id); + list($response) = $this->fetchStaticVoucherWithVoucherIDWithHttpInfo($voucher_id, $contentType); return $response; } @@ -2991,14 +3638,15 @@ public function fetchStaticVoucherWithVoucherID($voucher_id) * Fetch static voucher * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherWithVoucherID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucher|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchStaticVoucherWithVoucherIDWithHttpInfo($voucher_id) + public function fetchStaticVoucherWithVoucherIDWithHttpInfo($voucher_id, string $contentType = self::contentTypes['fetchStaticVoucherWithVoucherID'][0]) { - $request = $this->fetchStaticVoucherWithVoucherIDRequest($voucher_id); + $request = $this->fetchStaticVoucherWithVoucherIDRequest($voucher_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3041,6 +3689,21 @@ public function fetchStaticVoucherWithVoucherIDWithHttpInfo($voucher_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucher' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3053,6 +3716,21 @@ public function fetchStaticVoucherWithVoucherIDWithHttpInfo($voucher_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3065,6 +3743,21 @@ public function fetchStaticVoucherWithVoucherIDWithHttpInfo($voucher_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3079,6 +3772,21 @@ public function fetchStaticVoucherWithVoucherIDWithHttpInfo($voucher_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3124,13 +3832,14 @@ public function fetchStaticVoucherWithVoucherIDWithHttpInfo($voucher_id) * Fetch static voucher * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherWithVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherWithVoucherIDAsync($voucher_id) + public function fetchStaticVoucherWithVoucherIDAsync($voucher_id, string $contentType = self::contentTypes['fetchStaticVoucherWithVoucherID'][0]) { - return $this->fetchStaticVoucherWithVoucherIDAsyncWithHttpInfo($voucher_id) + return $this->fetchStaticVoucherWithVoucherIDAsyncWithHttpInfo($voucher_id, $contentType) ->then( function ($response) { return $response[0]; @@ -3144,14 +3853,15 @@ function ($response) { * Fetch static voucher * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherWithVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherWithVoucherIDAsyncWithHttpInfo($voucher_id) + public function fetchStaticVoucherWithVoucherIDAsyncWithHttpInfo($voucher_id, string $contentType = self::contentTypes['fetchStaticVoucherWithVoucherID'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucher'; - $request = $this->fetchStaticVoucherWithVoucherIDRequest($voucher_id); + $request = $this->fetchStaticVoucherWithVoucherIDRequest($voucher_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3161,6 +3871,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3190,12 +3903,14 @@ function ($exception) { * Create request for operation 'fetchStaticVoucherWithVoucherID' * * @param mixed $voucher_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherWithVoucherID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchStaticVoucherWithVoucherIDRequest($voucher_id) + public function fetchStaticVoucherWithVoucherIDRequest($voucher_id, string $contentType = self::contentTypes['fetchStaticVoucherWithVoucherID'][0]) { + // verify the required parameter 'voucher_id' is set if ($voucher_id === null || (is_array($voucher_id) && count($voucher_id) === 0)) { throw new \InvalidArgumentException( @@ -3203,6 +3918,7 @@ public function fetchStaticVoucherWithVoucherIDRequest($voucher_id) ); } + $resourcePath = '/wallet/staticVoucher/{voucherID}'; $formParams = []; $queryParams = []; @@ -3222,16 +3938,11 @@ public function fetchStaticVoucherWithVoucherIDRequest($voucher_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3249,12 +3960,12 @@ public function fetchStaticVoucherWithVoucherIDRequest($voucher_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3270,10 +3981,11 @@ public function fetchStaticVoucherWithVoucherIDRequest($voucher_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3285,14 +3997,15 @@ public function fetchStaticVoucherWithVoucherIDRequest($voucher_id) * Fetch page with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. * * @param \OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken $wt_fetch_wallet_payment_objects_with_token wt_fetch_wallet_payment_objects_with_token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPageWithToken'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchWalletPageWithToken($wt_fetch_wallet_payment_objects_with_token) + public function fetchWalletPageWithToken($wt_fetch_wallet_payment_objects_with_token, string $contentType = self::contentTypes['fetchWalletPageWithToken'][0]) { - list($response) = $this->fetchWalletPageWithTokenWithHttpInfo($wt_fetch_wallet_payment_objects_with_token); + list($response) = $this->fetchWalletPageWithTokenWithHttpInfo($wt_fetch_wallet_payment_objects_with_token, $contentType); return $response; } @@ -3302,14 +4015,15 @@ public function fetchWalletPageWithToken($wt_fetch_wallet_payment_objects_with_t * Fetch page with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. * * @param \OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken $wt_fetch_wallet_payment_objects_with_token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPageWithToken'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchWalletPageWithTokenWithHttpInfo($wt_fetch_wallet_payment_objects_with_token) + public function fetchWalletPageWithTokenWithHttpInfo($wt_fetch_wallet_payment_objects_with_token, string $contentType = self::contentTypes['fetchWalletPageWithToken'][0]) { - $request = $this->fetchWalletPageWithTokenRequest($wt_fetch_wallet_payment_objects_with_token); + $request = $this->fetchWalletPageWithTokenRequest($wt_fetch_wallet_payment_objects_with_token, $contentType); try { $options = $this->createHttpClientOption(); @@ -3352,6 +4066,21 @@ public function fetchWalletPageWithTokenWithHttpInfo($wt_fetch_wallet_payment_ob $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3364,6 +4093,21 @@ public function fetchWalletPageWithTokenWithHttpInfo($wt_fetch_wallet_payment_ob $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3376,6 +4120,21 @@ public function fetchWalletPageWithTokenWithHttpInfo($wt_fetch_wallet_payment_ob $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3390,6 +4149,21 @@ public function fetchWalletPageWithTokenWithHttpInfo($wt_fetch_wallet_payment_ob $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3435,13 +4209,14 @@ public function fetchWalletPageWithTokenWithHttpInfo($wt_fetch_wallet_payment_ob * Fetch page with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. * * @param \OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken $wt_fetch_wallet_payment_objects_with_token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPageWithToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletPageWithTokenAsync($wt_fetch_wallet_payment_objects_with_token) + public function fetchWalletPageWithTokenAsync($wt_fetch_wallet_payment_objects_with_token, string $contentType = self::contentTypes['fetchWalletPageWithToken'][0]) { - return $this->fetchWalletPageWithTokenAsyncWithHttpInfo($wt_fetch_wallet_payment_objects_with_token) + return $this->fetchWalletPageWithTokenAsyncWithHttpInfo($wt_fetch_wallet_payment_objects_with_token, $contentType) ->then( function ($response) { return $response[0]; @@ -3455,14 +4230,15 @@ function ($response) { * Fetch page with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. * * @param \OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken $wt_fetch_wallet_payment_objects_with_token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPageWithToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletPageWithTokenAsyncWithHttpInfo($wt_fetch_wallet_payment_objects_with_token) + public function fetchWalletPageWithTokenAsyncWithHttpInfo($wt_fetch_wallet_payment_objects_with_token, string $contentType = self::contentTypes['fetchWalletPageWithToken'][0]) { $returnType = 'mixed'; - $request = $this->fetchWalletPageWithTokenRequest($wt_fetch_wallet_payment_objects_with_token); + $request = $this->fetchWalletPageWithTokenRequest($wt_fetch_wallet_payment_objects_with_token, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3472,6 +4248,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3501,12 +4280,14 @@ function ($exception) { * Create request for operation 'fetchWalletPageWithToken' * * @param \OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken $wt_fetch_wallet_payment_objects_with_token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPageWithToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchWalletPageWithTokenRequest($wt_fetch_wallet_payment_objects_with_token) + public function fetchWalletPageWithTokenRequest($wt_fetch_wallet_payment_objects_with_token, string $contentType = self::contentTypes['fetchWalletPageWithToken'][0]) { + // verify the required parameter 'wt_fetch_wallet_payment_objects_with_token' is set if ($wt_fetch_wallet_payment_objects_with_token === null || (is_array($wt_fetch_wallet_payment_objects_with_token) && count($wt_fetch_wallet_payment_objects_with_token) === 0)) { throw new \InvalidArgumentException( @@ -3514,6 +4295,7 @@ public function fetchWalletPageWithTokenRequest($wt_fetch_wallet_payment_objects ); } + $resourcePath = '/wallet/page/token'; $formParams = []; $queryParams = []; @@ -3525,21 +4307,17 @@ public function fetchWalletPageWithTokenRequest($wt_fetch_wallet_payment_objects - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_fetch_wallet_payment_objects_with_token)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_fetch_wallet_payment_objects_with_token)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_fetch_wallet_payment_objects_with_token)); } else { $httpBody = $wt_fetch_wallet_payment_objects_with_token; } @@ -3558,12 +4336,12 @@ public function fetchWalletPageWithTokenRequest($wt_fetch_wallet_payment_objects // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3579,10 +4357,11 @@ public function fetchWalletPageWithTokenRequest($wt_fetch_wallet_payment_objects $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3594,14 +4373,15 @@ public function fetchWalletPageWithTokenRequest($wt_fetch_wallet_payment_objects * Fetch payment objects with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. * * @param \OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken $wt_fetch_wallet_payment_objects_with_token wt_fetch_wallet_payment_objects_with_token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPaymentObjectsWithToken'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchWalletPaymentObjectsWithToken($wt_fetch_wallet_payment_objects_with_token) + public function fetchWalletPaymentObjectsWithToken($wt_fetch_wallet_payment_objects_with_token, string $contentType = self::contentTypes['fetchWalletPaymentObjectsWithToken'][0]) { - list($response) = $this->fetchWalletPaymentObjectsWithTokenWithHttpInfo($wt_fetch_wallet_payment_objects_with_token); + list($response) = $this->fetchWalletPaymentObjectsWithTokenWithHttpInfo($wt_fetch_wallet_payment_objects_with_token, $contentType); return $response; } @@ -3611,14 +4391,15 @@ public function fetchWalletPaymentObjectsWithToken($wt_fetch_wallet_payment_obje * Fetch payment objects with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. * * @param \OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken $wt_fetch_wallet_payment_objects_with_token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPaymentObjectsWithToken'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchWalletPaymentObjectsWithTokenWithHttpInfo($wt_fetch_wallet_payment_objects_with_token) + public function fetchWalletPaymentObjectsWithTokenWithHttpInfo($wt_fetch_wallet_payment_objects_with_token, string $contentType = self::contentTypes['fetchWalletPaymentObjectsWithToken'][0]) { - $request = $this->fetchWalletPaymentObjectsWithTokenRequest($wt_fetch_wallet_payment_objects_with_token); + $request = $this->fetchWalletPaymentObjectsWithTokenRequest($wt_fetch_wallet_payment_objects_with_token, $contentType); try { $options = $this->createHttpClientOption(); @@ -3661,6 +4442,21 @@ public function fetchWalletPaymentObjectsWithTokenWithHttpInfo($wt_fetch_wallet_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3673,6 +4469,21 @@ public function fetchWalletPaymentObjectsWithTokenWithHttpInfo($wt_fetch_wallet_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3685,6 +4496,21 @@ public function fetchWalletPaymentObjectsWithTokenWithHttpInfo($wt_fetch_wallet_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3699,6 +4525,21 @@ public function fetchWalletPaymentObjectsWithTokenWithHttpInfo($wt_fetch_wallet_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3744,13 +4585,14 @@ public function fetchWalletPaymentObjectsWithTokenWithHttpInfo($wt_fetch_wallet_ * Fetch payment objects with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. * * @param \OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken $wt_fetch_wallet_payment_objects_with_token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPaymentObjectsWithToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletPaymentObjectsWithTokenAsync($wt_fetch_wallet_payment_objects_with_token) + public function fetchWalletPaymentObjectsWithTokenAsync($wt_fetch_wallet_payment_objects_with_token, string $contentType = self::contentTypes['fetchWalletPaymentObjectsWithToken'][0]) { - return $this->fetchWalletPaymentObjectsWithTokenAsyncWithHttpInfo($wt_fetch_wallet_payment_objects_with_token) + return $this->fetchWalletPaymentObjectsWithTokenAsyncWithHttpInfo($wt_fetch_wallet_payment_objects_with_token, $contentType) ->then( function ($response) { return $response[0]; @@ -3764,14 +4606,15 @@ function ($response) { * Fetch payment objects with token NOTE: This route exists because a token can completely change the dataset returned to the client. A simple fetch just logs the token with the request, but a fetchWithToken request can have a very different object returned to the client. * * @param \OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken $wt_fetch_wallet_payment_objects_with_token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPaymentObjectsWithToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletPaymentObjectsWithTokenAsyncWithHttpInfo($wt_fetch_wallet_payment_objects_with_token) + public function fetchWalletPaymentObjectsWithTokenAsyncWithHttpInfo($wt_fetch_wallet_payment_objects_with_token, string $contentType = self::contentTypes['fetchWalletPaymentObjectsWithToken'][0]) { $returnType = 'mixed'; - $request = $this->fetchWalletPaymentObjectsWithTokenRequest($wt_fetch_wallet_payment_objects_with_token); + $request = $this->fetchWalletPaymentObjectsWithTokenRequest($wt_fetch_wallet_payment_objects_with_token, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3781,6 +4624,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3810,12 +4656,14 @@ function ($exception) { * Create request for operation 'fetchWalletPaymentObjectsWithToken' * * @param \OpenAPI\Client\Model\WTFetchWalletPaymentObjectsWithToken $wt_fetch_wallet_payment_objects_with_token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletPaymentObjectsWithToken'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchWalletPaymentObjectsWithTokenRequest($wt_fetch_wallet_payment_objects_with_token) + public function fetchWalletPaymentObjectsWithTokenRequest($wt_fetch_wallet_payment_objects_with_token, string $contentType = self::contentTypes['fetchWalletPaymentObjectsWithToken'][0]) { + // verify the required parameter 'wt_fetch_wallet_payment_objects_with_token' is set if ($wt_fetch_wallet_payment_objects_with_token === null || (is_array($wt_fetch_wallet_payment_objects_with_token) && count($wt_fetch_wallet_payment_objects_with_token) === 0)) { throw new \InvalidArgumentException( @@ -3823,6 +4671,7 @@ public function fetchWalletPaymentObjectsWithTokenRequest($wt_fetch_wallet_payme ); } + $resourcePath = '/wallet/paymentObject/token'; $formParams = []; $queryParams = []; @@ -3834,21 +4683,17 @@ public function fetchWalletPaymentObjectsWithTokenRequest($wt_fetch_wallet_payme - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_fetch_wallet_payment_objects_with_token)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_fetch_wallet_payment_objects_with_token)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_fetch_wallet_payment_objects_with_token)); } else { $httpBody = $wt_fetch_wallet_payment_objects_with_token; } @@ -3867,12 +4712,12 @@ public function fetchWalletPaymentObjectsWithTokenRequest($wt_fetch_wallet_payme // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3888,10 +4733,11 @@ public function fetchWalletPaymentObjectsWithTokenRequest($wt_fetch_wallet_payme $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3903,14 +4749,15 @@ public function fetchWalletPaymentObjectsWithTokenRequest($wt_fetch_wallet_payme * Fetch vanity handle * * @param string $handle handle (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findByVanityHandle'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WalletConfiguration|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function findByVanityHandle($handle) + public function findByVanityHandle($handle, string $contentType = self::contentTypes['findByVanityHandle'][0]) { - list($response) = $this->findByVanityHandleWithHttpInfo($handle); + list($response) = $this->findByVanityHandleWithHttpInfo($handle, $contentType); return $response; } @@ -3920,14 +4767,15 @@ public function findByVanityHandle($handle) * Fetch vanity handle * * @param string $handle (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findByVanityHandle'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WalletConfiguration|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function findByVanityHandleWithHttpInfo($handle) + public function findByVanityHandleWithHttpInfo($handle, string $contentType = self::contentTypes['findByVanityHandle'][0]) { - $request = $this->findByVanityHandleRequest($handle); + $request = $this->findByVanityHandleRequest($handle, $contentType); try { $options = $this->createHttpClientOption(); @@ -3970,6 +4818,21 @@ public function findByVanityHandleWithHttpInfo($handle) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WalletConfiguration' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3982,6 +4845,21 @@ public function findByVanityHandleWithHttpInfo($handle) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3994,6 +4872,21 @@ public function findByVanityHandleWithHttpInfo($handle) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4008,6 +4901,21 @@ public function findByVanityHandleWithHttpInfo($handle) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4053,13 +4961,14 @@ public function findByVanityHandleWithHttpInfo($handle) * Fetch vanity handle * * @param string $handle (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findByVanityHandle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findByVanityHandleAsync($handle) + public function findByVanityHandleAsync($handle, string $contentType = self::contentTypes['findByVanityHandle'][0]) { - return $this->findByVanityHandleAsyncWithHttpInfo($handle) + return $this->findByVanityHandleAsyncWithHttpInfo($handle, $contentType) ->then( function ($response) { return $response[0]; @@ -4073,14 +4982,15 @@ function ($response) { * Fetch vanity handle * * @param string $handle (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findByVanityHandle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findByVanityHandleAsyncWithHttpInfo($handle) + public function findByVanityHandleAsyncWithHttpInfo($handle, string $contentType = self::contentTypes['findByVanityHandle'][0]) { $returnType = '\OpenAPI\Client\Model\WalletConfiguration'; - $request = $this->findByVanityHandleRequest($handle); + $request = $this->findByVanityHandleRequest($handle, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4090,6 +5000,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4119,12 +5032,14 @@ function ($exception) { * Create request for operation 'findByVanityHandle' * * @param string $handle (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findByVanityHandle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findByVanityHandleRequest($handle) + public function findByVanityHandleRequest($handle, string $contentType = self::contentTypes['findByVanityHandle'][0]) { + // verify the required parameter 'handle' is set if ($handle === null || (is_array($handle) && count($handle) === 0)) { throw new \InvalidArgumentException( @@ -4132,6 +5047,7 @@ public function findByVanityHandleRequest($handle) ); } + $resourcePath = '/wallet/vanityHandle/{handle}'; $formParams = []; $queryParams = []; @@ -4151,16 +5067,11 @@ public function findByVanityHandleRequest($handle) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4178,12 +5089,12 @@ public function findByVanityHandleRequest($handle) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4199,10 +5110,11 @@ public function findByVanityHandleRequest($handle) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4217,14 +5129,15 @@ public function findByVanityHandleRequest($handle) * @param bool $is_refresh is_refresh (optional) * @param string $phone_verification_token phone_verification_token (optional) * @param string $referrer referrer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['identifyItem'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function identifyItem($item_id, $is_refresh = null, $phone_verification_token = null, $referrer = null) + public function identifyItem($item_id, $is_refresh = null, $phone_verification_token = null, $referrer = null, string $contentType = self::contentTypes['identifyItem'][0]) { - list($response) = $this->identifyItemWithHttpInfo($item_id, $is_refresh, $phone_verification_token, $referrer); + list($response) = $this->identifyItemWithHttpInfo($item_id, $is_refresh, $phone_verification_token, $referrer, $contentType); return $response; } @@ -4237,14 +5150,15 @@ public function identifyItem($item_id, $is_refresh = null, $phone_verification_t * @param bool $is_refresh (optional) * @param string $phone_verification_token (optional) * @param string $referrer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['identifyItem'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function identifyItemWithHttpInfo($item_id, $is_refresh = null, $phone_verification_token = null, $referrer = null) + public function identifyItemWithHttpInfo($item_id, $is_refresh = null, $phone_verification_token = null, $referrer = null, string $contentType = self::contentTypes['identifyItem'][0]) { - $request = $this->identifyItemRequest($item_id, $is_refresh, $phone_verification_token, $referrer); + $request = $this->identifyItemRequest($item_id, $is_refresh, $phone_verification_token, $referrer, $contentType); try { $options = $this->createHttpClientOption(); @@ -4287,6 +5201,21 @@ public function identifyItemWithHttpInfo($item_id, $is_refresh = null, $phone_ve $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4299,6 +5228,21 @@ public function identifyItemWithHttpInfo($item_id, $is_refresh = null, $phone_ve $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4311,6 +5255,21 @@ public function identifyItemWithHttpInfo($item_id, $is_refresh = null, $phone_ve $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4325,6 +5284,21 @@ public function identifyItemWithHttpInfo($item_id, $is_refresh = null, $phone_ve $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4373,13 +5347,14 @@ public function identifyItemWithHttpInfo($item_id, $is_refresh = null, $phone_ve * @param bool $is_refresh (optional) * @param string $phone_verification_token (optional) * @param string $referrer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['identifyItem'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function identifyItemAsync($item_id, $is_refresh = null, $phone_verification_token = null, $referrer = null) + public function identifyItemAsync($item_id, $is_refresh = null, $phone_verification_token = null, $referrer = null, string $contentType = self::contentTypes['identifyItem'][0]) { - return $this->identifyItemAsyncWithHttpInfo($item_id, $is_refresh, $phone_verification_token, $referrer) + return $this->identifyItemAsyncWithHttpInfo($item_id, $is_refresh, $phone_verification_token, $referrer, $contentType) ->then( function ($response) { return $response[0]; @@ -4396,14 +5371,15 @@ function ($response) { * @param bool $is_refresh (optional) * @param string $phone_verification_token (optional) * @param string $referrer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['identifyItem'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function identifyItemAsyncWithHttpInfo($item_id, $is_refresh = null, $phone_verification_token = null, $referrer = null) + public function identifyItemAsyncWithHttpInfo($item_id, $is_refresh = null, $phone_verification_token = null, $referrer = null, string $contentType = self::contentTypes['identifyItem'][0]) { $returnType = 'mixed'; - $request = $this->identifyItemRequest($item_id, $is_refresh, $phone_verification_token, $referrer); + $request = $this->identifyItemRequest($item_id, $is_refresh, $phone_verification_token, $referrer, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4413,6 +5389,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4445,12 +5424,14 @@ function ($exception) { * @param bool $is_refresh (optional) * @param string $phone_verification_token (optional) * @param string $referrer (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['identifyItem'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function identifyItemRequest($item_id, $is_refresh = null, $phone_verification_token = null, $referrer = null) + public function identifyItemRequest($item_id, $is_refresh = null, $phone_verification_token = null, $referrer = null, string $contentType = self::contentTypes['identifyItem'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( @@ -4458,6 +5439,10 @@ public function identifyItemRequest($item_id, $is_refresh = null, $phone_verific ); } + + + + $resourcePath = '/wallet/item/identify/{itemID}'; $formParams = []; $queryParams = []; @@ -4466,38 +5451,32 @@ public function identifyItemRequest($item_id, $is_refresh = null, $phone_verific $multipart = false; // query params - if ($is_refresh !== null) { - if('form' === 'form' && is_array($is_refresh)) { - foreach($is_refresh as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isRefresh'] = $is_refresh; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_refresh, + 'isRefresh', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($phone_verification_token !== null) { - if('form' === 'form' && is_array($phone_verification_token)) { - foreach($phone_verification_token as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['phoneVerificationToken'] = $phone_verification_token; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $phone_verification_token, + 'phoneVerificationToken', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($referrer !== null) { - if('form' === 'form' && is_array($referrer)) { - foreach($referrer as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['referrer'] = $referrer; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $referrer, + 'referrer', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -4510,16 +5489,11 @@ public function identifyItemRequest($item_id, $is_refresh = null, $phone_verific } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4537,12 +5511,12 @@ public function identifyItemRequest($item_id, $is_refresh = null, $phone_verific // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4558,10 +5532,11 @@ public function identifyItemRequest($item_id, $is_refresh = null, $phone_verific $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4570,36 +5545,38 @@ public function identifyItemRequest($item_id, $is_refresh = null, $phone_verific /** * Operation requestMerchantURLRedirect * - * Identify item + * Request Merchant URL * * @param string $item_id item_id (required) * @param \OpenAPI\Client\Model\BrowserDetails $browser_details browser_details (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestMerchantURLRedirect'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function requestMerchantURLRedirect($item_id, $browser_details) + public function requestMerchantURLRedirect($item_id, $browser_details, string $contentType = self::contentTypes['requestMerchantURLRedirect'][0]) { - list($response) = $this->requestMerchantURLRedirectWithHttpInfo($item_id, $browser_details); + list($response) = $this->requestMerchantURLRedirectWithHttpInfo($item_id, $browser_details, $contentType); return $response; } /** * Operation requestMerchantURLRedirectWithHttpInfo * - * Identify item + * Request Merchant URL * * @param string $item_id (required) * @param \OpenAPI\Client\Model\BrowserDetails $browser_details (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestMerchantURLRedirect'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function requestMerchantURLRedirectWithHttpInfo($item_id, $browser_details) + public function requestMerchantURLRedirectWithHttpInfo($item_id, $browser_details, string $contentType = self::contentTypes['requestMerchantURLRedirect'][0]) { - $request = $this->requestMerchantURLRedirectRequest($item_id, $browser_details); + $request = $this->requestMerchantURLRedirectRequest($item_id, $browser_details, $contentType); try { $options = $this->createHttpClientOption(); @@ -4642,6 +5619,21 @@ public function requestMerchantURLRedirectWithHttpInfo($item_id, $browser_detail $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4654,6 +5646,21 @@ public function requestMerchantURLRedirectWithHttpInfo($item_id, $browser_detail $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4666,6 +5673,21 @@ public function requestMerchantURLRedirectWithHttpInfo($item_id, $browser_detail $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4680,6 +5702,21 @@ public function requestMerchantURLRedirectWithHttpInfo($item_id, $browser_detail $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4722,17 +5759,18 @@ public function requestMerchantURLRedirectWithHttpInfo($item_id, $browser_detail /** * Operation requestMerchantURLRedirectAsync * - * Identify item + * Request Merchant URL * * @param string $item_id (required) * @param \OpenAPI\Client\Model\BrowserDetails $browser_details (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestMerchantURLRedirect'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function requestMerchantURLRedirectAsync($item_id, $browser_details) + public function requestMerchantURLRedirectAsync($item_id, $browser_details, string $contentType = self::contentTypes['requestMerchantURLRedirect'][0]) { - return $this->requestMerchantURLRedirectAsyncWithHttpInfo($item_id, $browser_details) + return $this->requestMerchantURLRedirectAsyncWithHttpInfo($item_id, $browser_details, $contentType) ->then( function ($response) { return $response[0]; @@ -4743,18 +5781,19 @@ function ($response) { /** * Operation requestMerchantURLRedirectAsyncWithHttpInfo * - * Identify item + * Request Merchant URL * * @param string $item_id (required) * @param \OpenAPI\Client\Model\BrowserDetails $browser_details (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestMerchantURLRedirect'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function requestMerchantURLRedirectAsyncWithHttpInfo($item_id, $browser_details) + public function requestMerchantURLRedirectAsyncWithHttpInfo($item_id, $browser_details, string $contentType = self::contentTypes['requestMerchantURLRedirect'][0]) { $returnType = 'mixed'; - $request = $this->requestMerchantURLRedirectRequest($item_id, $browser_details); + $request = $this->requestMerchantURLRedirectRequest($item_id, $browser_details, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4764,6 +5803,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4794,18 +5836,21 @@ function ($exception) { * * @param string $item_id (required) * @param \OpenAPI\Client\Model\BrowserDetails $browser_details (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['requestMerchantURLRedirect'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function requestMerchantURLRedirectRequest($item_id, $browser_details) + public function requestMerchantURLRedirectRequest($item_id, $browser_details, string $contentType = self::contentTypes['requestMerchantURLRedirect'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $item_id when calling requestMerchantURLRedirect' ); } + // verify the required parameter 'browser_details' is set if ($browser_details === null || (is_array($browser_details) && count($browser_details) === 0)) { throw new \InvalidArgumentException( @@ -4813,6 +5858,7 @@ public function requestMerchantURLRedirectRequest($item_id, $browser_details) ); } + $resourcePath = '/wallet/merchantURL/{itemID}'; $formParams = []; $queryParams = []; @@ -4832,21 +5878,17 @@ public function requestMerchantURLRedirectRequest($item_id, $browser_details) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($browser_details)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($browser_details)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($browser_details)); } else { $httpBody = $browser_details; } @@ -4865,12 +5907,12 @@ public function requestMerchantURLRedirectRequest($item_id, $browser_details) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4886,10 +5928,11 @@ public function requestMerchantURLRedirectRequest($item_id, $browser_details) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4901,14 +5944,15 @@ public function requestMerchantURLRedirectRequest($item_id, $browser_details) * Create email subscriber * * @param \OpenAPI\Client\Model\WTEmailSubscriberCreateParamsWalletUI $wt_email_subscriber_create_params_wallet_ui wt_email_subscriber_create_params_wallet_ui (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeEmail'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\EmailSubscriber|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function subscribeEmail($wt_email_subscriber_create_params_wallet_ui) + public function subscribeEmail($wt_email_subscriber_create_params_wallet_ui, string $contentType = self::contentTypes['subscribeEmail'][0]) { - list($response) = $this->subscribeEmailWithHttpInfo($wt_email_subscriber_create_params_wallet_ui); + list($response) = $this->subscribeEmailWithHttpInfo($wt_email_subscriber_create_params_wallet_ui, $contentType); return $response; } @@ -4918,14 +5962,15 @@ public function subscribeEmail($wt_email_subscriber_create_params_wallet_ui) * Create email subscriber * * @param \OpenAPI\Client\Model\WTEmailSubscriberCreateParamsWalletUI $wt_email_subscriber_create_params_wallet_ui (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeEmail'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\EmailSubscriber|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function subscribeEmailWithHttpInfo($wt_email_subscriber_create_params_wallet_ui) + public function subscribeEmailWithHttpInfo($wt_email_subscriber_create_params_wallet_ui, string $contentType = self::contentTypes['subscribeEmail'][0]) { - $request = $this->subscribeEmailRequest($wt_email_subscriber_create_params_wallet_ui); + $request = $this->subscribeEmailRequest($wt_email_subscriber_create_params_wallet_ui, $contentType); try { $options = $this->createHttpClientOption(); @@ -4968,6 +6013,21 @@ public function subscribeEmailWithHttpInfo($wt_email_subscriber_create_params_wa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\EmailSubscriber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4980,6 +6040,21 @@ public function subscribeEmailWithHttpInfo($wt_email_subscriber_create_params_wa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4992,6 +6067,21 @@ public function subscribeEmailWithHttpInfo($wt_email_subscriber_create_params_wa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5006,6 +6096,21 @@ public function subscribeEmailWithHttpInfo($wt_email_subscriber_create_params_wa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5051,13 +6156,14 @@ public function subscribeEmailWithHttpInfo($wt_email_subscriber_create_params_wa * Create email subscriber * * @param \OpenAPI\Client\Model\WTEmailSubscriberCreateParamsWalletUI $wt_email_subscriber_create_params_wallet_ui (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeEmail'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function subscribeEmailAsync($wt_email_subscriber_create_params_wallet_ui) + public function subscribeEmailAsync($wt_email_subscriber_create_params_wallet_ui, string $contentType = self::contentTypes['subscribeEmail'][0]) { - return $this->subscribeEmailAsyncWithHttpInfo($wt_email_subscriber_create_params_wallet_ui) + return $this->subscribeEmailAsyncWithHttpInfo($wt_email_subscriber_create_params_wallet_ui, $contentType) ->then( function ($response) { return $response[0]; @@ -5071,14 +6177,15 @@ function ($response) { * Create email subscriber * * @param \OpenAPI\Client\Model\WTEmailSubscriberCreateParamsWalletUI $wt_email_subscriber_create_params_wallet_ui (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeEmail'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function subscribeEmailAsyncWithHttpInfo($wt_email_subscriber_create_params_wallet_ui) + public function subscribeEmailAsyncWithHttpInfo($wt_email_subscriber_create_params_wallet_ui, string $contentType = self::contentTypes['subscribeEmail'][0]) { $returnType = '\OpenAPI\Client\Model\EmailSubscriber'; - $request = $this->subscribeEmailRequest($wt_email_subscriber_create_params_wallet_ui); + $request = $this->subscribeEmailRequest($wt_email_subscriber_create_params_wallet_ui, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5088,6 +6195,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5117,12 +6227,14 @@ function ($exception) { * Create request for operation 'subscribeEmail' * * @param \OpenAPI\Client\Model\WTEmailSubscriberCreateParamsWalletUI $wt_email_subscriber_create_params_wallet_ui (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeEmail'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function subscribeEmailRequest($wt_email_subscriber_create_params_wallet_ui) + public function subscribeEmailRequest($wt_email_subscriber_create_params_wallet_ui, string $contentType = self::contentTypes['subscribeEmail'][0]) { + // verify the required parameter 'wt_email_subscriber_create_params_wallet_ui' is set if ($wt_email_subscriber_create_params_wallet_ui === null || (is_array($wt_email_subscriber_create_params_wallet_ui) && count($wt_email_subscriber_create_params_wallet_ui) === 0)) { throw new \InvalidArgumentException( @@ -5130,6 +6242,7 @@ public function subscribeEmailRequest($wt_email_subscriber_create_params_wallet_ ); } + $resourcePath = '/wallet/subscribeEmail'; $formParams = []; $queryParams = []; @@ -5141,21 +6254,17 @@ public function subscribeEmailRequest($wt_email_subscriber_create_params_wallet_ - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_email_subscriber_create_params_wallet_ui)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_email_subscriber_create_params_wallet_ui)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_email_subscriber_create_params_wallet_ui)); } else { $httpBody = $wt_email_subscriber_create_params_wallet_ui; } @@ -5174,12 +6283,388 @@ public function subscribeEmailRequest($wt_email_subscriber_create_params_wallet_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation subscribeSms + * + * Create sms subscriber + * + * @param \OpenAPI\Client\Model\WTSmsSubscriberCreateParamsWalletUI $wt_sms_subscriber_create_params_wallet_ui wt_sms_subscriber_create_params_wallet_ui (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeSms'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\SmsSubscriber|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + */ + public function subscribeSms($wt_sms_subscriber_create_params_wallet_ui, string $contentType = self::contentTypes['subscribeSms'][0]) + { + list($response) = $this->subscribeSmsWithHttpInfo($wt_sms_subscriber_create_params_wallet_ui, $contentType); + return $response; + } + + /** + * Operation subscribeSmsWithHttpInfo + * + * Create sms subscriber + * + * @param \OpenAPI\Client\Model\WTSmsSubscriberCreateParamsWalletUI $wt_sms_subscriber_create_params_wallet_ui (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeSms'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\SmsSubscriber|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + */ + public function subscribeSmsWithHttpInfo($wt_sms_subscriber_create_params_wallet_ui, string $contentType = self::contentTypes['subscribeSms'][0]) + { + $request = $this->subscribeSmsRequest($wt_sms_subscriber_create_params_wallet_ui, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\SmsSubscriber' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\SmsSubscriber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SmsSubscriber', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\OpenAPI\Client\Model\FalsumError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FalsumError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\OpenAPI\Client\Model\InternalServerError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InternalServerError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\SmsSubscriber'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\SmsSubscriber', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\FalsumError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\InternalServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation subscribeSmsAsync + * + * Create sms subscriber + * + * @param \OpenAPI\Client\Model\WTSmsSubscriberCreateParamsWalletUI $wt_sms_subscriber_create_params_wallet_ui (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeSms'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscribeSmsAsync($wt_sms_subscriber_create_params_wallet_ui, string $contentType = self::contentTypes['subscribeSms'][0]) + { + return $this->subscribeSmsAsyncWithHttpInfo($wt_sms_subscriber_create_params_wallet_ui, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation subscribeSmsAsyncWithHttpInfo + * + * Create sms subscriber + * + * @param \OpenAPI\Client\Model\WTSmsSubscriberCreateParamsWalletUI $wt_sms_subscriber_create_params_wallet_ui (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeSms'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscribeSmsAsyncWithHttpInfo($wt_sms_subscriber_create_params_wallet_ui, string $contentType = self::contentTypes['subscribeSms'][0]) + { + $returnType = '\OpenAPI\Client\Model\SmsSubscriber'; + $request = $this->subscribeSmsRequest($wt_sms_subscriber_create_params_wallet_ui, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'subscribeSms' + * + * @param \OpenAPI\Client\Model\WTSmsSubscriberCreateParamsWalletUI $wt_sms_subscriber_create_params_wallet_ui (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['subscribeSms'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function subscribeSmsRequest($wt_sms_subscriber_create_params_wallet_ui, string $contentType = self::contentTypes['subscribeSms'][0]) + { + + // verify the required parameter 'wt_sms_subscriber_create_params_wallet_ui' is set + if ($wt_sms_subscriber_create_params_wallet_ui === null || (is_array($wt_sms_subscriber_create_params_wallet_ui) && count($wt_sms_subscriber_create_params_wallet_ui) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $wt_sms_subscriber_create_params_wallet_ui when calling subscribeSms' + ); + } + + + $resourcePath = '/wallet/subscribeSms'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($wt_sms_subscriber_create_params_wallet_ui)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_sms_subscriber_create_params_wallet_ui)); + } else { + $httpBody = $wt_sms_subscriber_create_params_wallet_ui; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5195,10 +6680,11 @@ public function subscribeEmailRequest($wt_email_subscriber_create_params_wallet_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/LoginAndLogoutApi.php b/lib/Api/LoginAndLogoutApi.php index e627137..88e1b2a 100644 --- a/lib/Api/LoginAndLogoutApi.php +++ b/lib/Api/LoginAndLogoutApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'loginStatus' => [ + 'application/json', + ], + 'logout' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +135,15 @@ public function getConfig() * Login * * @param \OpenAPI\Client\Model\WTAuthenticationLoginRequest $wt_authentication_login_request wt_authentication_login_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['login'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTAuthenticationLoginResponse|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function login($wt_authentication_login_request) + public function login($wt_authentication_login_request, string $contentType = self::contentTypes['login'][0]) { - list($response) = $this->loginWithHttpInfo($wt_authentication_login_request); + list($response) = $this->loginWithHttpInfo($wt_authentication_login_request, $contentType); return $response; } @@ -139,14 +153,15 @@ public function login($wt_authentication_login_request) * Login * * @param \OpenAPI\Client\Model\WTAuthenticationLoginRequest $wt_authentication_login_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['login'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTAuthenticationLoginResponse|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function loginWithHttpInfo($wt_authentication_login_request) + public function loginWithHttpInfo($wt_authentication_login_request, string $contentType = self::contentTypes['login'][0]) { - $request = $this->loginRequest($wt_authentication_login_request); + $request = $this->loginRequest($wt_authentication_login_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +204,21 @@ public function loginWithHttpInfo($wt_authentication_login_request) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTAuthenticationLoginResponse' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +231,21 @@ public function loginWithHttpInfo($wt_authentication_login_request) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +258,21 @@ public function loginWithHttpInfo($wt_authentication_login_request) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +285,21 @@ public function loginWithHttpInfo($wt_authentication_login_request) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +314,21 @@ public function loginWithHttpInfo($wt_authentication_login_request) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +382,14 @@ public function loginWithHttpInfo($wt_authentication_login_request) * Login * * @param \OpenAPI\Client\Model\WTAuthenticationLoginRequest $wt_authentication_login_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['login'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function loginAsync($wt_authentication_login_request) + public function loginAsync($wt_authentication_login_request, string $contentType = self::contentTypes['login'][0]) { - return $this->loginAsyncWithHttpInfo($wt_authentication_login_request) + return $this->loginAsyncWithHttpInfo($wt_authentication_login_request, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +403,15 @@ function ($response) { * Login * * @param \OpenAPI\Client\Model\WTAuthenticationLoginRequest $wt_authentication_login_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['login'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function loginAsyncWithHttpInfo($wt_authentication_login_request) + public function loginAsyncWithHttpInfo($wt_authentication_login_request, string $contentType = self::contentTypes['login'][0]) { $returnType = '\OpenAPI\Client\Model\WTAuthenticationLoginResponse'; - $request = $this->loginRequest($wt_authentication_login_request); + $request = $this->loginRequest($wt_authentication_login_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +421,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +453,14 @@ function ($exception) { * Create request for operation 'login' * * @param \OpenAPI\Client\Model\WTAuthenticationLoginRequest $wt_authentication_login_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['login'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function loginRequest($wt_authentication_login_request) + public function loginRequest($wt_authentication_login_request, string $contentType = self::contentTypes['login'][0]) { + // verify the required parameter 'wt_authentication_login_request' is set if ($wt_authentication_login_request === null || (is_array($wt_authentication_login_request) && count($wt_authentication_login_request) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +468,7 @@ public function loginRequest($wt_authentication_login_request) ); } + $resourcePath = '/authentication/login'; $formParams = []; $queryParams = []; @@ -382,21 +480,17 @@ public function loginRequest($wt_authentication_login_request) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_authentication_login_request)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_authentication_login_request)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_authentication_login_request)); } else { $httpBody = $wt_authentication_login_request; } @@ -415,12 +509,12 @@ public function loginRequest($wt_authentication_login_request) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -436,10 +530,11 @@ public function loginRequest($wt_authentication_login_request) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -451,14 +546,15 @@ public function loginRequest($wt_authentication_login_request) * Retrieve status of session token * * @param string $token token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginStatus'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return AnyOfObjectWTAuthenticationCheckSessionTokenStatusResponse|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\LoginStatus200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function loginStatus($token) + public function loginStatus($token, string $contentType = self::contentTypes['loginStatus'][0]) { - list($response) = $this->loginStatusWithHttpInfo($token); + list($response) = $this->loginStatusWithHttpInfo($token, $contentType); return $response; } @@ -468,14 +564,15 @@ public function loginStatus($token) * Retrieve status of session token * * @param string $token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginStatus'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of AnyOfObjectWTAuthenticationCheckSessionTokenStatusResponse|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\LoginStatus200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function loginStatusWithHttpInfo($token) + public function loginStatusWithHttpInfo($token, string $contentType = self::contentTypes['loginStatus'][0]) { - $request = $this->loginStatusRequest($token); + $request = $this->loginStatusRequest($token, $contentType); try { $options = $this->createHttpClientOption(); @@ -514,14 +611,29 @@ public function loginStatusWithHttpInfo($token) switch($statusCode) { case 200: - if ('AnyOfObjectWTAuthenticationCheckSessionTokenStatusResponse' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\LoginStatus200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LoginStatus200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, 'AnyOfObjectWTAuthenticationCheckSessionTokenStatusResponse', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\LoginStatus200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -530,6 +642,21 @@ public function loginStatusWithHttpInfo($token) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -542,6 +669,21 @@ public function loginStatusWithHttpInfo($token) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -554,6 +696,21 @@ public function loginStatusWithHttpInfo($token) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -563,11 +720,26 @@ public function loginStatusWithHttpInfo($token) ]; } - $returnType = 'AnyOfObjectWTAuthenticationCheckSessionTokenStatusResponse'; + $returnType = '\OpenAPI\Client\Model\LoginStatus200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -581,7 +753,7 @@ public function loginStatusWithHttpInfo($token) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'AnyOfObjectWTAuthenticationCheckSessionTokenStatusResponse', + '\OpenAPI\Client\Model\LoginStatus200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -621,13 +793,14 @@ public function loginStatusWithHttpInfo($token) * Retrieve status of session token * * @param string $token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function loginStatusAsync($token) + public function loginStatusAsync($token, string $contentType = self::contentTypes['loginStatus'][0]) { - return $this->loginStatusAsyncWithHttpInfo($token) + return $this->loginStatusAsyncWithHttpInfo($token, $contentType) ->then( function ($response) { return $response[0]; @@ -641,14 +814,15 @@ function ($response) { * Retrieve status of session token * * @param string $token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function loginStatusAsyncWithHttpInfo($token) + public function loginStatusAsyncWithHttpInfo($token, string $contentType = self::contentTypes['loginStatus'][0]) { - $returnType = 'AnyOfObjectWTAuthenticationCheckSessionTokenStatusResponse'; - $request = $this->loginStatusRequest($token); + $returnType = '\OpenAPI\Client\Model\LoginStatus200Response'; + $request = $this->loginStatusRequest($token, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -658,6 +832,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -687,12 +864,14 @@ function ($exception) { * Create request for operation 'loginStatus' * * @param string $token (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loginStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function loginStatusRequest($token) + public function loginStatusRequest($token, string $contentType = self::contentTypes['loginStatus'][0]) { + // verify the required parameter 'token' is set if ($token === null || (is_array($token) && count($token) === 0)) { throw new \InvalidArgumentException( @@ -700,6 +879,7 @@ public function loginStatusRequest($token) ); } + $resourcePath = '/authentication/status/{token}'; $formParams = []; $queryParams = []; @@ -719,16 +899,11 @@ public function loginStatusRequest($token) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -746,12 +921,12 @@ public function loginStatusRequest($token) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +942,11 @@ public function loginStatusRequest($token) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -781,14 +957,15 @@ public function loginStatusRequest($token) * * Logout * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logout'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function logout() + public function logout(string $contentType = self::contentTypes['logout'][0]) { - list($response) = $this->logoutWithHttpInfo(); + list($response) = $this->logoutWithHttpInfo($contentType); return $response; } @@ -797,14 +974,15 @@ public function logout() * * Logout * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logout'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function logoutWithHttpInfo() + public function logoutWithHttpInfo(string $contentType = self::contentTypes['logout'][0]) { - $request = $this->logoutRequest(); + $request = $this->logoutRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -847,6 +1025,21 @@ public function logoutWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -859,6 +1052,21 @@ public function logoutWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -871,6 +1079,21 @@ public function logoutWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -883,6 +1106,21 @@ public function logoutWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -897,6 +1135,21 @@ public function logoutWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -949,13 +1202,14 @@ public function logoutWithHttpInfo() * * Logout * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function logoutAsync() + public function logoutAsync(string $contentType = self::contentTypes['logout'][0]) { - return $this->logoutAsyncWithHttpInfo() + return $this->logoutAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -968,14 +1222,15 @@ function ($response) { * * Logout * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function logoutAsyncWithHttpInfo() + public function logoutAsyncWithHttpInfo(string $contentType = self::contentTypes['logout'][0]) { $returnType = 'string'; - $request = $this->logoutRequest(); + $request = $this->logoutRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -985,6 +1240,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1013,13 +1271,15 @@ function ($exception) { /** * Create request for operation 'logout' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['logout'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function logoutRequest() + public function logoutRequest(string $contentType = self::contentTypes['logout'][0]) { + $resourcePath = '/authentication/logout'; $formParams = []; $queryParams = []; @@ -1031,16 +1291,11 @@ public function logoutRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1058,12 +1313,12 @@ public function logoutRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1079,10 +1334,11 @@ public function logoutRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/LoungeApi.php b/lib/Api/LoungeApi.php index a346a1f..22d2da2 100644 --- a/lib/Api/LoungeApi.php +++ b/lib/Api/LoungeApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createLounge' => [ + 'application/json', + ], + 'fetchAllLounge' => [ + 'application/json', + ], + 'restoreLounge' => [ + 'application/json', + ], + 'updateLounge' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive lounge * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLounge'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Lounge|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveLounge($id) + public function archiveLounge($id, string $contentType = self::contentTypes['archiveLounge'][0]) { - list($response) = $this->archiveLoungeWithHttpInfo($id); + list($response) = $this->archiveLoungeWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveLounge($id) * Archive lounge * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLounge'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Lounge|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveLoungeWithHttpInfo($id) + public function archiveLoungeWithHttpInfo($id, string $contentType = self::contentTypes['archiveLounge'][0]) { - $request = $this->archiveLoungeRequest($id); + $request = $this->archiveLoungeRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveLoungeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Lounge' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveLoungeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveLoungeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveLoungeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveLoungeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveLoungeWithHttpInfo($id) * Archive lounge * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveLoungeAsync($id) + public function archiveLoungeAsync($id, string $contentType = self::contentTypes['archiveLounge'][0]) { - return $this->archiveLoungeAsyncWithHttpInfo($id) + return $this->archiveLoungeAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive lounge * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveLoungeAsyncWithHttpInfo($id) + public function archiveLoungeAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveLounge'][0]) { $returnType = '\OpenAPI\Client\Model\Lounge'; - $request = $this->archiveLoungeRequest($id); + $request = $this->archiveLoungeRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveLounge' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveLoungeRequest($id) + public function archiveLoungeRequest($id, string $contentType = self::contentTypes['archiveLounge'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveLoungeRequest($id) ); } + $resourcePath = '/v2/lounge/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveLoungeRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveLoungeRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveLoungeRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveLoungeRequest($id) * Create lounge * * @param \OpenAPI\Client\Model\WTLoungeCreateParams $wt_lounge_create_params wt_lounge_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLounge'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Lounge|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createLounge($wt_lounge_create_params) + public function createLounge($wt_lounge_create_params, string $contentType = self::contentTypes['createLounge'][0]) { - list($response) = $this->createLoungeWithHttpInfo($wt_lounge_create_params); + list($response) = $this->createLoungeWithHttpInfo($wt_lounge_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createLounge($wt_lounge_create_params) * Create lounge * * @param \OpenAPI\Client\Model\WTLoungeCreateParams $wt_lounge_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLounge'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Lounge|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createLoungeWithHttpInfo($wt_lounge_create_params) + public function createLoungeWithHttpInfo($wt_lounge_create_params, string $contentType = self::contentTypes['createLounge'][0]) { - $request = $this->createLoungeRequest($wt_lounge_create_params); + $request = $this->createLoungeRequest($wt_lounge_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createLoungeWithHttpInfo($wt_lounge_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Lounge' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createLoungeWithHttpInfo($wt_lounge_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createLoungeWithHttpInfo($wt_lounge_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createLoungeWithHttpInfo($wt_lounge_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createLoungeWithHttpInfo($wt_lounge_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createLoungeWithHttpInfo($wt_lounge_create_params) * Create lounge * * @param \OpenAPI\Client\Model\WTLoungeCreateParams $wt_lounge_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createLoungeAsync($wt_lounge_create_params) + public function createLoungeAsync($wt_lounge_create_params, string $contentType = self::contentTypes['createLounge'][0]) { - return $this->createLoungeAsyncWithHttpInfo($wt_lounge_create_params) + return $this->createLoungeAsyncWithHttpInfo($wt_lounge_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create lounge * * @param \OpenAPI\Client\Model\WTLoungeCreateParams $wt_lounge_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createLoungeAsyncWithHttpInfo($wt_lounge_create_params) + public function createLoungeAsyncWithHttpInfo($wt_lounge_create_params, string $contentType = self::contentTypes['createLounge'][0]) { $returnType = '\OpenAPI\Client\Model\Lounge'; - $request = $this->createLoungeRequest($wt_lounge_create_params); + $request = $this->createLoungeRequest($wt_lounge_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createLounge' * * @param \OpenAPI\Client\Model\WTLoungeCreateParams $wt_lounge_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createLoungeRequest($wt_lounge_create_params) + public function createLoungeRequest($wt_lounge_create_params, string $contentType = self::contentTypes['createLounge'][0]) { + // verify the required parameter 'wt_lounge_create_params' is set if ($wt_lounge_create_params === null || (is_array($wt_lounge_create_params) && count($wt_lounge_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createLoungeRequest($wt_lounge_create_params) ); } + $resourcePath = '/v2/lounge'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createLoungeRequest($wt_lounge_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_lounge_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_lounge_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_lounge_create_params)); } else { $httpBody = $wt_lounge_create_params; } @@ -746,12 +927,12 @@ public function createLoungeRequest($wt_lounge_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createLoungeRequest($wt_lounge_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createLoungeRequest($wt_lounge_create_params) * Fetch all lounge * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLounge'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllLounge($is_archive_included = null) + public function fetchAllLounge($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLounge'][0]) { - list($response) = $this->fetchAllLoungeWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllLoungeWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllLounge($is_archive_included = null) * Fetch all lounge * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLounge'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllLoungeWithHttpInfo($is_archive_included = null) + public function fetchAllLoungeWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLounge'][0]) { - $request = $this->fetchAllLoungeRequest($is_archive_included); + $request = $this->fetchAllLoungeRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllLoungeWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllLoungeWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllLoungeWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllLoungeWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllLoungeWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllLoungeWithHttpInfo($is_archive_included = null) * Fetch all lounge * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllLoungeAsync($is_archive_included = null) + public function fetchAllLoungeAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLounge'][0]) { - return $this->fetchAllLoungeAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllLoungeAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all lounge * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllLoungeAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllLoungeAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLounge'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllLoungeRequest($is_archive_included); + $request = $this->fetchAllLoungeRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllLounge' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllLoungeRequest($is_archive_included = null) + public function fetchAllLoungeRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLounge'][0]) { + + $resourcePath = '/v2/lounge/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllLoungeRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllLoungeRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllLoungeRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllLoungeRequest($is_archive_included = null) * Restore lounge * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLounge'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Lounge|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreLounge($id) + public function restoreLounge($id, string $contentType = self::contentTypes['restoreLounge'][0]) { - list($response) = $this->restoreLoungeWithHttpInfo($id); + list($response) = $this->restoreLoungeWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restoreLounge($id) * Restore lounge * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLounge'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Lounge|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreLoungeWithHttpInfo($id) + public function restoreLoungeWithHttpInfo($id, string $contentType = self::contentTypes['restoreLounge'][0]) { - $request = $this->restoreLoungeRequest($id); + $request = $this->restoreLoungeRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restoreLoungeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Lounge' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restoreLoungeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restoreLoungeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restoreLoungeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restoreLoungeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restoreLoungeWithHttpInfo($id) * Restore lounge * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreLoungeAsync($id) + public function restoreLoungeAsync($id, string $contentType = self::contentTypes['restoreLounge'][0]) { - return $this->restoreLoungeAsyncWithHttpInfo($id) + return $this->restoreLoungeAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore lounge * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreLoungeAsyncWithHttpInfo($id) + public function restoreLoungeAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreLounge'][0]) { $returnType = '\OpenAPI\Client\Model\Lounge'; - $request = $this->restoreLoungeRequest($id); + $request = $this->restoreLoungeRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restoreLounge' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreLoungeRequest($id) + public function restoreLoungeRequest($id, string $contentType = self::contentTypes['restoreLounge'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restoreLoungeRequest($id) ); } + $resourcePath = '/v2/lounge/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restoreLoungeRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restoreLoungeRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restoreLoungeRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restoreLoungeRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTLoungeUpdateParams $wt_lounge_update_params wt_lounge_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLounge'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Lounge|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateLounge($id, $wt_lounge_update_params) + public function updateLounge($id, $wt_lounge_update_params, string $contentType = self::contentTypes['updateLounge'][0]) { - list($response) = $this->updateLoungeWithHttpInfo($id, $wt_lounge_update_params); + list($response) = $this->updateLoungeWithHttpInfo($id, $wt_lounge_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateLounge($id, $wt_lounge_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLoungeUpdateParams $wt_lounge_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLounge'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Lounge|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateLoungeWithHttpInfo($id, $wt_lounge_update_params) + public function updateLoungeWithHttpInfo($id, $wt_lounge_update_params, string $contentType = self::contentTypes['updateLounge'][0]) { - $request = $this->updateLoungeRequest($id, $wt_lounge_update_params); + $request = $this->updateLoungeRequest($id, $wt_lounge_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateLoungeWithHttpInfo($id, $wt_lounge_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Lounge' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateLoungeWithHttpInfo($id, $wt_lounge_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateLoungeWithHttpInfo($id, $wt_lounge_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateLoungeWithHttpInfo($id, $wt_lounge_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateLoungeWithHttpInfo($id, $wt_lounge_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateLoungeWithHttpInfo($id, $wt_lounge_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLoungeUpdateParams $wt_lounge_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLoungeAsync($id, $wt_lounge_update_params) + public function updateLoungeAsync($id, $wt_lounge_update_params, string $contentType = self::contentTypes['updateLounge'][0]) { - return $this->updateLoungeAsyncWithHttpInfo($id, $wt_lounge_update_params) + return $this->updateLoungeAsyncWithHttpInfo($id, $wt_lounge_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLoungeUpdateParams $wt_lounge_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLoungeAsyncWithHttpInfo($id, $wt_lounge_update_params) + public function updateLoungeAsyncWithHttpInfo($id, $wt_lounge_update_params, string $contentType = self::contentTypes['updateLounge'][0]) { $returnType = '\OpenAPI\Client\Model\Lounge'; - $request = $this->updateLoungeRequest($id, $wt_lounge_update_params); + $request = $this->updateLoungeRequest($id, $wt_lounge_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLoungeUpdateParams $wt_lounge_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLounge'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateLoungeRequest($id, $wt_lounge_update_params) + public function updateLoungeRequest($id, $wt_lounge_update_params, string $contentType = self::contentTypes['updateLounge'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateLounge' ); } + // verify the required parameter 'wt_lounge_update_params' is set if ($wt_lounge_update_params === null || (is_array($wt_lounge_update_params) && count($wt_lounge_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateLoungeRequest($id, $wt_lounge_update_params) ); } + $resourcePath = '/v2/lounge/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateLoungeRequest($id, $wt_lounge_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_lounge_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_lounge_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_lounge_update_params)); } else { $httpBody = $wt_lounge_update_params; } @@ -1753,12 +2177,12 @@ public function updateLoungeRequest($id, $wt_lounge_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateLoungeRequest($id, $wt_lounge_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/MembershipTiersApi.php b/lib/Api/MembershipTiersApi.php index 8a45f99..7c878c1 100644 --- a/lib/Api/MembershipTiersApi.php +++ b/lib/Api/MembershipTiersApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createMembershipTier' => [ + 'application/json', + ], + 'fetchAllMembershipTiers' => [ + 'application/json', + ], + 'fetchAllMembershipTiersWithMemberCount' => [ + 'application/json', + ], + 'fetchMembershipTierById' => [ + 'application/json', + ], + 'fetchMembershipTierHistoryLog' => [ + 'application/json', + ], + 'fetchMembershipTierRedemptionLog' => [ + 'application/json', + ], + 'restoreMembershipTier' => [ + 'application/json', + ], + 'updateMembershipTier' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +153,15 @@ public function getConfig() * Archive tier * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMembershipTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMembershipTier|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveMembershipTier($id) + public function archiveMembershipTier($id, string $contentType = self::contentTypes['archiveMembershipTier'][0]) { - list($response) = $this->archiveMembershipTierWithHttpInfo($id); + list($response) = $this->archiveMembershipTierWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +171,15 @@ public function archiveMembershipTier($id) * Archive tier * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMembershipTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMembershipTier|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveMembershipTierWithHttpInfo($id) + public function archiveMembershipTierWithHttpInfo($id, string $contentType = self::contentTypes['archiveMembershipTier'][0]) { - $request = $this->archiveMembershipTierRequest($id); + $request = $this->archiveMembershipTierRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +222,21 @@ public function archiveMembershipTierWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMembershipTier' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +249,21 @@ public function archiveMembershipTierWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +276,21 @@ public function archiveMembershipTierWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +303,21 @@ public function archiveMembershipTierWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +332,21 @@ public function archiveMembershipTierWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +400,14 @@ public function archiveMembershipTierWithHttpInfo($id) * Archive tier * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveMembershipTierAsync($id) + public function archiveMembershipTierAsync($id, string $contentType = self::contentTypes['archiveMembershipTier'][0]) { - return $this->archiveMembershipTierAsyncWithHttpInfo($id) + return $this->archiveMembershipTierAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +421,15 @@ function ($response) { * Archive tier * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveMembershipTierAsyncWithHttpInfo($id) + public function archiveMembershipTierAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveMembershipTier'][0]) { $returnType = '\OpenAPI\Client\Model\WTMembershipTier'; - $request = $this->archiveMembershipTierRequest($id); + $request = $this->archiveMembershipTierRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +439,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +471,14 @@ function ($exception) { * Create request for operation 'archiveMembershipTier' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveMembershipTierRequest($id) + public function archiveMembershipTierRequest($id, string $contentType = self::contentTypes['archiveMembershipTier'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +486,7 @@ public function archiveMembershipTierRequest($id) ); } + $resourcePath = '/v2/membership/tier/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +506,11 @@ public function archiveMembershipTierRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +528,12 @@ public function archiveMembershipTierRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +549,11 @@ public function archiveMembershipTierRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +565,15 @@ public function archiveMembershipTierRequest($id) * Create tier * * @param \OpenAPI\Client\Model\WTMembershipTierCreationParams $wt_membership_tier_creation_params wt_membership_tier_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMembershipTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMembershipTier|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError */ - public function createMembershipTier($wt_membership_tier_creation_params) + public function createMembershipTier($wt_membership_tier_creation_params, string $contentType = self::contentTypes['createMembershipTier'][0]) { - list($response) = $this->createMembershipTierWithHttpInfo($wt_membership_tier_creation_params); + list($response) = $this->createMembershipTierWithHttpInfo($wt_membership_tier_creation_params, $contentType); return $response; } @@ -470,14 +583,15 @@ public function createMembershipTier($wt_membership_tier_creation_params) * Create tier * * @param \OpenAPI\Client\Model\WTMembershipTierCreationParams $wt_membership_tier_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMembershipTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMembershipTier|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createMembershipTierWithHttpInfo($wt_membership_tier_creation_params) + public function createMembershipTierWithHttpInfo($wt_membership_tier_creation_params, string $contentType = self::contentTypes['createMembershipTier'][0]) { - $request = $this->createMembershipTierRequest($wt_membership_tier_creation_params); + $request = $this->createMembershipTierRequest($wt_membership_tier_creation_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +634,21 @@ public function createMembershipTierWithHttpInfo($wt_membership_tier_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMembershipTier' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +661,21 @@ public function createMembershipTierWithHttpInfo($wt_membership_tier_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +688,21 @@ public function createMembershipTierWithHttpInfo($wt_membership_tier_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +715,21 @@ public function createMembershipTierWithHttpInfo($wt_membership_tier_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -568,6 +742,21 @@ public function createMembershipTierWithHttpInfo($wt_membership_tier_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantNotInitialized' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -580,6 +769,21 @@ public function createMembershipTierWithHttpInfo($wt_membership_tier_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -594,6 +798,21 @@ public function createMembershipTierWithHttpInfo($wt_membership_tier_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -663,13 +882,14 @@ public function createMembershipTierWithHttpInfo($wt_membership_tier_creation_pa * Create tier * * @param \OpenAPI\Client\Model\WTMembershipTierCreationParams $wt_membership_tier_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createMembershipTierAsync($wt_membership_tier_creation_params) + public function createMembershipTierAsync($wt_membership_tier_creation_params, string $contentType = self::contentTypes['createMembershipTier'][0]) { - return $this->createMembershipTierAsyncWithHttpInfo($wt_membership_tier_creation_params) + return $this->createMembershipTierAsyncWithHttpInfo($wt_membership_tier_creation_params, $contentType) ->then( function ($response) { return $response[0]; @@ -683,14 +903,15 @@ function ($response) { * Create tier * * @param \OpenAPI\Client\Model\WTMembershipTierCreationParams $wt_membership_tier_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createMembershipTierAsyncWithHttpInfo($wt_membership_tier_creation_params) + public function createMembershipTierAsyncWithHttpInfo($wt_membership_tier_creation_params, string $contentType = self::contentTypes['createMembershipTier'][0]) { $returnType = '\OpenAPI\Client\Model\WTMembershipTier'; - $request = $this->createMembershipTierRequest($wt_membership_tier_creation_params); + $request = $this->createMembershipTierRequest($wt_membership_tier_creation_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -700,6 +921,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -729,12 +953,14 @@ function ($exception) { * Create request for operation 'createMembershipTier' * * @param \OpenAPI\Client\Model\WTMembershipTierCreationParams $wt_membership_tier_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createMembershipTierRequest($wt_membership_tier_creation_params) + public function createMembershipTierRequest($wt_membership_tier_creation_params, string $contentType = self::contentTypes['createMembershipTier'][0]) { + // verify the required parameter 'wt_membership_tier_creation_params' is set if ($wt_membership_tier_creation_params === null || (is_array($wt_membership_tier_creation_params) && count($wt_membership_tier_creation_params) === 0)) { throw new \InvalidArgumentException( @@ -742,6 +968,7 @@ public function createMembershipTierRequest($wt_membership_tier_creation_params) ); } + $resourcePath = '/v2/membership/tier'; $formParams = []; $queryParams = []; @@ -753,21 +980,17 @@ public function createMembershipTierRequest($wt_membership_tier_creation_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_membership_tier_creation_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_membership_tier_creation_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_membership_tier_creation_params)); } else { $httpBody = $wt_membership_tier_creation_params; } @@ -786,12 +1009,12 @@ public function createMembershipTierRequest($wt_membership_tier_creation_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -807,10 +1030,11 @@ public function createMembershipTierRequest($wt_membership_tier_creation_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -822,14 +1046,15 @@ public function createMembershipTierRequest($wt_membership_tier_creation_params) * Fetch all tiers * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMembershipTiers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMembershipTier[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllMembershipTiers($is_archive_included = null) + public function fetchAllMembershipTiers($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMembershipTiers'][0]) { - list($response) = $this->fetchAllMembershipTiersWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllMembershipTiersWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -839,14 +1064,15 @@ public function fetchAllMembershipTiers($is_archive_included = null) * Fetch all tiers * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMembershipTiers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMembershipTier[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllMembershipTiersWithHttpInfo($is_archive_included = null) + public function fetchAllMembershipTiersWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMembershipTiers'][0]) { - $request = $this->fetchAllMembershipTiersRequest($is_archive_included); + $request = $this->fetchAllMembershipTiersRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -889,6 +1115,21 @@ public function fetchAllMembershipTiersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMembershipTier[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -901,6 +1142,21 @@ public function fetchAllMembershipTiersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -913,6 +1169,21 @@ public function fetchAllMembershipTiersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -925,6 +1196,21 @@ public function fetchAllMembershipTiersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -939,6 +1225,21 @@ public function fetchAllMembershipTiersWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -992,13 +1293,14 @@ public function fetchAllMembershipTiersWithHttpInfo($is_archive_included = null) * Fetch all tiers * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMembershipTiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllMembershipTiersAsync($is_archive_included = null) + public function fetchAllMembershipTiersAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMembershipTiers'][0]) { - return $this->fetchAllMembershipTiersAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllMembershipTiersAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -1012,14 +1314,15 @@ function ($response) { * Fetch all tiers * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMembershipTiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllMembershipTiersAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllMembershipTiersAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMembershipTiers'][0]) { $returnType = '\OpenAPI\Client\Model\WTMembershipTier[]'; - $request = $this->fetchAllMembershipTiersRequest($is_archive_included); + $request = $this->fetchAllMembershipTiersRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1029,6 +1332,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1058,13 +1364,16 @@ function ($exception) { * Create request for operation 'fetchAllMembershipTiers' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMembershipTiers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllMembershipTiersRequest($is_archive_included = null) + public function fetchAllMembershipTiersRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMembershipTiers'][0]) { + + $resourcePath = '/v2/membership/tier/all'; $formParams = []; $queryParams = []; @@ -1073,30 +1382,23 @@ public function fetchAllMembershipTiersRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1114,12 +1416,12 @@ public function fetchAllMembershipTiersRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1135,10 +1437,11 @@ public function fetchAllMembershipTiersRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1150,14 +1453,15 @@ public function fetchAllMembershipTiersRequest($is_archive_included = null) * Fetch all tiers with member count * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMembershipTiersWithMemberCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMembershipTierWithMemberCount[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllMembershipTiersWithMemberCount($is_archive_included = null) + public function fetchAllMembershipTiersWithMemberCount($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMembershipTiersWithMemberCount'][0]) { - list($response) = $this->fetchAllMembershipTiersWithMemberCountWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllMembershipTiersWithMemberCountWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -1167,14 +1471,15 @@ public function fetchAllMembershipTiersWithMemberCount($is_archive_included = nu * Fetch all tiers with member count * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMembershipTiersWithMemberCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMembershipTierWithMemberCount[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllMembershipTiersWithMemberCountWithHttpInfo($is_archive_included = null) + public function fetchAllMembershipTiersWithMemberCountWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMembershipTiersWithMemberCount'][0]) { - $request = $this->fetchAllMembershipTiersWithMemberCountRequest($is_archive_included); + $request = $this->fetchAllMembershipTiersWithMemberCountRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -1217,6 +1522,21 @@ public function fetchAllMembershipTiersWithMemberCountWithHttpInfo($is_archive_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMembershipTierWithMemberCount[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1229,6 +1549,21 @@ public function fetchAllMembershipTiersWithMemberCountWithHttpInfo($is_archive_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1241,6 +1576,21 @@ public function fetchAllMembershipTiersWithMemberCountWithHttpInfo($is_archive_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1253,6 +1603,21 @@ public function fetchAllMembershipTiersWithMemberCountWithHttpInfo($is_archive_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1267,6 +1632,21 @@ public function fetchAllMembershipTiersWithMemberCountWithHttpInfo($is_archive_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1320,13 +1700,14 @@ public function fetchAllMembershipTiersWithMemberCountWithHttpInfo($is_archive_i * Fetch all tiers with member count * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMembershipTiersWithMemberCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllMembershipTiersWithMemberCountAsync($is_archive_included = null) + public function fetchAllMembershipTiersWithMemberCountAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMembershipTiersWithMemberCount'][0]) { - return $this->fetchAllMembershipTiersWithMemberCountAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllMembershipTiersWithMemberCountAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -1340,14 +1721,15 @@ function ($response) { * Fetch all tiers with member count * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMembershipTiersWithMemberCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllMembershipTiersWithMemberCountAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllMembershipTiersWithMemberCountAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMembershipTiersWithMemberCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTMembershipTierWithMemberCount[]'; - $request = $this->fetchAllMembershipTiersWithMemberCountRequest($is_archive_included); + $request = $this->fetchAllMembershipTiersWithMemberCountRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1357,6 +1739,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1386,13 +1771,16 @@ function ($exception) { * Create request for operation 'fetchAllMembershipTiersWithMemberCount' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMembershipTiersWithMemberCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllMembershipTiersWithMemberCountRequest($is_archive_included = null) + public function fetchAllMembershipTiersWithMemberCountRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMembershipTiersWithMemberCount'][0]) { + + $resourcePath = '/v2/membership/tier/allWithMemberCount'; $formParams = []; $queryParams = []; @@ -1401,30 +1789,23 @@ public function fetchAllMembershipTiersWithMemberCountRequest($is_archive_includ $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1442,12 +1823,12 @@ public function fetchAllMembershipTiersWithMemberCountRequest($is_archive_includ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1463,10 +1844,11 @@ public function fetchAllMembershipTiersWithMemberCountRequest($is_archive_includ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1478,14 +1860,15 @@ public function fetchAllMembershipTiersWithMemberCountRequest($is_archive_includ * Fetch tier * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMembershipTier|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMembershipTierById($id) + public function fetchMembershipTierById($id, string $contentType = self::contentTypes['fetchMembershipTierById'][0]) { - list($response) = $this->fetchMembershipTierByIdWithHttpInfo($id); + list($response) = $this->fetchMembershipTierByIdWithHttpInfo($id, $contentType); return $response; } @@ -1495,14 +1878,15 @@ public function fetchMembershipTierById($id) * Fetch tier * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMembershipTier|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMembershipTierByIdWithHttpInfo($id) + public function fetchMembershipTierByIdWithHttpInfo($id, string $contentType = self::contentTypes['fetchMembershipTierById'][0]) { - $request = $this->fetchMembershipTierByIdRequest($id); + $request = $this->fetchMembershipTierByIdRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1545,6 +1929,21 @@ public function fetchMembershipTierByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMembershipTier' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1557,6 +1956,21 @@ public function fetchMembershipTierByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1569,6 +1983,21 @@ public function fetchMembershipTierByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1581,6 +2010,21 @@ public function fetchMembershipTierByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1595,6 +2039,21 @@ public function fetchMembershipTierByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1648,13 +2107,14 @@ public function fetchMembershipTierByIdWithHttpInfo($id) * Fetch tier * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMembershipTierByIdAsync($id) + public function fetchMembershipTierByIdAsync($id, string $contentType = self::contentTypes['fetchMembershipTierById'][0]) { - return $this->fetchMembershipTierByIdAsyncWithHttpInfo($id) + return $this->fetchMembershipTierByIdAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1668,14 +2128,15 @@ function ($response) { * Fetch tier * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMembershipTierByIdAsyncWithHttpInfo($id) + public function fetchMembershipTierByIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchMembershipTierById'][0]) { $returnType = '\OpenAPI\Client\Model\WTMembershipTier'; - $request = $this->fetchMembershipTierByIdRequest($id); + $request = $this->fetchMembershipTierByIdRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1685,6 +2146,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1714,12 +2178,14 @@ function ($exception) { * Create request for operation 'fetchMembershipTierById' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMembershipTierByIdRequest($id) + public function fetchMembershipTierByIdRequest($id, string $contentType = self::contentTypes['fetchMembershipTierById'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1727,6 +2193,7 @@ public function fetchMembershipTierByIdRequest($id) ); } + $resourcePath = '/v2/membership/tier/{id}'; $formParams = []; $queryParams = []; @@ -1746,16 +2213,11 @@ public function fetchMembershipTierByIdRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1773,12 +2235,12 @@ public function fetchMembershipTierByIdRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1794,10 +2256,11 @@ public function fetchMembershipTierByIdRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1809,14 +2272,15 @@ public function fetchMembershipTierByIdRequest($id) * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierHistoryLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MSMembershipTierHistoryPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMembershipTierHistoryLog($pagination_request_with_id_and_without_sort_options) + public function fetchMembershipTierHistoryLog($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMembershipTierHistoryLog'][0]) { - list($response) = $this->fetchMembershipTierHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options); + list($response) = $this->fetchMembershipTierHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType); return $response; } @@ -1826,14 +2290,15 @@ public function fetchMembershipTierHistoryLog($pagination_request_with_id_and_wi * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierHistoryLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MSMembershipTierHistoryPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMembershipTierHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMembershipTierHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMembershipTierHistoryLog'][0]) { - $request = $this->fetchMembershipTierHistoryLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMembershipTierHistoryLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); try { $options = $this->createHttpClientOption(); @@ -1876,6 +2341,21 @@ public function fetchMembershipTierHistoryLogWithHttpInfo($pagination_request_wi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MSMembershipTierHistoryPagination' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1888,6 +2368,21 @@ public function fetchMembershipTierHistoryLogWithHttpInfo($pagination_request_wi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1900,6 +2395,21 @@ public function fetchMembershipTierHistoryLogWithHttpInfo($pagination_request_wi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1912,6 +2422,21 @@ public function fetchMembershipTierHistoryLogWithHttpInfo($pagination_request_wi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1926,6 +2451,21 @@ public function fetchMembershipTierHistoryLogWithHttpInfo($pagination_request_wi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1979,13 +2519,14 @@ public function fetchMembershipTierHistoryLogWithHttpInfo($pagination_request_wi * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierHistoryLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMembershipTierHistoryLogAsync($pagination_request_with_id_and_without_sort_options) + public function fetchMembershipTierHistoryLogAsync($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMembershipTierHistoryLog'][0]) { - return $this->fetchMembershipTierHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + return $this->fetchMembershipTierHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType) ->then( function ($response) { return $response[0]; @@ -1999,14 +2540,15 @@ function ($response) { * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierHistoryLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMembershipTierHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMembershipTierHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMembershipTierHistoryLog'][0]) { $returnType = '\OpenAPI\Client\Model\MSMembershipTierHistoryPagination'; - $request = $this->fetchMembershipTierHistoryLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMembershipTierHistoryLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2016,6 +2558,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2045,12 +2590,14 @@ function ($exception) { * Create request for operation 'fetchMembershipTierHistoryLog' * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierHistoryLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMembershipTierHistoryLogRequest($pagination_request_with_id_and_without_sort_options) + public function fetchMembershipTierHistoryLogRequest($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMembershipTierHistoryLog'][0]) { + // verify the required parameter 'pagination_request_with_id_and_without_sort_options' is set if ($pagination_request_with_id_and_without_sort_options === null || (is_array($pagination_request_with_id_and_without_sort_options) && count($pagination_request_with_id_and_without_sort_options) === 0)) { throw new \InvalidArgumentException( @@ -2058,6 +2605,7 @@ public function fetchMembershipTierHistoryLogRequest($pagination_request_with_id ); } + $resourcePath = '/v2/membership/tier/history/log'; $formParams = []; $queryParams = []; @@ -2069,21 +2617,17 @@ public function fetchMembershipTierHistoryLogRequest($pagination_request_with_id - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pagination_request_with_id_and_without_sort_options)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); } else { $httpBody = $pagination_request_with_id_and_without_sort_options; } @@ -2102,12 +2646,12 @@ public function fetchMembershipTierHistoryLogRequest($pagination_request_with_id // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2123,10 +2667,11 @@ public function fetchMembershipTierHistoryLogRequest($pagination_request_with_id $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2138,14 +2683,15 @@ public function fetchMembershipTierHistoryLogRequest($pagination_request_with_id * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierRedemptionLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MSMembershipTierRedemptionPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMembershipTierRedemptionLog($pagination_request_with_id_and_without_sort_options) + public function fetchMembershipTierRedemptionLog($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMembershipTierRedemptionLog'][0]) { - list($response) = $this->fetchMembershipTierRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options); + list($response) = $this->fetchMembershipTierRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType); return $response; } @@ -2155,14 +2701,15 @@ public function fetchMembershipTierRedemptionLog($pagination_request_with_id_and * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierRedemptionLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MSMembershipTierRedemptionPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMembershipTierRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMembershipTierRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMembershipTierRedemptionLog'][0]) { - $request = $this->fetchMembershipTierRedemptionLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMembershipTierRedemptionLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); try { $options = $this->createHttpClientOption(); @@ -2205,6 +2752,21 @@ public function fetchMembershipTierRedemptionLogWithHttpInfo($pagination_request $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MSMembershipTierRedemptionPagination' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2217,6 +2779,21 @@ public function fetchMembershipTierRedemptionLogWithHttpInfo($pagination_request $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2229,6 +2806,21 @@ public function fetchMembershipTierRedemptionLogWithHttpInfo($pagination_request $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2241,6 +2833,21 @@ public function fetchMembershipTierRedemptionLogWithHttpInfo($pagination_request $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2255,6 +2862,21 @@ public function fetchMembershipTierRedemptionLogWithHttpInfo($pagination_request $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2308,13 +2930,14 @@ public function fetchMembershipTierRedemptionLogWithHttpInfo($pagination_request * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierRedemptionLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMembershipTierRedemptionLogAsync($pagination_request_with_id_and_without_sort_options) + public function fetchMembershipTierRedemptionLogAsync($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMembershipTierRedemptionLog'][0]) { - return $this->fetchMembershipTierRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + return $this->fetchMembershipTierRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType) ->then( function ($response) { return $response[0]; @@ -2328,14 +2951,15 @@ function ($response) { * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierRedemptionLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMembershipTierRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMembershipTierRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMembershipTierRedemptionLog'][0]) { $returnType = '\OpenAPI\Client\Model\MSMembershipTierRedemptionPagination'; - $request = $this->fetchMembershipTierRedemptionLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMembershipTierRedemptionLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2345,6 +2969,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2374,12 +3001,14 @@ function ($exception) { * Create request for operation 'fetchMembershipTierRedemptionLog' * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMembershipTierRedemptionLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMembershipTierRedemptionLogRequest($pagination_request_with_id_and_without_sort_options) + public function fetchMembershipTierRedemptionLogRequest($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMembershipTierRedemptionLog'][0]) { + // verify the required parameter 'pagination_request_with_id_and_without_sort_options' is set if ($pagination_request_with_id_and_without_sort_options === null || (is_array($pagination_request_with_id_and_without_sort_options) && count($pagination_request_with_id_and_without_sort_options) === 0)) { throw new \InvalidArgumentException( @@ -2387,6 +3016,7 @@ public function fetchMembershipTierRedemptionLogRequest($pagination_request_with ); } + $resourcePath = '/v2/membership/tier/redemption/log'; $formParams = []; $queryParams = []; @@ -2398,21 +3028,17 @@ public function fetchMembershipTierRedemptionLogRequest($pagination_request_with - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pagination_request_with_id_and_without_sort_options)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); } else { $httpBody = $pagination_request_with_id_and_without_sort_options; } @@ -2431,12 +3057,12 @@ public function fetchMembershipTierRedemptionLogRequest($pagination_request_with // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2452,10 +3078,11 @@ public function fetchMembershipTierRedemptionLogRequest($pagination_request_with $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2467,14 +3094,15 @@ public function fetchMembershipTierRedemptionLogRequest($pagination_request_with * Restore tier * * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMembershipTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMembershipTier|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreMembershipTier($id) + public function restoreMembershipTier($id, string $contentType = self::contentTypes['restoreMembershipTier'][0]) { - list($response) = $this->restoreMembershipTierWithHttpInfo($id); + list($response) = $this->restoreMembershipTierWithHttpInfo($id, $contentType); return $response; } @@ -2484,14 +3112,15 @@ public function restoreMembershipTier($id) * Restore tier * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMembershipTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMembershipTier|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreMembershipTierWithHttpInfo($id) + public function restoreMembershipTierWithHttpInfo($id, string $contentType = self::contentTypes['restoreMembershipTier'][0]) { - $request = $this->restoreMembershipTierRequest($id); + $request = $this->restoreMembershipTierRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2534,6 +3163,21 @@ public function restoreMembershipTierWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMembershipTier' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2546,6 +3190,21 @@ public function restoreMembershipTierWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2558,6 +3217,21 @@ public function restoreMembershipTierWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2570,6 +3244,21 @@ public function restoreMembershipTierWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2584,6 +3273,21 @@ public function restoreMembershipTierWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2637,13 +3341,14 @@ public function restoreMembershipTierWithHttpInfo($id) * Restore tier * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreMembershipTierAsync($id) + public function restoreMembershipTierAsync($id, string $contentType = self::contentTypes['restoreMembershipTier'][0]) { - return $this->restoreMembershipTierAsyncWithHttpInfo($id) + return $this->restoreMembershipTierAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -2657,14 +3362,15 @@ function ($response) { * Restore tier * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreMembershipTierAsyncWithHttpInfo($id) + public function restoreMembershipTierAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreMembershipTier'][0]) { $returnType = '\OpenAPI\Client\Model\WTMembershipTier'; - $request = $this->restoreMembershipTierRequest($id); + $request = $this->restoreMembershipTierRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2674,6 +3380,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2703,12 +3412,14 @@ function ($exception) { * Create request for operation 'restoreMembershipTier' * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreMembershipTierRequest($id) + public function restoreMembershipTierRequest($id, string $contentType = self::contentTypes['restoreMembershipTier'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -2724,7 +3435,7 @@ public function restoreMembershipTierRequest($id) if (!preg_match("/^[a-zA-Z0-9]+$/", $id)) { throw new \InvalidArgumentException("invalid value for \"id\" when calling MembershipTiersApi.restoreMembershipTier, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/membership/tier/{id}'; $formParams = []; @@ -2745,16 +3456,11 @@ public function restoreMembershipTierRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2772,12 +3478,12 @@ public function restoreMembershipTierRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2793,10 +3499,11 @@ public function restoreMembershipTierRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2809,14 +3516,15 @@ public function restoreMembershipTierRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTMembershipTierUpdateParams $wt_membership_tier_update_params wt_membership_tier_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMembershipTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMembershipTier|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function updateMembershipTier($id, $wt_membership_tier_update_params) + public function updateMembershipTier($id, $wt_membership_tier_update_params, string $contentType = self::contentTypes['updateMembershipTier'][0]) { - list($response) = $this->updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update_params); + list($response) = $this->updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update_params, $contentType); return $response; } @@ -2827,14 +3535,15 @@ public function updateMembershipTier($id, $wt_membership_tier_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTMembershipTierUpdateParams $wt_membership_tier_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMembershipTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMembershipTier|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update_params) + public function updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update_params, string $contentType = self::contentTypes['updateMembershipTier'][0]) { - $request = $this->updateMembershipTierRequest($id, $wt_membership_tier_update_params); + $request = $this->updateMembershipTierRequest($id, $wt_membership_tier_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -2877,6 +3586,21 @@ public function updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMembershipTier' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2889,6 +3613,21 @@ public function updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2901,6 +3640,21 @@ public function updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2913,6 +3667,21 @@ public function updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2925,6 +3694,21 @@ public function updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2937,6 +3721,21 @@ public function updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2951,6 +3750,21 @@ public function updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3021,13 +3835,14 @@ public function updateMembershipTierWithHttpInfo($id, $wt_membership_tier_update * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTMembershipTierUpdateParams $wt_membership_tier_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateMembershipTierAsync($id, $wt_membership_tier_update_params) + public function updateMembershipTierAsync($id, $wt_membership_tier_update_params, string $contentType = self::contentTypes['updateMembershipTier'][0]) { - return $this->updateMembershipTierAsyncWithHttpInfo($id, $wt_membership_tier_update_params) + return $this->updateMembershipTierAsyncWithHttpInfo($id, $wt_membership_tier_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -3042,14 +3857,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTMembershipTierUpdateParams $wt_membership_tier_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateMembershipTierAsyncWithHttpInfo($id, $wt_membership_tier_update_params) + public function updateMembershipTierAsyncWithHttpInfo($id, $wt_membership_tier_update_params, string $contentType = self::contentTypes['updateMembershipTier'][0]) { $returnType = '\OpenAPI\Client\Model\WTMembershipTier'; - $request = $this->updateMembershipTierRequest($id, $wt_membership_tier_update_params); + $request = $this->updateMembershipTierRequest($id, $wt_membership_tier_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3059,6 +3875,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3089,18 +3908,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTMembershipTierUpdateParams $wt_membership_tier_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateMembershipTierRequest($id, $wt_membership_tier_update_params) + public function updateMembershipTierRequest($id, $wt_membership_tier_update_params, string $contentType = self::contentTypes['updateMembershipTier'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateMembershipTier' ); } + // verify the required parameter 'wt_membership_tier_update_params' is set if ($wt_membership_tier_update_params === null || (is_array($wt_membership_tier_update_params) && count($wt_membership_tier_update_params) === 0)) { throw new \InvalidArgumentException( @@ -3108,6 +3930,7 @@ public function updateMembershipTierRequest($id, $wt_membership_tier_update_para ); } + $resourcePath = '/v2/membership/tier/{id}'; $formParams = []; $queryParams = []; @@ -3127,21 +3950,17 @@ public function updateMembershipTierRequest($id, $wt_membership_tier_update_para } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_membership_tier_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_membership_tier_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_membership_tier_update_params)); } else { $httpBody = $wt_membership_tier_update_params; } @@ -3160,12 +3979,12 @@ public function updateMembershipTierRequest($id, $wt_membership_tier_update_para // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3181,10 +4000,11 @@ public function updateMembershipTierRequest($id, $wt_membership_tier_update_para $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/MerchantApi.php b/lib/Api/MerchantApi.php index debc92c..f59adda 100644 --- a/lib/Api/MerchantApi.php +++ b/lib/Api/MerchantApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'archivePaymentObjectBroadcast' => [ + 'application/json', + ], + 'countInboundSMS' => [ + 'application/json', + ], + 'exportInboundMessages' => [ + 'application/json', + ], + 'exportOutboundMessages' => [ + 'application/json', + ], + 'fetchAdvertisementCreditBroadcasts' => [ + 'application/json', + ], + 'fetchCustomRoles' => [ + 'application/json', + ], + 'fetchDynamicVoucherBroadcasts' => [ + 'application/json', + ], + 'fetchEmployees' => [ + 'application/json', + ], + 'fetchHelpDeskRequests' => [ + 'application/json', + ], + 'fetchImportedList' => [ + 'application/json', + ], + 'fetchImportedLists' => [ + 'application/json', + ], + 'fetchInboundSMS' => [ + 'application/json', + ], + 'fetchInboundSMSByPage' => [ + 'application/json', + ], + 'fetchMerchantOutboundSMS' => [ + 'application/json', + ], + 'fetchMerchantPhoneNumbers' => [ + 'application/json', + ], + 'fetchOptInList' => [ + 'application/json', + ], + 'fetchOptInLists' => [ + 'application/json', + ], + 'fetchPhoneNumber' => [ + 'application/json', + ], + 'fetchPublicEmployees' => [ + 'application/json', + ], + 'fetchSimpleSMSBroadcasts' => [ + 'application/json', + ], + 'fetchStaticVoucherCampaignBroadcasts' => [ + 'application/json', + ], + 'fetchTCPAFilter' => [ + 'application/json', + ], + 'fetchWalletConfiguration' => [ + 'application/json', + ], + 'updateMerchant' => [ + 'application/json', + ], + 'updatePointsOfContact' => [ + 'application/json', + ], + 'updatePosIntegration' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -121,14 +206,15 @@ public function getConfig() * * Archive Merchant * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantProfile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveMerchantProfile() + public function archiveMerchantProfile(string $contentType = self::contentTypes['archiveMerchantProfile'][0]) { - list($response) = $this->archiveMerchantProfileWithHttpInfo(); + list($response) = $this->archiveMerchantProfileWithHttpInfo($contentType); return $response; } @@ -137,14 +223,15 @@ public function archiveMerchantProfile() * * Archive Merchant * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantProfile'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveMerchantProfileWithHttpInfo() + public function archiveMerchantProfileWithHttpInfo(string $contentType = self::contentTypes['archiveMerchantProfile'][0]) { - $request = $this->archiveMerchantProfileRequest(); + $request = $this->archiveMerchantProfileRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -187,6 +274,21 @@ public function archiveMerchantProfileWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -199,6 +301,21 @@ public function archiveMerchantProfileWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -211,6 +328,21 @@ public function archiveMerchantProfileWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -223,6 +355,21 @@ public function archiveMerchantProfileWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -237,6 +384,21 @@ public function archiveMerchantProfileWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -289,13 +451,14 @@ public function archiveMerchantProfileWithHttpInfo() * * Archive Merchant * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantProfile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveMerchantProfileAsync() + public function archiveMerchantProfileAsync(string $contentType = self::contentTypes['archiveMerchantProfile'][0]) { - return $this->archiveMerchantProfileAsyncWithHttpInfo() + return $this->archiveMerchantProfileAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -308,14 +471,15 @@ function ($response) { * * Archive Merchant * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantProfile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveMerchantProfileAsyncWithHttpInfo() + public function archiveMerchantProfileAsyncWithHttpInfo(string $contentType = self::contentTypes['archiveMerchantProfile'][0]) { $returnType = 'mixed'; - $request = $this->archiveMerchantProfileRequest(); + $request = $this->archiveMerchantProfileRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -325,6 +489,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -353,13 +520,15 @@ function ($exception) { /** * Create request for operation 'archiveMerchantProfile' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantProfile'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveMerchantProfileRequest() + public function archiveMerchantProfileRequest(string $contentType = self::contentTypes['archiveMerchantProfile'][0]) { + $resourcePath = '/v2/merchant/delete'; $formParams = []; $queryParams = []; @@ -371,16 +540,11 @@ public function archiveMerchantProfileRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -398,12 +562,12 @@ public function archiveMerchantProfileRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -419,10 +583,11 @@ public function archiveMerchantProfileRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -434,14 +599,15 @@ public function archiveMerchantProfileRequest() * Archive payment object broadcast * * @param mixed $broadcast_id broadcast_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePaymentObjectBroadcast'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archivePaymentObjectBroadcast($broadcast_id) + public function archivePaymentObjectBroadcast($broadcast_id, string $contentType = self::contentTypes['archivePaymentObjectBroadcast'][0]) { - list($response) = $this->archivePaymentObjectBroadcastWithHttpInfo($broadcast_id); + list($response) = $this->archivePaymentObjectBroadcastWithHttpInfo($broadcast_id, $contentType); return $response; } @@ -451,14 +617,15 @@ public function archivePaymentObjectBroadcast($broadcast_id) * Archive payment object broadcast * * @param mixed $broadcast_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePaymentObjectBroadcast'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archivePaymentObjectBroadcastWithHttpInfo($broadcast_id) + public function archivePaymentObjectBroadcastWithHttpInfo($broadcast_id, string $contentType = self::contentTypes['archivePaymentObjectBroadcast'][0]) { - $request = $this->archivePaymentObjectBroadcastRequest($broadcast_id); + $request = $this->archivePaymentObjectBroadcastRequest($broadcast_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -501,6 +668,21 @@ public function archivePaymentObjectBroadcastWithHttpInfo($broadcast_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -513,6 +695,21 @@ public function archivePaymentObjectBroadcastWithHttpInfo($broadcast_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -525,6 +722,21 @@ public function archivePaymentObjectBroadcastWithHttpInfo($broadcast_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -537,6 +749,21 @@ public function archivePaymentObjectBroadcastWithHttpInfo($broadcast_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -551,6 +778,21 @@ public function archivePaymentObjectBroadcastWithHttpInfo($broadcast_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -604,13 +846,14 @@ public function archivePaymentObjectBroadcastWithHttpInfo($broadcast_id) * Archive payment object broadcast * * @param mixed $broadcast_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePaymentObjectBroadcast'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePaymentObjectBroadcastAsync($broadcast_id) + public function archivePaymentObjectBroadcastAsync($broadcast_id, string $contentType = self::contentTypes['archivePaymentObjectBroadcast'][0]) { - return $this->archivePaymentObjectBroadcastAsyncWithHttpInfo($broadcast_id) + return $this->archivePaymentObjectBroadcastAsyncWithHttpInfo($broadcast_id, $contentType) ->then( function ($response) { return $response[0]; @@ -624,14 +867,15 @@ function ($response) { * Archive payment object broadcast * * @param mixed $broadcast_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePaymentObjectBroadcast'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePaymentObjectBroadcastAsyncWithHttpInfo($broadcast_id) + public function archivePaymentObjectBroadcastAsyncWithHttpInfo($broadcast_id, string $contentType = self::contentTypes['archivePaymentObjectBroadcast'][0]) { $returnType = 'mixed'; - $request = $this->archivePaymentObjectBroadcastRequest($broadcast_id); + $request = $this->archivePaymentObjectBroadcastRequest($broadcast_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -641,6 +885,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -670,12 +917,14 @@ function ($exception) { * Create request for operation 'archivePaymentObjectBroadcast' * * @param mixed $broadcast_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePaymentObjectBroadcast'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archivePaymentObjectBroadcastRequest($broadcast_id) + public function archivePaymentObjectBroadcastRequest($broadcast_id, string $contentType = self::contentTypes['archivePaymentObjectBroadcast'][0]) { + // verify the required parameter 'broadcast_id' is set if ($broadcast_id === null || (is_array($broadcast_id) && count($broadcast_id) === 0)) { throw new \InvalidArgumentException( @@ -683,6 +932,7 @@ public function archivePaymentObjectBroadcastRequest($broadcast_id) ); } + $resourcePath = '/v2/merchant/paymentObjectBroadcast/{broadcastID}'; $formParams = []; $queryParams = []; @@ -702,16 +952,11 @@ public function archivePaymentObjectBroadcastRequest($broadcast_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -729,12 +974,12 @@ public function archivePaymentObjectBroadcastRequest($broadcast_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -750,10 +995,11 @@ public function archivePaymentObjectBroadcastRequest($broadcast_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -767,14 +1013,15 @@ public function archivePaymentObjectBroadcastRequest($broadcast_id) * @param mixed $phone_number_id phone_number_id (required) * @param string $from_phone_number from_phone_number (optional) * @param string $body body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countInboundSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countInboundSMS($phone_number_id, $from_phone_number = null, $body = null) + public function countInboundSMS($phone_number_id, $from_phone_number = null, $body = null, string $contentType = self::contentTypes['countInboundSMS'][0]) { - list($response) = $this->countInboundSMSWithHttpInfo($phone_number_id, $from_phone_number, $body); + list($response) = $this->countInboundSMSWithHttpInfo($phone_number_id, $from_phone_number, $body, $contentType); return $response; } @@ -786,14 +1033,15 @@ public function countInboundSMS($phone_number_id, $from_phone_number = null, $bo * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) * @param string $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countInboundSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countInboundSMSWithHttpInfo($phone_number_id, $from_phone_number = null, $body = null) + public function countInboundSMSWithHttpInfo($phone_number_id, $from_phone_number = null, $body = null, string $contentType = self::contentTypes['countInboundSMS'][0]) { - $request = $this->countInboundSMSRequest($phone_number_id, $from_phone_number, $body); + $request = $this->countInboundSMSRequest($phone_number_id, $from_phone_number, $body, $contentType); try { $options = $this->createHttpClientOption(); @@ -836,6 +1084,21 @@ public function countInboundSMSWithHttpInfo($phone_number_id, $from_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -848,6 +1111,21 @@ public function countInboundSMSWithHttpInfo($phone_number_id, $from_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -860,6 +1138,21 @@ public function countInboundSMSWithHttpInfo($phone_number_id, $from_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -872,6 +1165,21 @@ public function countInboundSMSWithHttpInfo($phone_number_id, $from_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -886,6 +1194,21 @@ public function countInboundSMSWithHttpInfo($phone_number_id, $from_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -941,13 +1264,14 @@ public function countInboundSMSWithHttpInfo($phone_number_id, $from_phone_number * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) * @param string $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countInboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countInboundSMSAsync($phone_number_id, $from_phone_number = null, $body = null) + public function countInboundSMSAsync($phone_number_id, $from_phone_number = null, $body = null, string $contentType = self::contentTypes['countInboundSMS'][0]) { - return $this->countInboundSMSAsyncWithHttpInfo($phone_number_id, $from_phone_number, $body) + return $this->countInboundSMSAsyncWithHttpInfo($phone_number_id, $from_phone_number, $body, $contentType) ->then( function ($response) { return $response[0]; @@ -963,14 +1287,15 @@ function ($response) { * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) * @param string $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countInboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countInboundSMSAsyncWithHttpInfo($phone_number_id, $from_phone_number = null, $body = null) + public function countInboundSMSAsyncWithHttpInfo($phone_number_id, $from_phone_number = null, $body = null, string $contentType = self::contentTypes['countInboundSMS'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countInboundSMSRequest($phone_number_id, $from_phone_number, $body); + $request = $this->countInboundSMSRequest($phone_number_id, $from_phone_number, $body, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -980,6 +1305,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1011,12 +1339,14 @@ function ($exception) { * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) * @param string $body (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countInboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countInboundSMSRequest($phone_number_id, $from_phone_number = null, $body = null) + public function countInboundSMSRequest($phone_number_id, $from_phone_number = null, $body = null, string $contentType = self::contentTypes['countInboundSMS'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -1024,6 +1354,9 @@ public function countInboundSMSRequest($phone_number_id, $from_phone_number = nu ); } + + + $resourcePath = '/v2/merchant/sms/inbound/count/{phoneNumberID}'; $formParams = []; $queryParams = []; @@ -1032,27 +1365,23 @@ public function countInboundSMSRequest($phone_number_id, $from_phone_number = nu $multipart = false; // query params - if ($from_phone_number !== null) { - if('form' === 'form' && is_array($from_phone_number)) { - foreach($from_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['fromPhoneNumber'] = $from_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_phone_number, + 'fromPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($body !== null) { - if('form' === 'form' && is_array($body)) { - foreach($body as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['body'] = $body; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $body, + 'body', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -1065,16 +1394,11 @@ public function countInboundSMSRequest($phone_number_id, $from_phone_number = nu } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1092,12 +1416,12 @@ public function countInboundSMSRequest($phone_number_id, $from_phone_number = nu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1113,10 +1437,11 @@ public function countInboundSMSRequest($phone_number_id, $from_phone_number = nu $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1129,14 +1454,15 @@ public function countInboundSMSRequest($phone_number_id, $from_phone_number = nu * * @param string $phone_number_id phone_number_id (required) * @param string $locale locale (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportInboundMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function exportInboundMessages($phone_number_id, $locale) + public function exportInboundMessages($phone_number_id, $locale, string $contentType = self::contentTypes['exportInboundMessages'][0]) { - list($response) = $this->exportInboundMessagesWithHttpInfo($phone_number_id, $locale); + list($response) = $this->exportInboundMessagesWithHttpInfo($phone_number_id, $locale, $contentType); return $response; } @@ -1147,14 +1473,15 @@ public function exportInboundMessages($phone_number_id, $locale) * * @param string $phone_number_id (required) * @param string $locale (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportInboundMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function exportInboundMessagesWithHttpInfo($phone_number_id, $locale) + public function exportInboundMessagesWithHttpInfo($phone_number_id, $locale, string $contentType = self::contentTypes['exportInboundMessages'][0]) { - $request = $this->exportInboundMessagesRequest($phone_number_id, $locale); + $request = $this->exportInboundMessagesRequest($phone_number_id, $locale, $contentType); try { $options = $this->createHttpClientOption(); @@ -1197,6 +1524,21 @@ public function exportInboundMessagesWithHttpInfo($phone_number_id, $locale) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1209,6 +1551,21 @@ public function exportInboundMessagesWithHttpInfo($phone_number_id, $locale) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1221,6 +1578,21 @@ public function exportInboundMessagesWithHttpInfo($phone_number_id, $locale) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1233,6 +1605,21 @@ public function exportInboundMessagesWithHttpInfo($phone_number_id, $locale) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1247,6 +1634,21 @@ public function exportInboundMessagesWithHttpInfo($phone_number_id, $locale) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1301,13 +1703,14 @@ public function exportInboundMessagesWithHttpInfo($phone_number_id, $locale) * * @param string $phone_number_id (required) * @param string $locale (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportInboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportInboundMessagesAsync($phone_number_id, $locale) + public function exportInboundMessagesAsync($phone_number_id, $locale, string $contentType = self::contentTypes['exportInboundMessages'][0]) { - return $this->exportInboundMessagesAsyncWithHttpInfo($phone_number_id, $locale) + return $this->exportInboundMessagesAsyncWithHttpInfo($phone_number_id, $locale, $contentType) ->then( function ($response) { return $response[0]; @@ -1322,14 +1725,15 @@ function ($response) { * * @param string $phone_number_id (required) * @param string $locale (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportInboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportInboundMessagesAsyncWithHttpInfo($phone_number_id, $locale) + public function exportInboundMessagesAsyncWithHttpInfo($phone_number_id, $locale, string $contentType = self::contentTypes['exportInboundMessages'][0]) { $returnType = 'string'; - $request = $this->exportInboundMessagesRequest($phone_number_id, $locale); + $request = $this->exportInboundMessagesRequest($phone_number_id, $locale, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1339,6 +1743,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1369,12 +1776,14 @@ function ($exception) { * * @param string $phone_number_id (required) * @param string $locale (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportInboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function exportInboundMessagesRequest($phone_number_id, $locale) + public function exportInboundMessagesRequest($phone_number_id, $locale, string $contentType = self::contentTypes['exportInboundMessages'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -1390,7 +1799,7 @@ public function exportInboundMessagesRequest($phone_number_id, $locale) if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling MerchantApi.exportInboundMessages, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( @@ -1398,6 +1807,7 @@ public function exportInboundMessagesRequest($phone_number_id, $locale) ); } + $resourcePath = '/v2/merchant/sms/inbound/export/{phoneNumberID}'; $formParams = []; $queryParams = []; @@ -1406,16 +1816,14 @@ public function exportInboundMessagesRequest($phone_number_id, $locale) $multipart = false; // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // path params @@ -1428,16 +1836,11 @@ public function exportInboundMessagesRequest($phone_number_id, $locale) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1455,12 +1858,12 @@ public function exportInboundMessagesRequest($phone_number_id, $locale) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1476,10 +1879,11 @@ public function exportInboundMessagesRequest($phone_number_id, $locale) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1493,14 +1897,15 @@ public function exportInboundMessagesRequest($phone_number_id, $locale) * @param string $phone_number_id phone_number_id (required) * @param string $locale locale (required) * @param string $payment_object_broadcast_id payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportOutboundMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function exportOutboundMessages($phone_number_id, $locale, $payment_object_broadcast_id = null) + public function exportOutboundMessages($phone_number_id, $locale, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['exportOutboundMessages'][0]) { - list($response) = $this->exportOutboundMessagesWithHttpInfo($phone_number_id, $locale, $payment_object_broadcast_id); + list($response) = $this->exportOutboundMessagesWithHttpInfo($phone_number_id, $locale, $payment_object_broadcast_id, $contentType); return $response; } @@ -1512,14 +1917,15 @@ public function exportOutboundMessages($phone_number_id, $locale, $payment_objec * @param string $phone_number_id (required) * @param string $locale (required) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportOutboundMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function exportOutboundMessagesWithHttpInfo($phone_number_id, $locale, $payment_object_broadcast_id = null) + public function exportOutboundMessagesWithHttpInfo($phone_number_id, $locale, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['exportOutboundMessages'][0]) { - $request = $this->exportOutboundMessagesRequest($phone_number_id, $locale, $payment_object_broadcast_id); + $request = $this->exportOutboundMessagesRequest($phone_number_id, $locale, $payment_object_broadcast_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1562,6 +1968,21 @@ public function exportOutboundMessagesWithHttpInfo($phone_number_id, $locale, $p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1574,6 +1995,21 @@ public function exportOutboundMessagesWithHttpInfo($phone_number_id, $locale, $p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1586,6 +2022,21 @@ public function exportOutboundMessagesWithHttpInfo($phone_number_id, $locale, $p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1598,6 +2049,21 @@ public function exportOutboundMessagesWithHttpInfo($phone_number_id, $locale, $p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1612,6 +2078,21 @@ public function exportOutboundMessagesWithHttpInfo($phone_number_id, $locale, $p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1667,13 +2148,14 @@ public function exportOutboundMessagesWithHttpInfo($phone_number_id, $locale, $p * @param string $phone_number_id (required) * @param string $locale (required) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportOutboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportOutboundMessagesAsync($phone_number_id, $locale, $payment_object_broadcast_id = null) + public function exportOutboundMessagesAsync($phone_number_id, $locale, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['exportOutboundMessages'][0]) { - return $this->exportOutboundMessagesAsyncWithHttpInfo($phone_number_id, $locale, $payment_object_broadcast_id) + return $this->exportOutboundMessagesAsyncWithHttpInfo($phone_number_id, $locale, $payment_object_broadcast_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1689,14 +2171,15 @@ function ($response) { * @param string $phone_number_id (required) * @param string $locale (required) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportOutboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportOutboundMessagesAsyncWithHttpInfo($phone_number_id, $locale, $payment_object_broadcast_id = null) + public function exportOutboundMessagesAsyncWithHttpInfo($phone_number_id, $locale, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['exportOutboundMessages'][0]) { $returnType = 'string'; - $request = $this->exportOutboundMessagesRequest($phone_number_id, $locale, $payment_object_broadcast_id); + $request = $this->exportOutboundMessagesRequest($phone_number_id, $locale, $payment_object_broadcast_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1706,6 +2189,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1737,12 +2223,14 @@ function ($exception) { * @param string $phone_number_id (required) * @param string $locale (required) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportOutboundMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function exportOutboundMessagesRequest($phone_number_id, $locale, $payment_object_broadcast_id = null) + public function exportOutboundMessagesRequest($phone_number_id, $locale, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['exportOutboundMessages'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -1758,13 +2246,14 @@ public function exportOutboundMessagesRequest($phone_number_id, $locale, $paymen if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling MerchantApi.exportOutboundMessages, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'locale' is set if ($locale === null || (is_array($locale) && count($locale) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $locale when calling exportOutboundMessages' ); } + if ($payment_object_broadcast_id !== null && strlen($payment_object_broadcast_id) > 10) { throw new \InvalidArgumentException('invalid length for "$payment_object_broadcast_id" when calling MerchantApi.exportOutboundMessages, must be smaller than or equal to 10.'); } @@ -1774,7 +2263,7 @@ public function exportOutboundMessagesRequest($phone_number_id, $locale, $paymen if ($payment_object_broadcast_id !== null && !preg_match("/^[a-zA-Z0-9]+$/", $payment_object_broadcast_id)) { throw new \InvalidArgumentException("invalid value for \"payment_object_broadcast_id\" when calling MerchantApi.exportOutboundMessages, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/merchant/sms/outbound/export/{phoneNumberID}'; $formParams = []; @@ -1784,27 +2273,23 @@ public function exportOutboundMessagesRequest($phone_number_id, $locale, $paymen $multipart = false; // query params - if ($locale !== null) { - if('form' === 'form' && is_array($locale)) { - foreach($locale as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['locale'] = $locale; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $locale, + 'locale', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($payment_object_broadcast_id !== null) { - if('form' === 'form' && is_array($payment_object_broadcast_id)) { - foreach($payment_object_broadcast_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['paymentObjectBroadcastID'] = $payment_object_broadcast_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payment_object_broadcast_id, + 'paymentObjectBroadcastID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -1817,16 +2302,11 @@ public function exportOutboundMessagesRequest($phone_number_id, $locale, $paymen } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1844,12 +2324,12 @@ public function exportOutboundMessagesRequest($phone_number_id, $locale, $paymen // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1865,10 +2345,11 @@ public function exportOutboundMessagesRequest($phone_number_id, $locale, $paymen $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1880,14 +2361,15 @@ public function exportOutboundMessagesRequest($phone_number_id, $locale, $paymen * Fetch all ad credit broadcasts * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\AdvertisementCreditBroadcast[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAdvertisementCreditBroadcasts($is_archive_included = null) + public function fetchAdvertisementCreditBroadcasts($is_archive_included = null, string $contentType = self::contentTypes['fetchAdvertisementCreditBroadcasts'][0]) { - list($response) = $this->fetchAdvertisementCreditBroadcastsWithHttpInfo($is_archive_included); + list($response) = $this->fetchAdvertisementCreditBroadcastsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -1897,14 +2379,15 @@ public function fetchAdvertisementCreditBroadcasts($is_archive_included = null) * Fetch all ad credit broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\AdvertisementCreditBroadcast[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAdvertisementCreditBroadcastsWithHttpInfo($is_archive_included = null) + public function fetchAdvertisementCreditBroadcastsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAdvertisementCreditBroadcasts'][0]) { - $request = $this->fetchAdvertisementCreditBroadcastsRequest($is_archive_included); + $request = $this->fetchAdvertisementCreditBroadcastsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -1947,6 +2430,21 @@ public function fetchAdvertisementCreditBroadcastsWithHttpInfo($is_archive_inclu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AdvertisementCreditBroadcast[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1959,6 +2457,21 @@ public function fetchAdvertisementCreditBroadcastsWithHttpInfo($is_archive_inclu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1971,6 +2484,21 @@ public function fetchAdvertisementCreditBroadcastsWithHttpInfo($is_archive_inclu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1983,6 +2511,21 @@ public function fetchAdvertisementCreditBroadcastsWithHttpInfo($is_archive_inclu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1997,6 +2540,21 @@ public function fetchAdvertisementCreditBroadcastsWithHttpInfo($is_archive_inclu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2050,13 +2608,14 @@ public function fetchAdvertisementCreditBroadcastsWithHttpInfo($is_archive_inclu * Fetch all ad credit broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAdvertisementCreditBroadcastsAsync($is_archive_included = null) + public function fetchAdvertisementCreditBroadcastsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAdvertisementCreditBroadcasts'][0]) { - return $this->fetchAdvertisementCreditBroadcastsAsyncWithHttpInfo($is_archive_included) + return $this->fetchAdvertisementCreditBroadcastsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -2070,14 +2629,15 @@ function ($response) { * Fetch all ad credit broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAdvertisementCreditBroadcastsAsyncWithHttpInfo($is_archive_included = null) + public function fetchAdvertisementCreditBroadcastsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAdvertisementCreditBroadcasts'][0]) { $returnType = '\OpenAPI\Client\Model\AdvertisementCreditBroadcast[]'; - $request = $this->fetchAdvertisementCreditBroadcastsRequest($is_archive_included); + $request = $this->fetchAdvertisementCreditBroadcastsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2087,6 +2647,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2116,13 +2679,16 @@ function ($exception) { * Create request for operation 'fetchAdvertisementCreditBroadcasts' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAdvertisementCreditBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAdvertisementCreditBroadcastsRequest($is_archive_included = null) + public function fetchAdvertisementCreditBroadcastsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAdvertisementCreditBroadcasts'][0]) { + + $resourcePath = '/v2/merchant/broadcasts/adCredits/all'; $formParams = []; $queryParams = []; @@ -2131,30 +2697,23 @@ public function fetchAdvertisementCreditBroadcastsRequest($is_archive_included = $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2172,12 +2731,12 @@ public function fetchAdvertisementCreditBroadcastsRequest($is_archive_included = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2193,10 +2752,11 @@ public function fetchAdvertisementCreditBroadcastsRequest($is_archive_included = $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2207,14 +2767,15 @@ public function fetchAdvertisementCreditBroadcastsRequest($is_archive_included = * * Fetch custom roles * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchCustomRoles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchCustomRoles() + public function fetchCustomRoles(string $contentType = self::contentTypes['fetchCustomRoles'][0]) { - list($response) = $this->fetchCustomRolesWithHttpInfo(); + list($response) = $this->fetchCustomRolesWithHttpInfo($contentType); return $response; } @@ -2223,14 +2784,15 @@ public function fetchCustomRoles() * * Fetch custom roles * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchCustomRoles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchCustomRolesWithHttpInfo() + public function fetchCustomRolesWithHttpInfo(string $contentType = self::contentTypes['fetchCustomRoles'][0]) { - $request = $this->fetchCustomRolesRequest(); + $request = $this->fetchCustomRolesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -2273,6 +2835,21 @@ public function fetchCustomRolesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2285,6 +2862,21 @@ public function fetchCustomRolesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2297,6 +2889,21 @@ public function fetchCustomRolesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2309,6 +2916,21 @@ public function fetchCustomRolesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2323,6 +2945,21 @@ public function fetchCustomRolesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2375,13 +3012,14 @@ public function fetchCustomRolesWithHttpInfo() * * Fetch custom roles * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchCustomRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchCustomRolesAsync() + public function fetchCustomRolesAsync(string $contentType = self::contentTypes['fetchCustomRoles'][0]) { - return $this->fetchCustomRolesAsyncWithHttpInfo() + return $this->fetchCustomRolesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -2394,14 +3032,15 @@ function ($response) { * * Fetch custom roles * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchCustomRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchCustomRolesAsyncWithHttpInfo() + public function fetchCustomRolesAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchCustomRoles'][0]) { $returnType = 'mixed'; - $request = $this->fetchCustomRolesRequest(); + $request = $this->fetchCustomRolesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2411,6 +3050,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2439,13 +3081,15 @@ function ($exception) { /** * Create request for operation 'fetchCustomRoles' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchCustomRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchCustomRolesRequest() + public function fetchCustomRolesRequest(string $contentType = self::contentTypes['fetchCustomRoles'][0]) { + $resourcePath = '/v2/merchant/roles/custom'; $formParams = []; $queryParams = []; @@ -2457,16 +3101,11 @@ public function fetchCustomRolesRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2484,12 +3123,12 @@ public function fetchCustomRolesRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2505,10 +3144,11 @@ public function fetchCustomRolesRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2520,14 +3160,15 @@ public function fetchCustomRolesRequest() * Fetch all dynamic voucher broadcasts * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\DynamicVoucherBroadcast[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchDynamicVoucherBroadcasts($is_archive_included = null) + public function fetchDynamicVoucherBroadcasts($is_archive_included = null, string $contentType = self::contentTypes['fetchDynamicVoucherBroadcasts'][0]) { - list($response) = $this->fetchDynamicVoucherBroadcastsWithHttpInfo($is_archive_included); + list($response) = $this->fetchDynamicVoucherBroadcastsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -2537,14 +3178,15 @@ public function fetchDynamicVoucherBroadcasts($is_archive_included = null) * Fetch all dynamic voucher broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\DynamicVoucherBroadcast[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchDynamicVoucherBroadcastsWithHttpInfo($is_archive_included = null) + public function fetchDynamicVoucherBroadcastsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchDynamicVoucherBroadcasts'][0]) { - $request = $this->fetchDynamicVoucherBroadcastsRequest($is_archive_included); + $request = $this->fetchDynamicVoucherBroadcastsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -2587,6 +3229,21 @@ public function fetchDynamicVoucherBroadcastsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DynamicVoucherBroadcast[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2599,6 +3256,21 @@ public function fetchDynamicVoucherBroadcastsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2611,6 +3283,21 @@ public function fetchDynamicVoucherBroadcastsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2623,6 +3310,21 @@ public function fetchDynamicVoucherBroadcastsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2637,6 +3339,21 @@ public function fetchDynamicVoucherBroadcastsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2690,13 +3407,14 @@ public function fetchDynamicVoucherBroadcastsWithHttpInfo($is_archive_included = * Fetch all dynamic voucher broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDynamicVoucherBroadcastsAsync($is_archive_included = null) + public function fetchDynamicVoucherBroadcastsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchDynamicVoucherBroadcasts'][0]) { - return $this->fetchDynamicVoucherBroadcastsAsyncWithHttpInfo($is_archive_included) + return $this->fetchDynamicVoucherBroadcastsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -2710,14 +3428,15 @@ function ($response) { * Fetch all dynamic voucher broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchDynamicVoucherBroadcastsAsyncWithHttpInfo($is_archive_included = null) + public function fetchDynamicVoucherBroadcastsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchDynamicVoucherBroadcasts'][0]) { $returnType = '\OpenAPI\Client\Model\DynamicVoucherBroadcast[]'; - $request = $this->fetchDynamicVoucherBroadcastsRequest($is_archive_included); + $request = $this->fetchDynamicVoucherBroadcastsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2727,6 +3446,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2756,13 +3478,16 @@ function ($exception) { * Create request for operation 'fetchDynamicVoucherBroadcasts' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchDynamicVoucherBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchDynamicVoucherBroadcastsRequest($is_archive_included = null) + public function fetchDynamicVoucherBroadcastsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchDynamicVoucherBroadcasts'][0]) { + + $resourcePath = '/v2/merchant/broadcasts/dynamicVouchers/all'; $formParams = []; $queryParams = []; @@ -2771,30 +3496,23 @@ public function fetchDynamicVoucherBroadcastsRequest($is_archive_included = null $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2812,12 +3530,12 @@ public function fetchDynamicVoucherBroadcastsRequest($is_archive_included = null // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2833,10 +3551,11 @@ public function fetchDynamicVoucherBroadcastsRequest($is_archive_included = null $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2847,14 +3566,15 @@ public function fetchDynamicVoucherBroadcastsRequest($is_archive_included = null * * Fetch all employees * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployees'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchEmployees() + public function fetchEmployees(string $contentType = self::contentTypes['fetchEmployees'][0]) { - list($response) = $this->fetchEmployeesWithHttpInfo(); + list($response) = $this->fetchEmployeesWithHttpInfo($contentType); return $response; } @@ -2863,14 +3583,15 @@ public function fetchEmployees() * * Fetch all employees * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployees'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchEmployeesWithHttpInfo() + public function fetchEmployeesWithHttpInfo(string $contentType = self::contentTypes['fetchEmployees'][0]) { - $request = $this->fetchEmployeesRequest(); + $request = $this->fetchEmployeesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -2913,6 +3634,21 @@ public function fetchEmployeesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2925,6 +3661,21 @@ public function fetchEmployeesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2937,6 +3688,21 @@ public function fetchEmployeesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2949,6 +3715,21 @@ public function fetchEmployeesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2963,6 +3744,21 @@ public function fetchEmployeesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3015,13 +3811,14 @@ public function fetchEmployeesWithHttpInfo() * * Fetch all employees * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployees'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchEmployeesAsync() + public function fetchEmployeesAsync(string $contentType = self::contentTypes['fetchEmployees'][0]) { - return $this->fetchEmployeesAsyncWithHttpInfo() + return $this->fetchEmployeesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -3034,14 +3831,15 @@ function ($response) { * * Fetch all employees * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployees'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchEmployeesAsyncWithHttpInfo() + public function fetchEmployeesAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchEmployees'][0]) { $returnType = 'mixed'; - $request = $this->fetchEmployeesRequest(); + $request = $this->fetchEmployeesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3051,6 +3849,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3079,13 +3880,15 @@ function ($exception) { /** * Create request for operation 'fetchEmployees' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployees'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchEmployeesRequest() + public function fetchEmployeesRequest(string $contentType = self::contentTypes['fetchEmployees'][0]) { + $resourcePath = '/v2/merchant/employees/all'; $formParams = []; $queryParams = []; @@ -3097,16 +3900,11 @@ public function fetchEmployeesRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3124,12 +3922,12 @@ public function fetchEmployeesRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3145,10 +3943,11 @@ public function fetchEmployeesRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3161,14 +3960,15 @@ public function fetchEmployeesRequest() * * @param mixed $phone_number_id phone_number_id (required) * @param bool $is_resolved is_resolved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchHelpDeskRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\HelpDeskRequest[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchHelpDeskRequests($phone_number_id, $is_resolved = null) + public function fetchHelpDeskRequests($phone_number_id, $is_resolved = null, string $contentType = self::contentTypes['fetchHelpDeskRequests'][0]) { - list($response) = $this->fetchHelpDeskRequestsWithHttpInfo($phone_number_id, $is_resolved); + list($response) = $this->fetchHelpDeskRequestsWithHttpInfo($phone_number_id, $is_resolved, $contentType); return $response; } @@ -3179,14 +3979,15 @@ public function fetchHelpDeskRequests($phone_number_id, $is_resolved = null) * * @param mixed $phone_number_id (required) * @param bool $is_resolved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchHelpDeskRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\HelpDeskRequest[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchHelpDeskRequestsWithHttpInfo($phone_number_id, $is_resolved = null) + public function fetchHelpDeskRequestsWithHttpInfo($phone_number_id, $is_resolved = null, string $contentType = self::contentTypes['fetchHelpDeskRequests'][0]) { - $request = $this->fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved); + $request = $this->fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved, $contentType); try { $options = $this->createHttpClientOption(); @@ -3229,6 +4030,21 @@ public function fetchHelpDeskRequestsWithHttpInfo($phone_number_id, $is_resolved $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\HelpDeskRequest[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3241,6 +4057,21 @@ public function fetchHelpDeskRequestsWithHttpInfo($phone_number_id, $is_resolved $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3253,6 +4084,21 @@ public function fetchHelpDeskRequestsWithHttpInfo($phone_number_id, $is_resolved $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3265,6 +4111,21 @@ public function fetchHelpDeskRequestsWithHttpInfo($phone_number_id, $is_resolved $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3279,6 +4140,21 @@ public function fetchHelpDeskRequestsWithHttpInfo($phone_number_id, $is_resolved $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3333,13 +4209,14 @@ public function fetchHelpDeskRequestsWithHttpInfo($phone_number_id, $is_resolved * * @param mixed $phone_number_id (required) * @param bool $is_resolved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchHelpDeskRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchHelpDeskRequestsAsync($phone_number_id, $is_resolved = null) + public function fetchHelpDeskRequestsAsync($phone_number_id, $is_resolved = null, string $contentType = self::contentTypes['fetchHelpDeskRequests'][0]) { - return $this->fetchHelpDeskRequestsAsyncWithHttpInfo($phone_number_id, $is_resolved) + return $this->fetchHelpDeskRequestsAsyncWithHttpInfo($phone_number_id, $is_resolved, $contentType) ->then( function ($response) { return $response[0]; @@ -3354,14 +4231,15 @@ function ($response) { * * @param mixed $phone_number_id (required) * @param bool $is_resolved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchHelpDeskRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchHelpDeskRequestsAsyncWithHttpInfo($phone_number_id, $is_resolved = null) + public function fetchHelpDeskRequestsAsyncWithHttpInfo($phone_number_id, $is_resolved = null, string $contentType = self::contentTypes['fetchHelpDeskRequests'][0]) { $returnType = '\OpenAPI\Client\Model\HelpDeskRequest[]'; - $request = $this->fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved); + $request = $this->fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3371,6 +4249,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3401,12 +4282,14 @@ function ($exception) { * * @param mixed $phone_number_id (required) * @param bool $is_resolved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchHelpDeskRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved = null) + public function fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved = null, string $contentType = self::contentTypes['fetchHelpDeskRequests'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -3414,6 +4297,8 @@ public function fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved = nu ); } + + $resourcePath = '/v2/merchant/helpDeskRequests/{phoneNumberID}'; $formParams = []; $queryParams = []; @@ -3422,16 +4307,14 @@ public function fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved = nu $multipart = false; // query params - if ($is_resolved !== null) { - if('form' === 'form' && is_array($is_resolved)) { - foreach($is_resolved as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isResolved'] = $is_resolved; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_resolved, + 'isResolved', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -3444,16 +4327,11 @@ public function fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved = nu } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3471,12 +4349,12 @@ public function fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved = nu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3492,10 +4370,11 @@ public function fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved = nu $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3507,14 +4386,15 @@ public function fetchHelpDeskRequestsRequest($phone_number_id, $is_resolved = nu * Fetch imported list * * @param mixed $list_id list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ImportedList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchImportedList($list_id) + public function fetchImportedList($list_id, string $contentType = self::contentTypes['fetchImportedList'][0]) { - list($response) = $this->fetchImportedListWithHttpInfo($list_id); + list($response) = $this->fetchImportedListWithHttpInfo($list_id, $contentType); return $response; } @@ -3524,14 +4404,15 @@ public function fetchImportedList($list_id) * Fetch imported list * * @param mixed $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ImportedList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchImportedListWithHttpInfo($list_id) + public function fetchImportedListWithHttpInfo($list_id, string $contentType = self::contentTypes['fetchImportedList'][0]) { - $request = $this->fetchImportedListRequest($list_id); + $request = $this->fetchImportedListRequest($list_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3574,6 +4455,21 @@ public function fetchImportedListWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ImportedList' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3586,6 +4482,21 @@ public function fetchImportedListWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3598,6 +4509,21 @@ public function fetchImportedListWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3610,6 +4536,21 @@ public function fetchImportedListWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3624,6 +4565,21 @@ public function fetchImportedListWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3677,13 +4633,14 @@ public function fetchImportedListWithHttpInfo($list_id) * Fetch imported list * * @param mixed $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchImportedListAsync($list_id) + public function fetchImportedListAsync($list_id, string $contentType = self::contentTypes['fetchImportedList'][0]) { - return $this->fetchImportedListAsyncWithHttpInfo($list_id) + return $this->fetchImportedListAsyncWithHttpInfo($list_id, $contentType) ->then( function ($response) { return $response[0]; @@ -3697,14 +4654,15 @@ function ($response) { * Fetch imported list * * @param mixed $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchImportedListAsyncWithHttpInfo($list_id) + public function fetchImportedListAsyncWithHttpInfo($list_id, string $contentType = self::contentTypes['fetchImportedList'][0]) { $returnType = '\OpenAPI\Client\Model\ImportedList'; - $request = $this->fetchImportedListRequest($list_id); + $request = $this->fetchImportedListRequest($list_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3714,6 +4672,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3743,12 +4704,14 @@ function ($exception) { * Create request for operation 'fetchImportedList' * * @param mixed $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchImportedListRequest($list_id) + public function fetchImportedListRequest($list_id, string $contentType = self::contentTypes['fetchImportedList'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -3756,6 +4719,7 @@ public function fetchImportedListRequest($list_id) ); } + $resourcePath = '/v2/merchant/lists/imported/{listID}'; $formParams = []; $queryParams = []; @@ -3775,16 +4739,11 @@ public function fetchImportedListRequest($list_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3802,12 +4761,12 @@ public function fetchImportedListRequest($list_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3823,10 +4782,11 @@ public function fetchImportedListRequest($list_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3838,14 +4798,15 @@ public function fetchImportedListRequest($list_id) * Fetch all imported lists * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedLists'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchImportedLists($is_archive_included = null) + public function fetchImportedLists($is_archive_included = null, string $contentType = self::contentTypes['fetchImportedLists'][0]) { - list($response) = $this->fetchImportedListsWithHttpInfo($is_archive_included); + list($response) = $this->fetchImportedListsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -3855,14 +4816,15 @@ public function fetchImportedLists($is_archive_included = null) * Fetch all imported lists * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedLists'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchImportedListsWithHttpInfo($is_archive_included = null) + public function fetchImportedListsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchImportedLists'][0]) { - $request = $this->fetchImportedListsRequest($is_archive_included); + $request = $this->fetchImportedListsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -3905,6 +4867,21 @@ public function fetchImportedListsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3917,6 +4894,21 @@ public function fetchImportedListsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3929,6 +4921,21 @@ public function fetchImportedListsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3941,6 +4948,21 @@ public function fetchImportedListsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3955,6 +4977,21 @@ public function fetchImportedListsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4008,13 +5045,14 @@ public function fetchImportedListsWithHttpInfo($is_archive_included = null) * Fetch all imported lists * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedLists'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchImportedListsAsync($is_archive_included = null) + public function fetchImportedListsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchImportedLists'][0]) { - return $this->fetchImportedListsAsyncWithHttpInfo($is_archive_included) + return $this->fetchImportedListsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -4028,14 +5066,15 @@ function ($response) { * Fetch all imported lists * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedLists'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchImportedListsAsyncWithHttpInfo($is_archive_included = null) + public function fetchImportedListsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchImportedLists'][0]) { $returnType = 'mixed'; - $request = $this->fetchImportedListsRequest($is_archive_included); + $request = $this->fetchImportedListsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4045,6 +5084,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4074,13 +5116,16 @@ function ($exception) { * Create request for operation 'fetchImportedLists' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedLists'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchImportedListsRequest($is_archive_included = null) + public function fetchImportedListsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchImportedLists'][0]) { + + $resourcePath = '/v2/merchant/lists/imported/all'; $formParams = []; $queryParams = []; @@ -4089,30 +5134,23 @@ public function fetchImportedListsRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4130,12 +5168,12 @@ public function fetchImportedListsRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4151,10 +5189,11 @@ public function fetchImportedListsRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4167,14 +5206,15 @@ public function fetchImportedListsRequest($is_archive_included = null) * * @param mixed $phone_number_id phone_number_id (required) * @param string $from_phone_number from_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInboundSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\InboundSMS[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInboundSMS($phone_number_id, $from_phone_number = null) + public function fetchInboundSMS($phone_number_id, $from_phone_number = null, string $contentType = self::contentTypes['fetchInboundSMS'][0]) { - list($response) = $this->fetchInboundSMSWithHttpInfo($phone_number_id, $from_phone_number); + list($response) = $this->fetchInboundSMSWithHttpInfo($phone_number_id, $from_phone_number, $contentType); return $response; } @@ -4185,14 +5225,15 @@ public function fetchInboundSMS($phone_number_id, $from_phone_number = null) * * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInboundSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\InboundSMS[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInboundSMSWithHttpInfo($phone_number_id, $from_phone_number = null) + public function fetchInboundSMSWithHttpInfo($phone_number_id, $from_phone_number = null, string $contentType = self::contentTypes['fetchInboundSMS'][0]) { - $request = $this->fetchInboundSMSRequest($phone_number_id, $from_phone_number); + $request = $this->fetchInboundSMSRequest($phone_number_id, $from_phone_number, $contentType); try { $options = $this->createHttpClientOption(); @@ -4235,6 +5276,21 @@ public function fetchInboundSMSWithHttpInfo($phone_number_id, $from_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InboundSMS[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4247,6 +5303,21 @@ public function fetchInboundSMSWithHttpInfo($phone_number_id, $from_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4259,6 +5330,21 @@ public function fetchInboundSMSWithHttpInfo($phone_number_id, $from_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4271,6 +5357,21 @@ public function fetchInboundSMSWithHttpInfo($phone_number_id, $from_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4285,6 +5386,21 @@ public function fetchInboundSMSWithHttpInfo($phone_number_id, $from_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4339,13 +5455,14 @@ public function fetchInboundSMSWithHttpInfo($phone_number_id, $from_phone_number * * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInboundSMSAsync($phone_number_id, $from_phone_number = null) + public function fetchInboundSMSAsync($phone_number_id, $from_phone_number = null, string $contentType = self::contentTypes['fetchInboundSMS'][0]) { - return $this->fetchInboundSMSAsyncWithHttpInfo($phone_number_id, $from_phone_number) + return $this->fetchInboundSMSAsyncWithHttpInfo($phone_number_id, $from_phone_number, $contentType) ->then( function ($response) { return $response[0]; @@ -4360,14 +5477,15 @@ function ($response) { * * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInboundSMSAsyncWithHttpInfo($phone_number_id, $from_phone_number = null) + public function fetchInboundSMSAsyncWithHttpInfo($phone_number_id, $from_phone_number = null, string $contentType = self::contentTypes['fetchInboundSMS'][0]) { $returnType = '\OpenAPI\Client\Model\InboundSMS[]'; - $request = $this->fetchInboundSMSRequest($phone_number_id, $from_phone_number); + $request = $this->fetchInboundSMSRequest($phone_number_id, $from_phone_number, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4377,6 +5495,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4407,12 +5528,14 @@ function ($exception) { * * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInboundSMSRequest($phone_number_id, $from_phone_number = null) + public function fetchInboundSMSRequest($phone_number_id, $from_phone_number = null, string $contentType = self::contentTypes['fetchInboundSMS'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -4420,6 +5543,8 @@ public function fetchInboundSMSRequest($phone_number_id, $from_phone_number = nu ); } + + $resourcePath = '/v2/merchant/sms/inbound/{phoneNumberID}'; $formParams = []; $queryParams = []; @@ -4428,16 +5553,14 @@ public function fetchInboundSMSRequest($phone_number_id, $from_phone_number = nu $multipart = false; // query params - if ($from_phone_number !== null) { - if('form' === 'form' && is_array($from_phone_number)) { - foreach($from_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['fromPhoneNumber'] = $from_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_phone_number, + 'fromPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -4450,16 +5573,11 @@ public function fetchInboundSMSRequest($phone_number_id, $from_phone_number = nu } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4477,12 +5595,12 @@ public function fetchInboundSMSRequest($phone_number_id, $from_phone_number = nu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4498,10 +5616,11 @@ public function fetchInboundSMSRequest($phone_number_id, $from_phone_number = nu $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4514,16 +5633,17 @@ public function fetchInboundSMSRequest($phone_number_id, $from_phone_number = nu * * @param mixed $phone_number_id phone_number_id (required) * @param string $from_phone_number from_phone_number (optional) - * @param double $page_size page_size (optional) - * @param double $page_num page_num (optional) + * @param float $page_size page_size (optional) + * @param float $page_num page_num (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInboundSMSByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2002|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchInboundSMSByPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchInboundSMSByPage($phone_number_id, $from_phone_number = null, $page_size = null, $page_num = null) + public function fetchInboundSMSByPage($phone_number_id, $from_phone_number = null, $page_size = null, $page_num = null, string $contentType = self::contentTypes['fetchInboundSMSByPage'][0]) { - list($response) = $this->fetchInboundSMSByPageWithHttpInfo($phone_number_id, $from_phone_number, $page_size, $page_num); + list($response) = $this->fetchInboundSMSByPageWithHttpInfo($phone_number_id, $from_phone_number, $page_size, $page_num, $contentType); return $response; } @@ -4534,16 +5654,17 @@ public function fetchInboundSMSByPage($phone_number_id, $from_phone_number = nul * * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInboundSMSByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2002|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchInboundSMSByPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchInboundSMSByPageWithHttpInfo($phone_number_id, $from_phone_number = null, $page_size = null, $page_num = null) + public function fetchInboundSMSByPageWithHttpInfo($phone_number_id, $from_phone_number = null, $page_size = null, $page_num = null, string $contentType = self::contentTypes['fetchInboundSMSByPage'][0]) { - $request = $this->fetchInboundSMSByPageRequest($phone_number_id, $from_phone_number, $page_size, $page_num); + $request = $this->fetchInboundSMSByPageRequest($phone_number_id, $from_phone_number, $page_size, $page_num, $contentType); try { $options = $this->createHttpClientOption(); @@ -4582,14 +5703,29 @@ public function fetchInboundSMSByPageWithHttpInfo($phone_number_id, $from_phone_ switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2002' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchInboundSMSByPage200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchInboundSMSByPage200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2002', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchInboundSMSByPage200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4598,6 +5734,21 @@ public function fetchInboundSMSByPageWithHttpInfo($phone_number_id, $from_phone_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4610,6 +5761,21 @@ public function fetchInboundSMSByPageWithHttpInfo($phone_number_id, $from_phone_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4622,6 +5788,21 @@ public function fetchInboundSMSByPageWithHttpInfo($phone_number_id, $from_phone_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4631,11 +5812,26 @@ public function fetchInboundSMSByPageWithHttpInfo($phone_number_id, $from_phone_ ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2002'; + $returnType = '\OpenAPI\Client\Model\FetchInboundSMSByPage200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4649,7 +5845,7 @@ public function fetchInboundSMSByPageWithHttpInfo($phone_number_id, $from_phone_ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2002', + '\OpenAPI\Client\Model\FetchInboundSMSByPage200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4690,15 +5886,16 @@ public function fetchInboundSMSByPageWithHttpInfo($phone_number_id, $from_phone_ * * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInboundSMSByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInboundSMSByPageAsync($phone_number_id, $from_phone_number = null, $page_size = null, $page_num = null) + public function fetchInboundSMSByPageAsync($phone_number_id, $from_phone_number = null, $page_size = null, $page_num = null, string $contentType = self::contentTypes['fetchInboundSMSByPage'][0]) { - return $this->fetchInboundSMSByPageAsyncWithHttpInfo($phone_number_id, $from_phone_number, $page_size, $page_num) + return $this->fetchInboundSMSByPageAsyncWithHttpInfo($phone_number_id, $from_phone_number, $page_size, $page_num, $contentType) ->then( function ($response) { return $response[0]; @@ -4713,16 +5910,17 @@ function ($response) { * * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInboundSMSByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchInboundSMSByPageAsyncWithHttpInfo($phone_number_id, $from_phone_number = null, $page_size = null, $page_num = null) + public function fetchInboundSMSByPageAsyncWithHttpInfo($phone_number_id, $from_phone_number = null, $page_size = null, $page_num = null, string $contentType = self::contentTypes['fetchInboundSMSByPage'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2002'; - $request = $this->fetchInboundSMSByPageRequest($phone_number_id, $from_phone_number, $page_size, $page_num); + $returnType = '\OpenAPI\Client\Model\FetchInboundSMSByPage200Response'; + $request = $this->fetchInboundSMSByPageRequest($phone_number_id, $from_phone_number, $page_size, $page_num, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4732,6 +5930,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4762,14 +5963,16 @@ function ($exception) { * * @param mixed $phone_number_id (required) * @param string $from_phone_number (optional) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchInboundSMSByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchInboundSMSByPageRequest($phone_number_id, $from_phone_number = null, $page_size = null, $page_num = null) + public function fetchInboundSMSByPageRequest($phone_number_id, $from_phone_number = null, $page_size = null, $page_num = null, string $contentType = self::contentTypes['fetchInboundSMSByPage'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -4777,6 +5980,10 @@ public function fetchInboundSMSByPageRequest($phone_number_id, $from_phone_numbe ); } + + + + $resourcePath = '/v2/merchant/sms/inbound/page/{phoneNumberID}'; $formParams = []; $queryParams = []; @@ -4785,38 +5992,32 @@ public function fetchInboundSMSByPageRequest($phone_number_id, $from_phone_numbe $multipart = false; // query params - if ($from_phone_number !== null) { - if('form' === 'form' && is_array($from_phone_number)) { - foreach($from_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['fromPhoneNumber'] = $from_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_phone_number, + 'fromPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_size !== null) { - if('form' === 'form' && is_array($page_size)) { - foreach($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageSize'] = $page_size; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_num !== null) { - if('form' === 'form' && is_array($page_num)) { - foreach($page_num as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageNum'] = $page_num; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_num, + 'pageNum', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -4829,16 +6030,11 @@ public function fetchInboundSMSByPageRequest($phone_number_id, $from_phone_numbe } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4856,12 +6052,12 @@ public function fetchInboundSMSByPageRequest($phone_number_id, $from_phone_numbe // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4877,10 +6073,11 @@ public function fetchInboundSMSByPageRequest($phone_number_id, $from_phone_numbe $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4893,14 +6090,15 @@ public function fetchInboundSMSByPageRequest($phone_number_id, $from_phone_numbe * * @param mixed $phone_number_id phone_number_id (required) * @param string $to_phone_number to_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantOutboundSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OutboundSMS[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMerchantOutboundSMS($phone_number_id, $to_phone_number) + public function fetchMerchantOutboundSMS($phone_number_id, $to_phone_number, string $contentType = self::contentTypes['fetchMerchantOutboundSMS'][0]) { - list($response) = $this->fetchMerchantOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number); + list($response) = $this->fetchMerchantOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number, $contentType); return $response; } @@ -4911,14 +6109,15 @@ public function fetchMerchantOutboundSMS($phone_number_id, $to_phone_number) * * @param mixed $phone_number_id (required) * @param string $to_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantOutboundSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OutboundSMS[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMerchantOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number) + public function fetchMerchantOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number, string $contentType = self::contentTypes['fetchMerchantOutboundSMS'][0]) { - $request = $this->fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_number); + $request = $this->fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_number, $contentType); try { $options = $this->createHttpClientOption(); @@ -4961,6 +6160,21 @@ public function fetchMerchantOutboundSMSWithHttpInfo($phone_number_id, $to_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OutboundSMS[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4973,6 +6187,21 @@ public function fetchMerchantOutboundSMSWithHttpInfo($phone_number_id, $to_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4985,6 +6214,21 @@ public function fetchMerchantOutboundSMSWithHttpInfo($phone_number_id, $to_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4997,6 +6241,21 @@ public function fetchMerchantOutboundSMSWithHttpInfo($phone_number_id, $to_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5011,6 +6270,21 @@ public function fetchMerchantOutboundSMSWithHttpInfo($phone_number_id, $to_phone $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5065,13 +6339,14 @@ public function fetchMerchantOutboundSMSWithHttpInfo($phone_number_id, $to_phone * * @param mixed $phone_number_id (required) * @param string $to_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantOutboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantOutboundSMSAsync($phone_number_id, $to_phone_number) + public function fetchMerchantOutboundSMSAsync($phone_number_id, $to_phone_number, string $contentType = self::contentTypes['fetchMerchantOutboundSMS'][0]) { - return $this->fetchMerchantOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number) + return $this->fetchMerchantOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number, $contentType) ->then( function ($response) { return $response[0]; @@ -5086,14 +6361,15 @@ function ($response) { * * @param mixed $phone_number_id (required) * @param string $to_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantOutboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number) + public function fetchMerchantOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number, string $contentType = self::contentTypes['fetchMerchantOutboundSMS'][0]) { $returnType = '\OpenAPI\Client\Model\OutboundSMS[]'; - $request = $this->fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_number); + $request = $this->fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_number, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5103,6 +6379,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5133,18 +6412,21 @@ function ($exception) { * * @param mixed $phone_number_id (required) * @param string $to_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantOutboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_number) + public function fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_number, string $contentType = self::contentTypes['fetchMerchantOutboundSMS'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $phone_number_id when calling fetchMerchantOutboundSMS' ); } + // verify the required parameter 'to_phone_number' is set if ($to_phone_number === null || (is_array($to_phone_number) && count($to_phone_number) === 0)) { throw new \InvalidArgumentException( @@ -5152,6 +6434,7 @@ public function fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_numb ); } + $resourcePath = '/v2/merchant/sms/outbound/{phoneNumberID}'; $formParams = []; $queryParams = []; @@ -5160,16 +6443,14 @@ public function fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_numb $multipart = false; // query params - if ($to_phone_number !== null) { - if('form' === 'form' && is_array($to_phone_number)) { - foreach($to_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['toPhoneNumber'] = $to_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_phone_number, + 'toPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // path params @@ -5182,16 +6463,11 @@ public function fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_numb } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5209,12 +6485,12 @@ public function fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_numb // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5230,10 +6506,11 @@ public function fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_numb $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5246,14 +6523,15 @@ public function fetchMerchantOutboundSMSRequest($phone_number_id, $to_phone_numb * * @param bool $is_archive_included is_archive_included (optional) * @param bool $is_approved is_approved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantPhoneNumbers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMerchantPhoneNumbers($is_archive_included = null, $is_approved = null) + public function fetchMerchantPhoneNumbers($is_archive_included = null, $is_approved = null, string $contentType = self::contentTypes['fetchMerchantPhoneNumbers'][0]) { - list($response) = $this->fetchMerchantPhoneNumbersWithHttpInfo($is_archive_included, $is_approved); + list($response) = $this->fetchMerchantPhoneNumbersWithHttpInfo($is_archive_included, $is_approved, $contentType); return $response; } @@ -5264,14 +6542,15 @@ public function fetchMerchantPhoneNumbers($is_archive_included = null, $is_appro * * @param bool $is_archive_included (optional) * @param bool $is_approved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantPhoneNumbers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMerchantPhoneNumbersWithHttpInfo($is_archive_included = null, $is_approved = null) + public function fetchMerchantPhoneNumbersWithHttpInfo($is_archive_included = null, $is_approved = null, string $contentType = self::contentTypes['fetchMerchantPhoneNumbers'][0]) { - $request = $this->fetchMerchantPhoneNumbersRequest($is_archive_included, $is_approved); + $request = $this->fetchMerchantPhoneNumbersRequest($is_archive_included, $is_approved, $contentType); try { $options = $this->createHttpClientOption(); @@ -5314,6 +6593,21 @@ public function fetchMerchantPhoneNumbersWithHttpInfo($is_archive_included = nul $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5326,6 +6620,21 @@ public function fetchMerchantPhoneNumbersWithHttpInfo($is_archive_included = nul $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5338,6 +6647,21 @@ public function fetchMerchantPhoneNumbersWithHttpInfo($is_archive_included = nul $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5350,6 +6674,21 @@ public function fetchMerchantPhoneNumbersWithHttpInfo($is_archive_included = nul $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5364,6 +6703,21 @@ public function fetchMerchantPhoneNumbersWithHttpInfo($is_archive_included = nul $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5418,13 +6772,14 @@ public function fetchMerchantPhoneNumbersWithHttpInfo($is_archive_included = nul * * @param bool $is_archive_included (optional) * @param bool $is_approved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantPhoneNumbers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantPhoneNumbersAsync($is_archive_included = null, $is_approved = null) + public function fetchMerchantPhoneNumbersAsync($is_archive_included = null, $is_approved = null, string $contentType = self::contentTypes['fetchMerchantPhoneNumbers'][0]) { - return $this->fetchMerchantPhoneNumbersAsyncWithHttpInfo($is_archive_included, $is_approved) + return $this->fetchMerchantPhoneNumbersAsyncWithHttpInfo($is_archive_included, $is_approved, $contentType) ->then( function ($response) { return $response[0]; @@ -5439,14 +6794,15 @@ function ($response) { * * @param bool $is_archive_included (optional) * @param bool $is_approved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantPhoneNumbers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantPhoneNumbersAsyncWithHttpInfo($is_archive_included = null, $is_approved = null) + public function fetchMerchantPhoneNumbersAsyncWithHttpInfo($is_archive_included = null, $is_approved = null, string $contentType = self::contentTypes['fetchMerchantPhoneNumbers'][0]) { $returnType = 'mixed'; - $request = $this->fetchMerchantPhoneNumbersRequest($is_archive_included, $is_approved); + $request = $this->fetchMerchantPhoneNumbersRequest($is_archive_included, $is_approved, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5456,6 +6812,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5486,13 +6845,17 @@ function ($exception) { * * @param bool $is_archive_included (optional) * @param bool $is_approved (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantPhoneNumbers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMerchantPhoneNumbersRequest($is_archive_included = null, $is_approved = null) + public function fetchMerchantPhoneNumbersRequest($is_archive_included = null, $is_approved = null, string $contentType = self::contentTypes['fetchMerchantPhoneNumbers'][0]) { + + + $resourcePath = '/v2/merchant/phoneNumbers/all'; $formParams = []; $queryParams = []; @@ -5501,41 +6864,32 @@ public function fetchMerchantPhoneNumbersRequest($is_archive_included = null, $i $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_approved !== null) { - if('form' === 'form' && is_array($is_approved)) { - foreach($is_approved as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isApproved'] = $is_approved; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_approved, + 'isApproved', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5553,12 +6907,12 @@ public function fetchMerchantPhoneNumbersRequest($is_archive_included = null, $i // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5574,10 +6928,11 @@ public function fetchMerchantPhoneNumbersRequest($is_archive_included = null, $i $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5589,14 +6944,15 @@ public function fetchMerchantPhoneNumbersRequest($is_archive_included = null, $i * Fetch opt in list * * @param mixed $list_id list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OptInList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOptInList($list_id) + public function fetchOptInList($list_id, string $contentType = self::contentTypes['fetchOptInList'][0]) { - list($response) = $this->fetchOptInListWithHttpInfo($list_id); + list($response) = $this->fetchOptInListWithHttpInfo($list_id, $contentType); return $response; } @@ -5606,14 +6962,15 @@ public function fetchOptInList($list_id) * Fetch opt in list * * @param mixed $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OptInList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOptInListWithHttpInfo($list_id) + public function fetchOptInListWithHttpInfo($list_id, string $contentType = self::contentTypes['fetchOptInList'][0]) { - $request = $this->fetchOptInListRequest($list_id); + $request = $this->fetchOptInListRequest($list_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -5656,6 +7013,21 @@ public function fetchOptInListWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptInList' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5668,6 +7040,21 @@ public function fetchOptInListWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5680,6 +7067,21 @@ public function fetchOptInListWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5692,6 +7094,21 @@ public function fetchOptInListWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5706,6 +7123,21 @@ public function fetchOptInListWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5759,13 +7191,14 @@ public function fetchOptInListWithHttpInfo($list_id) * Fetch opt in list * * @param mixed $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListAsync($list_id) + public function fetchOptInListAsync($list_id, string $contentType = self::contentTypes['fetchOptInList'][0]) { - return $this->fetchOptInListAsyncWithHttpInfo($list_id) + return $this->fetchOptInListAsyncWithHttpInfo($list_id, $contentType) ->then( function ($response) { return $response[0]; @@ -5779,14 +7212,15 @@ function ($response) { * Fetch opt in list * * @param mixed $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListAsyncWithHttpInfo($list_id) + public function fetchOptInListAsyncWithHttpInfo($list_id, string $contentType = self::contentTypes['fetchOptInList'][0]) { $returnType = '\OpenAPI\Client\Model\OptInList'; - $request = $this->fetchOptInListRequest($list_id); + $request = $this->fetchOptInListRequest($list_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5796,6 +7230,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5825,12 +7262,14 @@ function ($exception) { * Create request for operation 'fetchOptInList' * * @param mixed $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOptInListRequest($list_id) + public function fetchOptInListRequest($list_id, string $contentType = self::contentTypes['fetchOptInList'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -5838,6 +7277,7 @@ public function fetchOptInListRequest($list_id) ); } + $resourcePath = '/v2/merchant/lists/optIn/{listID}'; $formParams = []; $queryParams = []; @@ -5857,16 +7297,11 @@ public function fetchOptInListRequest($list_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5884,12 +7319,12 @@ public function fetchOptInListRequest($list_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5905,10 +7340,11 @@ public function fetchOptInListRequest($list_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5920,14 +7356,15 @@ public function fetchOptInListRequest($list_id) * Fetch all opt in lists * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInLists'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOptInLists($is_archive_included = null) + public function fetchOptInLists($is_archive_included = null, string $contentType = self::contentTypes['fetchOptInLists'][0]) { - list($response) = $this->fetchOptInListsWithHttpInfo($is_archive_included); + list($response) = $this->fetchOptInListsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -5937,14 +7374,15 @@ public function fetchOptInLists($is_archive_included = null) * Fetch all opt in lists * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInLists'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOptInListsWithHttpInfo($is_archive_included = null) + public function fetchOptInListsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchOptInLists'][0]) { - $request = $this->fetchOptInListsRequest($is_archive_included); + $request = $this->fetchOptInListsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -5987,6 +7425,21 @@ public function fetchOptInListsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5999,6 +7452,21 @@ public function fetchOptInListsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6011,6 +7479,21 @@ public function fetchOptInListsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6023,6 +7506,21 @@ public function fetchOptInListsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6037,6 +7535,21 @@ public function fetchOptInListsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6090,13 +7603,14 @@ public function fetchOptInListsWithHttpInfo($is_archive_included = null) * Fetch all opt in lists * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInLists'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListsAsync($is_archive_included = null) + public function fetchOptInListsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchOptInLists'][0]) { - return $this->fetchOptInListsAsyncWithHttpInfo($is_archive_included) + return $this->fetchOptInListsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -6110,14 +7624,15 @@ function ($response) { * Fetch all opt in lists * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInLists'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListsAsyncWithHttpInfo($is_archive_included = null) + public function fetchOptInListsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchOptInLists'][0]) { $returnType = 'mixed'; - $request = $this->fetchOptInListsRequest($is_archive_included); + $request = $this->fetchOptInListsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6127,6 +7642,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6156,13 +7674,16 @@ function ($exception) { * Create request for operation 'fetchOptInLists' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInLists'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOptInListsRequest($is_archive_included = null) + public function fetchOptInListsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchOptInLists'][0]) { + + $resourcePath = '/v2/merchant/lists/optIn/all'; $formParams = []; $queryParams = []; @@ -6171,30 +7692,23 @@ public function fetchOptInListsRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6212,12 +7726,12 @@ public function fetchOptInListsRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6233,10 +7747,11 @@ public function fetchOptInListsRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6248,14 +7763,15 @@ public function fetchOptInListsRequest($is_archive_included = null) * Fetch phone number * * @param mixed $phone_number_id phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PhoneNumber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchPhoneNumber($phone_number_id) + public function fetchPhoneNumber($phone_number_id, string $contentType = self::contentTypes['fetchPhoneNumber'][0]) { - list($response) = $this->fetchPhoneNumberWithHttpInfo($phone_number_id); + list($response) = $this->fetchPhoneNumberWithHttpInfo($phone_number_id, $contentType); return $response; } @@ -6265,14 +7781,15 @@ public function fetchPhoneNumber($phone_number_id) * Fetch phone number * * @param mixed $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PhoneNumber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchPhoneNumberWithHttpInfo($phone_number_id) + public function fetchPhoneNumberWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['fetchPhoneNumber'][0]) { - $request = $this->fetchPhoneNumberRequest($phone_number_id); + $request = $this->fetchPhoneNumberRequest($phone_number_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -6315,6 +7832,21 @@ public function fetchPhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PhoneNumber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6327,6 +7859,21 @@ public function fetchPhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6339,6 +7886,21 @@ public function fetchPhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6351,6 +7913,21 @@ public function fetchPhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6365,6 +7942,21 @@ public function fetchPhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6418,13 +8010,14 @@ public function fetchPhoneNumberWithHttpInfo($phone_number_id) * Fetch phone number * * @param mixed $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPhoneNumberAsync($phone_number_id) + public function fetchPhoneNumberAsync($phone_number_id, string $contentType = self::contentTypes['fetchPhoneNumber'][0]) { - return $this->fetchPhoneNumberAsyncWithHttpInfo($phone_number_id) + return $this->fetchPhoneNumberAsyncWithHttpInfo($phone_number_id, $contentType) ->then( function ($response) { return $response[0]; @@ -6438,14 +8031,15 @@ function ($response) { * Fetch phone number * * @param mixed $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPhoneNumberAsyncWithHttpInfo($phone_number_id) + public function fetchPhoneNumberAsyncWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['fetchPhoneNumber'][0]) { $returnType = '\OpenAPI\Client\Model\PhoneNumber'; - $request = $this->fetchPhoneNumberRequest($phone_number_id); + $request = $this->fetchPhoneNumberRequest($phone_number_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6455,6 +8049,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6484,12 +8081,14 @@ function ($exception) { * Create request for operation 'fetchPhoneNumber' * * @param mixed $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchPhoneNumberRequest($phone_number_id) + public function fetchPhoneNumberRequest($phone_number_id, string $contentType = self::contentTypes['fetchPhoneNumber'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -6497,6 +8096,7 @@ public function fetchPhoneNumberRequest($phone_number_id) ); } + $resourcePath = '/v2/merchant/phoneNumber/{phoneNumberID}'; $formParams = []; $queryParams = []; @@ -6516,16 +8116,11 @@ public function fetchPhoneNumberRequest($phone_number_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6543,12 +8138,12 @@ public function fetchPhoneNumberRequest($phone_number_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6564,10 +8159,11 @@ public function fetchPhoneNumberRequest($phone_number_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6578,14 +8174,15 @@ public function fetchPhoneNumberRequest($phone_number_id) * * Fetch public representative employees of the merchant * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPublicEmployees'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchPublicEmployees() + public function fetchPublicEmployees(string $contentType = self::contentTypes['fetchPublicEmployees'][0]) { - list($response) = $this->fetchPublicEmployeesWithHttpInfo(); + list($response) = $this->fetchPublicEmployeesWithHttpInfo($contentType); return $response; } @@ -6594,14 +8191,15 @@ public function fetchPublicEmployees() * * Fetch public representative employees of the merchant * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPublicEmployees'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchPublicEmployeesWithHttpInfo() + public function fetchPublicEmployeesWithHttpInfo(string $contentType = self::contentTypes['fetchPublicEmployees'][0]) { - $request = $this->fetchPublicEmployeesRequest(); + $request = $this->fetchPublicEmployeesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -6644,6 +8242,21 @@ public function fetchPublicEmployeesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6656,6 +8269,21 @@ public function fetchPublicEmployeesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6668,6 +8296,21 @@ public function fetchPublicEmployeesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6680,6 +8323,21 @@ public function fetchPublicEmployeesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6694,6 +8352,21 @@ public function fetchPublicEmployeesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6746,13 +8419,14 @@ public function fetchPublicEmployeesWithHttpInfo() * * Fetch public representative employees of the merchant * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPublicEmployees'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPublicEmployeesAsync() + public function fetchPublicEmployeesAsync(string $contentType = self::contentTypes['fetchPublicEmployees'][0]) { - return $this->fetchPublicEmployeesAsyncWithHttpInfo() + return $this->fetchPublicEmployeesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -6765,14 +8439,15 @@ function ($response) { * * Fetch public representative employees of the merchant * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPublicEmployees'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPublicEmployeesAsyncWithHttpInfo() + public function fetchPublicEmployeesAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchPublicEmployees'][0]) { $returnType = 'mixed'; - $request = $this->fetchPublicEmployeesRequest(); + $request = $this->fetchPublicEmployeesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6782,6 +8457,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6810,13 +8488,15 @@ function ($exception) { /** * Create request for operation 'fetchPublicEmployees' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPublicEmployees'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchPublicEmployeesRequest() + public function fetchPublicEmployeesRequest(string $contentType = self::contentTypes['fetchPublicEmployees'][0]) { + $resourcePath = '/v2/merchant/employees/public'; $formParams = []; $queryParams = []; @@ -6828,16 +8508,11 @@ public function fetchPublicEmployeesRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6855,12 +8530,12 @@ public function fetchPublicEmployeesRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6876,10 +8551,11 @@ public function fetchPublicEmployeesRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6891,14 +8567,15 @@ public function fetchPublicEmployeesRequest() * Fetch all simple SMS broadcasts * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSimpleSMSBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\SimpleSMSBroadcast[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchSimpleSMSBroadcasts($is_archive_included = null) + public function fetchSimpleSMSBroadcasts($is_archive_included = null, string $contentType = self::contentTypes['fetchSimpleSMSBroadcasts'][0]) { - list($response) = $this->fetchSimpleSMSBroadcastsWithHttpInfo($is_archive_included); + list($response) = $this->fetchSimpleSMSBroadcastsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -6908,14 +8585,15 @@ public function fetchSimpleSMSBroadcasts($is_archive_included = null) * Fetch all simple SMS broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSimpleSMSBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\SimpleSMSBroadcast[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchSimpleSMSBroadcastsWithHttpInfo($is_archive_included = null) + public function fetchSimpleSMSBroadcastsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchSimpleSMSBroadcasts'][0]) { - $request = $this->fetchSimpleSMSBroadcastsRequest($is_archive_included); + $request = $this->fetchSimpleSMSBroadcastsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -6958,6 +8636,21 @@ public function fetchSimpleSMSBroadcastsWithHttpInfo($is_archive_included = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\SimpleSMSBroadcast[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6970,6 +8663,21 @@ public function fetchSimpleSMSBroadcastsWithHttpInfo($is_archive_included = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6982,6 +8690,21 @@ public function fetchSimpleSMSBroadcastsWithHttpInfo($is_archive_included = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6994,6 +8717,21 @@ public function fetchSimpleSMSBroadcastsWithHttpInfo($is_archive_included = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7008,6 +8746,21 @@ public function fetchSimpleSMSBroadcastsWithHttpInfo($is_archive_included = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7061,13 +8814,14 @@ public function fetchSimpleSMSBroadcastsWithHttpInfo($is_archive_included = null * Fetch all simple SMS broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSimpleSMSBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchSimpleSMSBroadcastsAsync($is_archive_included = null) + public function fetchSimpleSMSBroadcastsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchSimpleSMSBroadcasts'][0]) { - return $this->fetchSimpleSMSBroadcastsAsyncWithHttpInfo($is_archive_included) + return $this->fetchSimpleSMSBroadcastsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -7081,14 +8835,15 @@ function ($response) { * Fetch all simple SMS broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSimpleSMSBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchSimpleSMSBroadcastsAsyncWithHttpInfo($is_archive_included = null) + public function fetchSimpleSMSBroadcastsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchSimpleSMSBroadcasts'][0]) { $returnType = '\OpenAPI\Client\Model\SimpleSMSBroadcast[]'; - $request = $this->fetchSimpleSMSBroadcastsRequest($is_archive_included); + $request = $this->fetchSimpleSMSBroadcastsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7098,6 +8853,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7127,13 +8885,16 @@ function ($exception) { * Create request for operation 'fetchSimpleSMSBroadcasts' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSimpleSMSBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchSimpleSMSBroadcastsRequest($is_archive_included = null) + public function fetchSimpleSMSBroadcastsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchSimpleSMSBroadcasts'][0]) { + + $resourcePath = '/v2/merchant/broadcasts/simpleSMS/all'; $formParams = []; $queryParams = []; @@ -7142,30 +8903,23 @@ public function fetchSimpleSMSBroadcastsRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -7183,12 +8937,12 @@ public function fetchSimpleSMSBroadcastsRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7204,10 +8958,11 @@ public function fetchSimpleSMSBroadcastsRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7219,14 +8974,15 @@ public function fetchSimpleSMSBroadcastsRequest($is_archive_included = null) * Fetch all static voucher campaign broadcasts * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucherCampaignBroadcast[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchStaticVoucherCampaignBroadcasts($is_archive_included = null) + public function fetchStaticVoucherCampaignBroadcasts($is_archive_included = null, string $contentType = self::contentTypes['fetchStaticVoucherCampaignBroadcasts'][0]) { - list($response) = $this->fetchStaticVoucherCampaignBroadcastsWithHttpInfo($is_archive_included); + list($response) = $this->fetchStaticVoucherCampaignBroadcastsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -7236,14 +8992,15 @@ public function fetchStaticVoucherCampaignBroadcasts($is_archive_included = null * Fetch all static voucher campaign broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucherCampaignBroadcast[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchStaticVoucherCampaignBroadcastsWithHttpInfo($is_archive_included = null) + public function fetchStaticVoucherCampaignBroadcastsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchStaticVoucherCampaignBroadcasts'][0]) { - $request = $this->fetchStaticVoucherCampaignBroadcastsRequest($is_archive_included); + $request = $this->fetchStaticVoucherCampaignBroadcastsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -7286,6 +9043,21 @@ public function fetchStaticVoucherCampaignBroadcastsWithHttpInfo($is_archive_inc $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucherCampaignBroadcast[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7298,6 +9070,21 @@ public function fetchStaticVoucherCampaignBroadcastsWithHttpInfo($is_archive_inc $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7310,6 +9097,21 @@ public function fetchStaticVoucherCampaignBroadcastsWithHttpInfo($is_archive_inc $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7322,6 +9124,21 @@ public function fetchStaticVoucherCampaignBroadcastsWithHttpInfo($is_archive_inc $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7336,6 +9153,21 @@ public function fetchStaticVoucherCampaignBroadcastsWithHttpInfo($is_archive_inc $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7389,13 +9221,14 @@ public function fetchStaticVoucherCampaignBroadcastsWithHttpInfo($is_archive_inc * Fetch all static voucher campaign broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherCampaignBroadcastsAsync($is_archive_included = null) + public function fetchStaticVoucherCampaignBroadcastsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchStaticVoucherCampaignBroadcasts'][0]) { - return $this->fetchStaticVoucherCampaignBroadcastsAsyncWithHttpInfo($is_archive_included) + return $this->fetchStaticVoucherCampaignBroadcastsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -7409,14 +9242,15 @@ function ($response) { * Fetch all static voucher campaign broadcasts * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherCampaignBroadcastsAsyncWithHttpInfo($is_archive_included = null) + public function fetchStaticVoucherCampaignBroadcastsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchStaticVoucherCampaignBroadcasts'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucherCampaignBroadcast[]'; - $request = $this->fetchStaticVoucherCampaignBroadcastsRequest($is_archive_included); + $request = $this->fetchStaticVoucherCampaignBroadcastsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7426,6 +9260,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7455,13 +9292,16 @@ function ($exception) { * Create request for operation 'fetchStaticVoucherCampaignBroadcasts' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchStaticVoucherCampaignBroadcastsRequest($is_archive_included = null) + public function fetchStaticVoucherCampaignBroadcastsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchStaticVoucherCampaignBroadcasts'][0]) { + + $resourcePath = '/v2/merchant/broadcasts/staticVoucherCampaign/all'; $formParams = []; $queryParams = []; @@ -7470,30 +9310,23 @@ public function fetchStaticVoucherCampaignBroadcastsRequest($is_archive_included $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -7511,12 +9344,12 @@ public function fetchStaticVoucherCampaignBroadcastsRequest($is_archive_included // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7532,10 +9365,11 @@ public function fetchStaticVoucherCampaignBroadcastsRequest($is_archive_included $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7546,14 +9380,15 @@ public function fetchStaticVoucherCampaignBroadcastsRequest($is_archive_included * * Fetch all TCPA Filters * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchTCPAFilter'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Tcpa[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchTCPAFilter() + public function fetchTCPAFilter(string $contentType = self::contentTypes['fetchTCPAFilter'][0]) { - list($response) = $this->fetchTCPAFilterWithHttpInfo(); + list($response) = $this->fetchTCPAFilterWithHttpInfo($contentType); return $response; } @@ -7562,14 +9397,15 @@ public function fetchTCPAFilter() * * Fetch all TCPA Filters * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchTCPAFilter'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Tcpa[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchTCPAFilterWithHttpInfo() + public function fetchTCPAFilterWithHttpInfo(string $contentType = self::contentTypes['fetchTCPAFilter'][0]) { - $request = $this->fetchTCPAFilterRequest(); + $request = $this->fetchTCPAFilterRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -7612,6 +9448,21 @@ public function fetchTCPAFilterWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Tcpa[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7624,6 +9475,21 @@ public function fetchTCPAFilterWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7636,6 +9502,21 @@ public function fetchTCPAFilterWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7648,6 +9529,21 @@ public function fetchTCPAFilterWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7662,6 +9558,21 @@ public function fetchTCPAFilterWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7714,13 +9625,14 @@ public function fetchTCPAFilterWithHttpInfo() * * Fetch all TCPA Filters * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchTCPAFilter'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchTCPAFilterAsync() + public function fetchTCPAFilterAsync(string $contentType = self::contentTypes['fetchTCPAFilter'][0]) { - return $this->fetchTCPAFilterAsyncWithHttpInfo() + return $this->fetchTCPAFilterAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -7733,14 +9645,15 @@ function ($response) { * * Fetch all TCPA Filters * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchTCPAFilter'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchTCPAFilterAsyncWithHttpInfo() + public function fetchTCPAFilterAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchTCPAFilter'][0]) { $returnType = '\OpenAPI\Client\Model\Tcpa[]'; - $request = $this->fetchTCPAFilterRequest(); + $request = $this->fetchTCPAFilterRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7750,6 +9663,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7778,13 +9694,15 @@ function ($exception) { /** * Create request for operation 'fetchTCPAFilter' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchTCPAFilter'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchTCPAFilterRequest() + public function fetchTCPAFilterRequest(string $contentType = self::contentTypes['fetchTCPAFilter'][0]) { + $resourcePath = '/v2/merchant/tcpa/filter/all'; $formParams = []; $queryParams = []; @@ -7796,16 +9714,11 @@ public function fetchTCPAFilterRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -7823,12 +9736,12 @@ public function fetchTCPAFilterRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7844,10 +9757,11 @@ public function fetchTCPAFilterRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7858,14 +9772,15 @@ public function fetchTCPAFilterRequest() * * Fetch wallet configuration * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletConfiguration'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchWalletConfiguration() + public function fetchWalletConfiguration(string $contentType = self::contentTypes['fetchWalletConfiguration'][0]) { - list($response) = $this->fetchWalletConfigurationWithHttpInfo(); + list($response) = $this->fetchWalletConfigurationWithHttpInfo($contentType); return $response; } @@ -7874,14 +9789,15 @@ public function fetchWalletConfiguration() * * Fetch wallet configuration * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletConfiguration'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchWalletConfigurationWithHttpInfo() + public function fetchWalletConfigurationWithHttpInfo(string $contentType = self::contentTypes['fetchWalletConfiguration'][0]) { - $request = $this->fetchWalletConfigurationRequest(); + $request = $this->fetchWalletConfigurationRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -7924,6 +9840,21 @@ public function fetchWalletConfigurationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7936,6 +9867,21 @@ public function fetchWalletConfigurationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7948,6 +9894,21 @@ public function fetchWalletConfigurationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7960,6 +9921,21 @@ public function fetchWalletConfigurationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7974,6 +9950,21 @@ public function fetchWalletConfigurationWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8026,13 +10017,14 @@ public function fetchWalletConfigurationWithHttpInfo() * * Fetch wallet configuration * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletConfiguration'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletConfigurationAsync() + public function fetchWalletConfigurationAsync(string $contentType = self::contentTypes['fetchWalletConfiguration'][0]) { - return $this->fetchWalletConfigurationAsyncWithHttpInfo() + return $this->fetchWalletConfigurationAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -8045,14 +10037,15 @@ function ($response) { * * Fetch wallet configuration * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletConfiguration'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletConfigurationAsyncWithHttpInfo() + public function fetchWalletConfigurationAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchWalletConfiguration'][0]) { $returnType = 'mixed'; - $request = $this->fetchWalletConfigurationRequest(); + $request = $this->fetchWalletConfigurationRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8062,6 +10055,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8090,13 +10086,15 @@ function ($exception) { /** * Create request for operation 'fetchWalletConfiguration' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletConfiguration'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchWalletConfigurationRequest() + public function fetchWalletConfigurationRequest(string $contentType = self::contentTypes['fetchWalletConfiguration'][0]) { + $resourcePath = '/v2/merchant/wallet/configuration'; $formParams = []; $queryParams = []; @@ -8108,16 +10106,11 @@ public function fetchWalletConfigurationRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -8135,12 +10128,12 @@ public function fetchWalletConfigurationRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8156,10 +10149,11 @@ public function fetchWalletConfigurationRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8171,14 +10165,15 @@ public function fetchWalletConfigurationRequest() * Update merchant details * * @param \OpenAPI\Client\Model\WTMerchantUpdate $wt_merchant_update wt_merchant_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchant'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateMerchant($wt_merchant_update) + public function updateMerchant($wt_merchant_update, string $contentType = self::contentTypes['updateMerchant'][0]) { - list($response) = $this->updateMerchantWithHttpInfo($wt_merchant_update); + list($response) = $this->updateMerchantWithHttpInfo($wt_merchant_update, $contentType); return $response; } @@ -8188,14 +10183,15 @@ public function updateMerchant($wt_merchant_update) * Update merchant details * * @param \OpenAPI\Client\Model\WTMerchantUpdate $wt_merchant_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchant'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateMerchantWithHttpInfo($wt_merchant_update) + public function updateMerchantWithHttpInfo($wt_merchant_update, string $contentType = self::contentTypes['updateMerchant'][0]) { - $request = $this->updateMerchantRequest($wt_merchant_update); + $request = $this->updateMerchantRequest($wt_merchant_update, $contentType); try { $options = $this->createHttpClientOption(); @@ -8238,6 +10234,21 @@ public function updateMerchantWithHttpInfo($wt_merchant_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8250,6 +10261,21 @@ public function updateMerchantWithHttpInfo($wt_merchant_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8262,6 +10288,21 @@ public function updateMerchantWithHttpInfo($wt_merchant_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8274,6 +10315,21 @@ public function updateMerchantWithHttpInfo($wt_merchant_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8288,6 +10344,21 @@ public function updateMerchantWithHttpInfo($wt_merchant_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8341,13 +10412,14 @@ public function updateMerchantWithHttpInfo($wt_merchant_update) * Update merchant details * * @param \OpenAPI\Client\Model\WTMerchantUpdate $wt_merchant_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchant'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateMerchantAsync($wt_merchant_update) + public function updateMerchantAsync($wt_merchant_update, string $contentType = self::contentTypes['updateMerchant'][0]) { - return $this->updateMerchantAsyncWithHttpInfo($wt_merchant_update) + return $this->updateMerchantAsyncWithHttpInfo($wt_merchant_update, $contentType) ->then( function ($response) { return $response[0]; @@ -8361,14 +10433,15 @@ function ($response) { * Update merchant details * * @param \OpenAPI\Client\Model\WTMerchantUpdate $wt_merchant_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchant'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateMerchantAsyncWithHttpInfo($wt_merchant_update) + public function updateMerchantAsyncWithHttpInfo($wt_merchant_update, string $contentType = self::contentTypes['updateMerchant'][0]) { $returnType = 'mixed'; - $request = $this->updateMerchantRequest($wt_merchant_update); + $request = $this->updateMerchantRequest($wt_merchant_update, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8378,6 +10451,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8407,12 +10483,14 @@ function ($exception) { * Create request for operation 'updateMerchant' * * @param \OpenAPI\Client\Model\WTMerchantUpdate $wt_merchant_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchant'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateMerchantRequest($wt_merchant_update) + public function updateMerchantRequest($wt_merchant_update, string $contentType = self::contentTypes['updateMerchant'][0]) { + // verify the required parameter 'wt_merchant_update' is set if ($wt_merchant_update === null || (is_array($wt_merchant_update) && count($wt_merchant_update) === 0)) { throw new \InvalidArgumentException( @@ -8420,6 +10498,7 @@ public function updateMerchantRequest($wt_merchant_update) ); } + $resourcePath = '/v2/merchant'; $formParams = []; $queryParams = []; @@ -8431,21 +10510,17 @@ public function updateMerchantRequest($wt_merchant_update) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_merchant_update)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_merchant_update)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_merchant_update)); } else { $httpBody = $wt_merchant_update; } @@ -8464,12 +10539,12 @@ public function updateMerchantRequest($wt_merchant_update) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8485,10 +10560,11 @@ public function updateMerchantRequest($wt_merchant_update) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8500,14 +10576,15 @@ public function updateMerchantRequest($wt_merchant_update) * Update billing contact * * @param \OpenAPI\Client\Model\WTMerchantUpdatePointsOfContact $wt_merchant_update_points_of_contact wt_merchant_update_points_of_contact (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePointsOfContact'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updatePointsOfContact($wt_merchant_update_points_of_contact) + public function updatePointsOfContact($wt_merchant_update_points_of_contact, string $contentType = self::contentTypes['updatePointsOfContact'][0]) { - list($response) = $this->updatePointsOfContactWithHttpInfo($wt_merchant_update_points_of_contact); + list($response) = $this->updatePointsOfContactWithHttpInfo($wt_merchant_update_points_of_contact, $contentType); return $response; } @@ -8517,14 +10594,15 @@ public function updatePointsOfContact($wt_merchant_update_points_of_contact) * Update billing contact * * @param \OpenAPI\Client\Model\WTMerchantUpdatePointsOfContact $wt_merchant_update_points_of_contact (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePointsOfContact'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updatePointsOfContactWithHttpInfo($wt_merchant_update_points_of_contact) + public function updatePointsOfContactWithHttpInfo($wt_merchant_update_points_of_contact, string $contentType = self::contentTypes['updatePointsOfContact'][0]) { - $request = $this->updatePointsOfContactRequest($wt_merchant_update_points_of_contact); + $request = $this->updatePointsOfContactRequest($wt_merchant_update_points_of_contact, $contentType); try { $options = $this->createHttpClientOption(); @@ -8567,6 +10645,21 @@ public function updatePointsOfContactWithHttpInfo($wt_merchant_update_points_of_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8579,6 +10672,21 @@ public function updatePointsOfContactWithHttpInfo($wt_merchant_update_points_of_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8591,6 +10699,21 @@ public function updatePointsOfContactWithHttpInfo($wt_merchant_update_points_of_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8603,6 +10726,21 @@ public function updatePointsOfContactWithHttpInfo($wt_merchant_update_points_of_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8617,6 +10755,21 @@ public function updatePointsOfContactWithHttpInfo($wt_merchant_update_points_of_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8670,13 +10823,14 @@ public function updatePointsOfContactWithHttpInfo($wt_merchant_update_points_of_ * Update billing contact * * @param \OpenAPI\Client\Model\WTMerchantUpdatePointsOfContact $wt_merchant_update_points_of_contact (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePointsOfContact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePointsOfContactAsync($wt_merchant_update_points_of_contact) + public function updatePointsOfContactAsync($wt_merchant_update_points_of_contact, string $contentType = self::contentTypes['updatePointsOfContact'][0]) { - return $this->updatePointsOfContactAsyncWithHttpInfo($wt_merchant_update_points_of_contact) + return $this->updatePointsOfContactAsyncWithHttpInfo($wt_merchant_update_points_of_contact, $contentType) ->then( function ($response) { return $response[0]; @@ -8690,14 +10844,15 @@ function ($response) { * Update billing contact * * @param \OpenAPI\Client\Model\WTMerchantUpdatePointsOfContact $wt_merchant_update_points_of_contact (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePointsOfContact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePointsOfContactAsyncWithHttpInfo($wt_merchant_update_points_of_contact) + public function updatePointsOfContactAsyncWithHttpInfo($wt_merchant_update_points_of_contact, string $contentType = self::contentTypes['updatePointsOfContact'][0]) { $returnType = 'mixed'; - $request = $this->updatePointsOfContactRequest($wt_merchant_update_points_of_contact); + $request = $this->updatePointsOfContactRequest($wt_merchant_update_points_of_contact, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8707,6 +10862,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8736,12 +10894,14 @@ function ($exception) { * Create request for operation 'updatePointsOfContact' * * @param \OpenAPI\Client\Model\WTMerchantUpdatePointsOfContact $wt_merchant_update_points_of_contact (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePointsOfContact'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePointsOfContactRequest($wt_merchant_update_points_of_contact) + public function updatePointsOfContactRequest($wt_merchant_update_points_of_contact, string $contentType = self::contentTypes['updatePointsOfContact'][0]) { + // verify the required parameter 'wt_merchant_update_points_of_contact' is set if ($wt_merchant_update_points_of_contact === null || (is_array($wt_merchant_update_points_of_contact) && count($wt_merchant_update_points_of_contact) === 0)) { throw new \InvalidArgumentException( @@ -8749,6 +10909,7 @@ public function updatePointsOfContactRequest($wt_merchant_update_points_of_conta ); } + $resourcePath = '/v2/merchant/pointsOfContact'; $formParams = []; $queryParams = []; @@ -8760,21 +10921,17 @@ public function updatePointsOfContactRequest($wt_merchant_update_points_of_conta - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_merchant_update_points_of_contact)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_merchant_update_points_of_contact)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_merchant_update_points_of_contact)); } else { $httpBody = $wt_merchant_update_points_of_contact; } @@ -8793,12 +10950,12 @@ public function updatePointsOfContactRequest($wt_merchant_update_points_of_conta // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8814,10 +10971,11 @@ public function updatePointsOfContactRequest($wt_merchant_update_points_of_conta $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8829,14 +10987,15 @@ public function updatePointsOfContactRequest($wt_merchant_update_points_of_conta * Update POS Integration * * @param \OpenAPI\Client\Model\WTMerchantUpdatePOSIntegration $wt_merchant_update_pos_integration wt_merchant_update_pos_integration (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePosIntegration'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updatePosIntegration($wt_merchant_update_pos_integration) + public function updatePosIntegration($wt_merchant_update_pos_integration, string $contentType = self::contentTypes['updatePosIntegration'][0]) { - list($response) = $this->updatePosIntegrationWithHttpInfo($wt_merchant_update_pos_integration); + list($response) = $this->updatePosIntegrationWithHttpInfo($wt_merchant_update_pos_integration, $contentType); return $response; } @@ -8846,14 +11005,15 @@ public function updatePosIntegration($wt_merchant_update_pos_integration) * Update POS Integration * * @param \OpenAPI\Client\Model\WTMerchantUpdatePOSIntegration $wt_merchant_update_pos_integration (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePosIntegration'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updatePosIntegrationWithHttpInfo($wt_merchant_update_pos_integration) + public function updatePosIntegrationWithHttpInfo($wt_merchant_update_pos_integration, string $contentType = self::contentTypes['updatePosIntegration'][0]) { - $request = $this->updatePosIntegrationRequest($wt_merchant_update_pos_integration); + $request = $this->updatePosIntegrationRequest($wt_merchant_update_pos_integration, $contentType); try { $options = $this->createHttpClientOption(); @@ -8896,6 +11056,21 @@ public function updatePosIntegrationWithHttpInfo($wt_merchant_update_pos_integra $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8908,6 +11083,21 @@ public function updatePosIntegrationWithHttpInfo($wt_merchant_update_pos_integra $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8920,6 +11110,21 @@ public function updatePosIntegrationWithHttpInfo($wt_merchant_update_pos_integra $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8932,6 +11137,21 @@ public function updatePosIntegrationWithHttpInfo($wt_merchant_update_pos_integra $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8946,6 +11166,21 @@ public function updatePosIntegrationWithHttpInfo($wt_merchant_update_pos_integra $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8999,13 +11234,14 @@ public function updatePosIntegrationWithHttpInfo($wt_merchant_update_pos_integra * Update POS Integration * * @param \OpenAPI\Client\Model\WTMerchantUpdatePOSIntegration $wt_merchant_update_pos_integration (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePosIntegration'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePosIntegrationAsync($wt_merchant_update_pos_integration) + public function updatePosIntegrationAsync($wt_merchant_update_pos_integration, string $contentType = self::contentTypes['updatePosIntegration'][0]) { - return $this->updatePosIntegrationAsyncWithHttpInfo($wt_merchant_update_pos_integration) + return $this->updatePosIntegrationAsyncWithHttpInfo($wt_merchant_update_pos_integration, $contentType) ->then( function ($response) { return $response[0]; @@ -9019,14 +11255,15 @@ function ($response) { * Update POS Integration * * @param \OpenAPI\Client\Model\WTMerchantUpdatePOSIntegration $wt_merchant_update_pos_integration (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePosIntegration'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePosIntegrationAsyncWithHttpInfo($wt_merchant_update_pos_integration) + public function updatePosIntegrationAsyncWithHttpInfo($wt_merchant_update_pos_integration, string $contentType = self::contentTypes['updatePosIntegration'][0]) { $returnType = 'mixed'; - $request = $this->updatePosIntegrationRequest($wt_merchant_update_pos_integration); + $request = $this->updatePosIntegrationRequest($wt_merchant_update_pos_integration, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9036,6 +11273,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9065,12 +11305,14 @@ function ($exception) { * Create request for operation 'updatePosIntegration' * * @param \OpenAPI\Client\Model\WTMerchantUpdatePOSIntegration $wt_merchant_update_pos_integration (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePosIntegration'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePosIntegrationRequest($wt_merchant_update_pos_integration) + public function updatePosIntegrationRequest($wt_merchant_update_pos_integration, string $contentType = self::contentTypes['updatePosIntegration'][0]) { + // verify the required parameter 'wt_merchant_update_pos_integration' is set if ($wt_merchant_update_pos_integration === null || (is_array($wt_merchant_update_pos_integration) && count($wt_merchant_update_pos_integration) === 0)) { throw new \InvalidArgumentException( @@ -9078,6 +11320,7 @@ public function updatePosIntegrationRequest($wt_merchant_update_pos_integration) ); } + $resourcePath = '/v2/merchant/pos/integration'; $formParams = []; $queryParams = []; @@ -9089,21 +11332,17 @@ public function updatePosIntegrationRequest($wt_merchant_update_pos_integration) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_merchant_update_pos_integration)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_merchant_update_pos_integration)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_merchant_update_pos_integration)); } else { $httpBody = $wt_merchant_update_pos_integration; } @@ -9122,12 +11361,12 @@ public function updatePosIntegrationRequest($wt_merchant_update_pos_integration) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -9143,10 +11382,11 @@ public function updatePosIntegrationRequest($wt_merchant_update_pos_integration) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/MerchantCreditsApi.php b/lib/Api/MerchantCreditsApi.php index e5dbd35..e500d1a 100644 --- a/lib/Api/MerchantCreditsApi.php +++ b/lib/Api/MerchantCreditsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createMerchantCredit' => [ + 'application/json', + ], + 'fetchMerchantCreditById' => [ + 'application/json', + ], + 'fetchMerchantCreditCount' => [ + 'application/json', + ], + 'fetchMerchantCreditHistoryLog' => [ + 'application/json', + ], + 'fetchMerchantCreditRedemptionLog' => [ + 'application/json', + ], + 'fetchMerchantCreditsByPage' => [ + 'application/json', + ], + 'restoreMerchantCredit' => [ + 'application/json', + ], + 'searchMerchantCredits' => [ + 'application/json', + ], + 'updateMerchantCredit' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +156,15 @@ public function getConfig() * Archive merchant credit * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMerchantCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveMerchantCredit($id) + public function archiveMerchantCredit($id, string $contentType = self::contentTypes['archiveMerchantCredit'][0]) { - list($response) = $this->archiveMerchantCreditWithHttpInfo($id); + list($response) = $this->archiveMerchantCreditWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +174,15 @@ public function archiveMerchantCredit($id) * Archive merchant credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMerchantCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveMerchantCreditWithHttpInfo($id) + public function archiveMerchantCreditWithHttpInfo($id, string $contentType = self::contentTypes['archiveMerchantCredit'][0]) { - $request = $this->archiveMerchantCreditRequest($id); + $request = $this->archiveMerchantCreditRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +225,21 @@ public function archiveMerchantCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMerchantCredit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +252,21 @@ public function archiveMerchantCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +279,21 @@ public function archiveMerchantCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +306,21 @@ public function archiveMerchantCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +335,21 @@ public function archiveMerchantCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +403,14 @@ public function archiveMerchantCreditWithHttpInfo($id) * Archive merchant credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveMerchantCreditAsync($id) + public function archiveMerchantCreditAsync($id, string $contentType = self::contentTypes['archiveMerchantCredit'][0]) { - return $this->archiveMerchantCreditAsyncWithHttpInfo($id) + return $this->archiveMerchantCreditAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +424,15 @@ function ($response) { * Archive merchant credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveMerchantCreditAsyncWithHttpInfo($id) + public function archiveMerchantCreditAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveMerchantCredit'][0]) { $returnType = '\OpenAPI\Client\Model\WTMerchantCredit'; - $request = $this->archiveMerchantCreditRequest($id); + $request = $this->archiveMerchantCreditRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +442,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +474,14 @@ function ($exception) { * Create request for operation 'archiveMerchantCredit' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveMerchantCreditRequest($id) + public function archiveMerchantCreditRequest($id, string $contentType = self::contentTypes['archiveMerchantCredit'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +489,7 @@ public function archiveMerchantCreditRequest($id) ); } + $resourcePath = '/v2/payment/merchantcredit/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +509,11 @@ public function archiveMerchantCreditRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +531,12 @@ public function archiveMerchantCreditRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +552,11 @@ public function archiveMerchantCreditRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +568,15 @@ public function archiveMerchantCreditRequest($id) * Create merchant credit * * @param \OpenAPI\Client\Model\WTMerchantCreditCreationParams $wt_merchant_credit_creation_params wt_merchant_credit_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMerchantCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError */ - public function createMerchantCredit($wt_merchant_credit_creation_params) + public function createMerchantCredit($wt_merchant_credit_creation_params, string $contentType = self::contentTypes['createMerchantCredit'][0]) { - list($response) = $this->createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_params); + list($response) = $this->createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_params, $contentType); return $response; } @@ -470,14 +586,15 @@ public function createMerchantCredit($wt_merchant_credit_creation_params) * Create merchant credit * * @param \OpenAPI\Client\Model\WTMerchantCreditCreationParams $wt_merchant_credit_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMerchantCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_params) + public function createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_params, string $contentType = self::contentTypes['createMerchantCredit'][0]) { - $request = $this->createMerchantCreditRequest($wt_merchant_credit_creation_params); + $request = $this->createMerchantCreditRequest($wt_merchant_credit_creation_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +637,21 @@ public function createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMerchantCredit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +664,21 @@ public function createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +691,21 @@ public function createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +718,21 @@ public function createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -568,6 +745,21 @@ public function createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantNotInitialized' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -580,6 +772,21 @@ public function createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -594,6 +801,21 @@ public function createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_pa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -663,13 +885,14 @@ public function createMerchantCreditWithHttpInfo($wt_merchant_credit_creation_pa * Create merchant credit * * @param \OpenAPI\Client\Model\WTMerchantCreditCreationParams $wt_merchant_credit_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createMerchantCreditAsync($wt_merchant_credit_creation_params) + public function createMerchantCreditAsync($wt_merchant_credit_creation_params, string $contentType = self::contentTypes['createMerchantCredit'][0]) { - return $this->createMerchantCreditAsyncWithHttpInfo($wt_merchant_credit_creation_params) + return $this->createMerchantCreditAsyncWithHttpInfo($wt_merchant_credit_creation_params, $contentType) ->then( function ($response) { return $response[0]; @@ -683,14 +906,15 @@ function ($response) { * Create merchant credit * * @param \OpenAPI\Client\Model\WTMerchantCreditCreationParams $wt_merchant_credit_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createMerchantCreditAsyncWithHttpInfo($wt_merchant_credit_creation_params) + public function createMerchantCreditAsyncWithHttpInfo($wt_merchant_credit_creation_params, string $contentType = self::contentTypes['createMerchantCredit'][0]) { $returnType = '\OpenAPI\Client\Model\WTMerchantCredit'; - $request = $this->createMerchantCreditRequest($wt_merchant_credit_creation_params); + $request = $this->createMerchantCreditRequest($wt_merchant_credit_creation_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -700,6 +924,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -729,12 +956,14 @@ function ($exception) { * Create request for operation 'createMerchantCredit' * * @param \OpenAPI\Client\Model\WTMerchantCreditCreationParams $wt_merchant_credit_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createMerchantCreditRequest($wt_merchant_credit_creation_params) + public function createMerchantCreditRequest($wt_merchant_credit_creation_params, string $contentType = self::contentTypes['createMerchantCredit'][0]) { + // verify the required parameter 'wt_merchant_credit_creation_params' is set if ($wt_merchant_credit_creation_params === null || (is_array($wt_merchant_credit_creation_params) && count($wt_merchant_credit_creation_params) === 0)) { throw new \InvalidArgumentException( @@ -742,6 +971,7 @@ public function createMerchantCreditRequest($wt_merchant_credit_creation_params) ); } + $resourcePath = '/v2/payment/merchantcredit'; $formParams = []; $queryParams = []; @@ -753,21 +983,17 @@ public function createMerchantCreditRequest($wt_merchant_credit_creation_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_merchant_credit_creation_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_merchant_credit_creation_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_merchant_credit_creation_params)); } else { $httpBody = $wt_merchant_credit_creation_params; } @@ -786,12 +1012,12 @@ public function createMerchantCreditRequest($wt_merchant_credit_creation_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -807,10 +1033,11 @@ public function createMerchantCreditRequest($wt_merchant_credit_creation_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -822,14 +1049,15 @@ public function createMerchantCreditRequest($wt_merchant_credit_creation_params) * Fetch merchant credit * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMerchantCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMerchantCreditById($id) + public function fetchMerchantCreditById($id, string $contentType = self::contentTypes['fetchMerchantCreditById'][0]) { - list($response) = $this->fetchMerchantCreditByIdWithHttpInfo($id); + list($response) = $this->fetchMerchantCreditByIdWithHttpInfo($id, $contentType); return $response; } @@ -839,14 +1067,15 @@ public function fetchMerchantCreditById($id) * Fetch merchant credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMerchantCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMerchantCreditByIdWithHttpInfo($id) + public function fetchMerchantCreditByIdWithHttpInfo($id, string $contentType = self::contentTypes['fetchMerchantCreditById'][0]) { - $request = $this->fetchMerchantCreditByIdRequest($id); + $request = $this->fetchMerchantCreditByIdRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -889,6 +1118,21 @@ public function fetchMerchantCreditByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMerchantCredit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -901,6 +1145,21 @@ public function fetchMerchantCreditByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -913,6 +1172,21 @@ public function fetchMerchantCreditByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -925,6 +1199,21 @@ public function fetchMerchantCreditByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -939,6 +1228,21 @@ public function fetchMerchantCreditByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -992,13 +1296,14 @@ public function fetchMerchantCreditByIdWithHttpInfo($id) * Fetch merchant credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantCreditByIdAsync($id) + public function fetchMerchantCreditByIdAsync($id, string $contentType = self::contentTypes['fetchMerchantCreditById'][0]) { - return $this->fetchMerchantCreditByIdAsyncWithHttpInfo($id) + return $this->fetchMerchantCreditByIdAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1012,14 +1317,15 @@ function ($response) { * Fetch merchant credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantCreditByIdAsyncWithHttpInfo($id) + public function fetchMerchantCreditByIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchMerchantCreditById'][0]) { $returnType = '\OpenAPI\Client\Model\WTMerchantCredit'; - $request = $this->fetchMerchantCreditByIdRequest($id); + $request = $this->fetchMerchantCreditByIdRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1029,6 +1335,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1058,12 +1367,14 @@ function ($exception) { * Create request for operation 'fetchMerchantCreditById' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMerchantCreditByIdRequest($id) + public function fetchMerchantCreditByIdRequest($id, string $contentType = self::contentTypes['fetchMerchantCreditById'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1071,6 +1382,7 @@ public function fetchMerchantCreditByIdRequest($id) ); } + $resourcePath = '/v2/payment/merchantcredit/{id}'; $formParams = []; $queryParams = []; @@ -1090,16 +1402,11 @@ public function fetchMerchantCreditByIdRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1117,12 +1424,12 @@ public function fetchMerchantCreditByIdRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1138,10 +1445,11 @@ public function fetchMerchantCreditByIdRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1152,14 +1460,15 @@ public function fetchMerchantCreditByIdRequest($id) * * Fetch all active merchant credits * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchMembersCount200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMerchantCreditCount() + public function fetchMerchantCreditCount(string $contentType = self::contentTypes['fetchMerchantCreditCount'][0]) { - list($response) = $this->fetchMerchantCreditCountWithHttpInfo(); + list($response) = $this->fetchMerchantCreditCountWithHttpInfo($contentType); return $response; } @@ -1168,14 +1477,15 @@ public function fetchMerchantCreditCount() * * Fetch all active merchant credits * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchMembersCount200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMerchantCreditCountWithHttpInfo() + public function fetchMerchantCreditCountWithHttpInfo(string $contentType = self::contentTypes['fetchMerchantCreditCount'][0]) { - $request = $this->fetchMerchantCreditCountRequest(); + $request = $this->fetchMerchantCreditCountRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -1214,14 +1524,29 @@ public function fetchMerchantCreditCountWithHttpInfo() switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2003' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchMembersCount200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchMembersCount200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2003', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchMembersCount200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1230,6 +1555,21 @@ public function fetchMerchantCreditCountWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1242,6 +1582,21 @@ public function fetchMerchantCreditCountWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1254,6 +1609,21 @@ public function fetchMerchantCreditCountWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1263,11 +1633,26 @@ public function fetchMerchantCreditCountWithHttpInfo() ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; + $returnType = '\OpenAPI\Client\Model\FetchMembersCount200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1281,7 +1666,7 @@ public function fetchMerchantCreditCountWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2003', + '\OpenAPI\Client\Model\FetchMembersCount200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1320,13 +1705,14 @@ public function fetchMerchantCreditCountWithHttpInfo() * * Fetch all active merchant credits * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantCreditCountAsync() + public function fetchMerchantCreditCountAsync(string $contentType = self::contentTypes['fetchMerchantCreditCount'][0]) { - return $this->fetchMerchantCreditCountAsyncWithHttpInfo() + return $this->fetchMerchantCreditCountAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -1339,14 +1725,15 @@ function ($response) { * * Fetch all active merchant credits * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantCreditCountAsyncWithHttpInfo() + public function fetchMerchantCreditCountAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchMerchantCreditCount'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; - $request = $this->fetchMerchantCreditCountRequest(); + $returnType = '\OpenAPI\Client\Model\FetchMembersCount200Response'; + $request = $this->fetchMerchantCreditCountRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1356,6 +1743,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1384,13 +1774,15 @@ function ($exception) { /** * Create request for operation 'fetchMerchantCreditCount' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMerchantCreditCountRequest() + public function fetchMerchantCreditCountRequest(string $contentType = self::contentTypes['fetchMerchantCreditCount'][0]) { + $resourcePath = '/v2/payment/merchantcredit/count'; $formParams = []; $queryParams = []; @@ -1402,16 +1794,11 @@ public function fetchMerchantCreditCountRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1429,12 +1816,12 @@ public function fetchMerchantCreditCountRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1450,10 +1837,11 @@ public function fetchMerchantCreditCountRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1465,14 +1853,15 @@ public function fetchMerchantCreditCountRequest() * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditHistoryLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MSMerchantCreditHistoryPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMerchantCreditHistoryLog($pagination_request_with_id_and_without_sort_options) + public function fetchMerchantCreditHistoryLog($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditHistoryLog'][0]) { - list($response) = $this->fetchMerchantCreditHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options); + list($response) = $this->fetchMerchantCreditHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType); return $response; } @@ -1482,14 +1871,15 @@ public function fetchMerchantCreditHistoryLog($pagination_request_with_id_and_wi * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditHistoryLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MSMerchantCreditHistoryPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMerchantCreditHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMerchantCreditHistoryLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditHistoryLog'][0]) { - $request = $this->fetchMerchantCreditHistoryLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMerchantCreditHistoryLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); try { $options = $this->createHttpClientOption(); @@ -1532,6 +1922,21 @@ public function fetchMerchantCreditHistoryLogWithHttpInfo($pagination_request_wi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MSMerchantCreditHistoryPagination' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1544,6 +1949,21 @@ public function fetchMerchantCreditHistoryLogWithHttpInfo($pagination_request_wi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1556,6 +1976,21 @@ public function fetchMerchantCreditHistoryLogWithHttpInfo($pagination_request_wi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1568,6 +2003,21 @@ public function fetchMerchantCreditHistoryLogWithHttpInfo($pagination_request_wi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1582,6 +2032,21 @@ public function fetchMerchantCreditHistoryLogWithHttpInfo($pagination_request_wi $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1635,13 +2100,14 @@ public function fetchMerchantCreditHistoryLogWithHttpInfo($pagination_request_wi * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditHistoryLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantCreditHistoryLogAsync($pagination_request_with_id_and_without_sort_options) + public function fetchMerchantCreditHistoryLogAsync($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditHistoryLog'][0]) { - return $this->fetchMerchantCreditHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + return $this->fetchMerchantCreditHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType) ->then( function ($response) { return $response[0]; @@ -1655,14 +2121,15 @@ function ($response) { * Fetch history * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditHistoryLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantCreditHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMerchantCreditHistoryLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditHistoryLog'][0]) { $returnType = '\OpenAPI\Client\Model\MSMerchantCreditHistoryPagination'; - $request = $this->fetchMerchantCreditHistoryLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMerchantCreditHistoryLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1672,6 +2139,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1701,12 +2171,14 @@ function ($exception) { * Create request for operation 'fetchMerchantCreditHistoryLog' * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditHistoryLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMerchantCreditHistoryLogRequest($pagination_request_with_id_and_without_sort_options) + public function fetchMerchantCreditHistoryLogRequest($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditHistoryLog'][0]) { + // verify the required parameter 'pagination_request_with_id_and_without_sort_options' is set if ($pagination_request_with_id_and_without_sort_options === null || (is_array($pagination_request_with_id_and_without_sort_options) && count($pagination_request_with_id_and_without_sort_options) === 0)) { throw new \InvalidArgumentException( @@ -1714,6 +2186,7 @@ public function fetchMerchantCreditHistoryLogRequest($pagination_request_with_id ); } + $resourcePath = '/v2/payment/merchantcredit/history/log'; $formParams = []; $queryParams = []; @@ -1725,21 +2198,17 @@ public function fetchMerchantCreditHistoryLogRequest($pagination_request_with_id - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pagination_request_with_id_and_without_sort_options)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); } else { $httpBody = $pagination_request_with_id_and_without_sort_options; } @@ -1758,12 +2227,12 @@ public function fetchMerchantCreditHistoryLogRequest($pagination_request_with_id // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1779,10 +2248,11 @@ public function fetchMerchantCreditHistoryLogRequest($pagination_request_with_id $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1794,14 +2264,15 @@ public function fetchMerchantCreditHistoryLogRequest($pagination_request_with_id * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditRedemptionLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MSMerchantCreditRedemptionPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMerchantCreditRedemptionLog($pagination_request_with_id_and_without_sort_options) + public function fetchMerchantCreditRedemptionLog($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditRedemptionLog'][0]) { - list($response) = $this->fetchMerchantCreditRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options); + list($response) = $this->fetchMerchantCreditRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType); return $response; } @@ -1811,14 +2282,15 @@ public function fetchMerchantCreditRedemptionLog($pagination_request_with_id_and * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditRedemptionLog'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MSMerchantCreditRedemptionPagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMerchantCreditRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMerchantCreditRedemptionLogWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditRedemptionLog'][0]) { - $request = $this->fetchMerchantCreditRedemptionLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMerchantCreditRedemptionLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); try { $options = $this->createHttpClientOption(); @@ -1861,6 +2333,21 @@ public function fetchMerchantCreditRedemptionLogWithHttpInfo($pagination_request $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MSMerchantCreditRedemptionPagination' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1873,6 +2360,21 @@ public function fetchMerchantCreditRedemptionLogWithHttpInfo($pagination_request $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1885,6 +2387,21 @@ public function fetchMerchantCreditRedemptionLogWithHttpInfo($pagination_request $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1897,6 +2414,21 @@ public function fetchMerchantCreditRedemptionLogWithHttpInfo($pagination_request $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1911,6 +2443,21 @@ public function fetchMerchantCreditRedemptionLogWithHttpInfo($pagination_request $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1964,13 +2511,14 @@ public function fetchMerchantCreditRedemptionLogWithHttpInfo($pagination_request * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditRedemptionLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantCreditRedemptionLogAsync($pagination_request_with_id_and_without_sort_options) + public function fetchMerchantCreditRedemptionLogAsync($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditRedemptionLog'][0]) { - return $this->fetchMerchantCreditRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + return $this->fetchMerchantCreditRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, $contentType) ->then( function ($response) { return $response[0]; @@ -1984,14 +2532,15 @@ function ($response) { * Fetch redemption log * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditRedemptionLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantCreditRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options) + public function fetchMerchantCreditRedemptionLogAsyncWithHttpInfo($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditRedemptionLog'][0]) { $returnType = '\OpenAPI\Client\Model\MSMerchantCreditRedemptionPagination'; - $request = $this->fetchMerchantCreditRedemptionLogRequest($pagination_request_with_id_and_without_sort_options); + $request = $this->fetchMerchantCreditRedemptionLogRequest($pagination_request_with_id_and_without_sort_options, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2001,6 +2550,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2030,12 +2582,14 @@ function ($exception) { * Create request for operation 'fetchMerchantCreditRedemptionLog' * * @param \OpenAPI\Client\Model\PaginationRequestWithIDAndWithoutSortOptions $pagination_request_with_id_and_without_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditRedemptionLog'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMerchantCreditRedemptionLogRequest($pagination_request_with_id_and_without_sort_options) + public function fetchMerchantCreditRedemptionLogRequest($pagination_request_with_id_and_without_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditRedemptionLog'][0]) { + // verify the required parameter 'pagination_request_with_id_and_without_sort_options' is set if ($pagination_request_with_id_and_without_sort_options === null || (is_array($pagination_request_with_id_and_without_sort_options) && count($pagination_request_with_id_and_without_sort_options) === 0)) { throw new \InvalidArgumentException( @@ -2043,6 +2597,7 @@ public function fetchMerchantCreditRedemptionLogRequest($pagination_request_with ); } + $resourcePath = '/v2/payment/merchantcredit/redemption/log'; $formParams = []; $queryParams = []; @@ -2054,21 +2609,17 @@ public function fetchMerchantCreditRedemptionLogRequest($pagination_request_with - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pagination_request_with_id_and_without_sort_options)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_id_and_without_sort_options)); } else { $httpBody = $pagination_request_with_id_and_without_sort_options; } @@ -2087,12 +2638,12 @@ public function fetchMerchantCreditRedemptionLogRequest($pagination_request_with // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2108,10 +2659,11 @@ public function fetchMerchantCreditRedemptionLogRequest($pagination_request_with $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2123,14 +2675,15 @@ public function fetchMerchantCreditRedemptionLogRequest($pagination_request_with * Fetch merchant credits by page * * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptions $pagination_request_with_sort_options pagination_request_with_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditsByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMerchantCredit[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMerchantCreditsByPage($pagination_request_with_sort_options) + public function fetchMerchantCreditsByPage($pagination_request_with_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditsByPage'][0]) { - list($response) = $this->fetchMerchantCreditsByPageWithHttpInfo($pagination_request_with_sort_options); + list($response) = $this->fetchMerchantCreditsByPageWithHttpInfo($pagination_request_with_sort_options, $contentType); return $response; } @@ -2140,14 +2693,15 @@ public function fetchMerchantCreditsByPage($pagination_request_with_sort_options * Fetch merchant credits by page * * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptions $pagination_request_with_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditsByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMerchantCredit[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMerchantCreditsByPageWithHttpInfo($pagination_request_with_sort_options) + public function fetchMerchantCreditsByPageWithHttpInfo($pagination_request_with_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditsByPage'][0]) { - $request = $this->fetchMerchantCreditsByPageRequest($pagination_request_with_sort_options); + $request = $this->fetchMerchantCreditsByPageRequest($pagination_request_with_sort_options, $contentType); try { $options = $this->createHttpClientOption(); @@ -2190,6 +2744,21 @@ public function fetchMerchantCreditsByPageWithHttpInfo($pagination_request_with_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMerchantCredit[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2202,6 +2771,21 @@ public function fetchMerchantCreditsByPageWithHttpInfo($pagination_request_with_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2214,6 +2798,21 @@ public function fetchMerchantCreditsByPageWithHttpInfo($pagination_request_with_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2226,6 +2825,21 @@ public function fetchMerchantCreditsByPageWithHttpInfo($pagination_request_with_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2240,6 +2854,21 @@ public function fetchMerchantCreditsByPageWithHttpInfo($pagination_request_with_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2293,13 +2922,14 @@ public function fetchMerchantCreditsByPageWithHttpInfo($pagination_request_with_ * Fetch merchant credits by page * * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptions $pagination_request_with_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditsByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantCreditsByPageAsync($pagination_request_with_sort_options) + public function fetchMerchantCreditsByPageAsync($pagination_request_with_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditsByPage'][0]) { - return $this->fetchMerchantCreditsByPageAsyncWithHttpInfo($pagination_request_with_sort_options) + return $this->fetchMerchantCreditsByPageAsyncWithHttpInfo($pagination_request_with_sort_options, $contentType) ->then( function ($response) { return $response[0]; @@ -2313,14 +2943,15 @@ function ($response) { * Fetch merchant credits by page * * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptions $pagination_request_with_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditsByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantCreditsByPageAsyncWithHttpInfo($pagination_request_with_sort_options) + public function fetchMerchantCreditsByPageAsyncWithHttpInfo($pagination_request_with_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditsByPage'][0]) { $returnType = '\OpenAPI\Client\Model\WTMerchantCredit[]'; - $request = $this->fetchMerchantCreditsByPageRequest($pagination_request_with_sort_options); + $request = $this->fetchMerchantCreditsByPageRequest($pagination_request_with_sort_options, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2330,6 +2961,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2359,12 +2993,14 @@ function ($exception) { * Create request for operation 'fetchMerchantCreditsByPage' * * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptions $pagination_request_with_sort_options (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantCreditsByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMerchantCreditsByPageRequest($pagination_request_with_sort_options) + public function fetchMerchantCreditsByPageRequest($pagination_request_with_sort_options, string $contentType = self::contentTypes['fetchMerchantCreditsByPage'][0]) { + // verify the required parameter 'pagination_request_with_sort_options' is set if ($pagination_request_with_sort_options === null || (is_array($pagination_request_with_sort_options) && count($pagination_request_with_sort_options) === 0)) { throw new \InvalidArgumentException( @@ -2372,6 +3008,7 @@ public function fetchMerchantCreditsByPageRequest($pagination_request_with_sort_ ); } + $resourcePath = '/v2/payment/merchantcredit/page'; $formParams = []; $queryParams = []; @@ -2383,21 +3020,17 @@ public function fetchMerchantCreditsByPageRequest($pagination_request_with_sort_ - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pagination_request_with_sort_options)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_sort_options)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pagination_request_with_sort_options)); } else { $httpBody = $pagination_request_with_sort_options; } @@ -2416,12 +3049,12 @@ public function fetchMerchantCreditsByPageRequest($pagination_request_with_sort_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2437,10 +3070,11 @@ public function fetchMerchantCreditsByPageRequest($pagination_request_with_sort_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2452,14 +3086,15 @@ public function fetchMerchantCreditsByPageRequest($pagination_request_with_sort_ * Restore merchant credit * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMerchantCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreMerchantCredit($id) + public function restoreMerchantCredit($id, string $contentType = self::contentTypes['restoreMerchantCredit'][0]) { - list($response) = $this->restoreMerchantCreditWithHttpInfo($id); + list($response) = $this->restoreMerchantCreditWithHttpInfo($id, $contentType); return $response; } @@ -2469,14 +3104,15 @@ public function restoreMerchantCredit($id) * Restore merchant credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMerchantCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreMerchantCreditWithHttpInfo($id) + public function restoreMerchantCreditWithHttpInfo($id, string $contentType = self::contentTypes['restoreMerchantCredit'][0]) { - $request = $this->restoreMerchantCreditRequest($id); + $request = $this->restoreMerchantCreditRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2519,6 +3155,21 @@ public function restoreMerchantCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMerchantCredit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2531,6 +3182,21 @@ public function restoreMerchantCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2543,6 +3209,21 @@ public function restoreMerchantCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2555,6 +3236,21 @@ public function restoreMerchantCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2569,6 +3265,21 @@ public function restoreMerchantCreditWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2622,13 +3333,14 @@ public function restoreMerchantCreditWithHttpInfo($id) * Restore merchant credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreMerchantCreditAsync($id) + public function restoreMerchantCreditAsync($id, string $contentType = self::contentTypes['restoreMerchantCredit'][0]) { - return $this->restoreMerchantCreditAsyncWithHttpInfo($id) + return $this->restoreMerchantCreditAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -2642,14 +3354,15 @@ function ($response) { * Restore merchant credit * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreMerchantCreditAsyncWithHttpInfo($id) + public function restoreMerchantCreditAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreMerchantCredit'][0]) { $returnType = '\OpenAPI\Client\Model\WTMerchantCredit'; - $request = $this->restoreMerchantCreditRequest($id); + $request = $this->restoreMerchantCreditRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2659,6 +3372,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2688,12 +3404,14 @@ function ($exception) { * Create request for operation 'restoreMerchantCredit' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreMerchantCreditRequest($id) + public function restoreMerchantCreditRequest($id, string $contentType = self::contentTypes['restoreMerchantCredit'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -2701,6 +3419,7 @@ public function restoreMerchantCreditRequest($id) ); } + $resourcePath = '/v2/payment/merchantcredit/{id}'; $formParams = []; $queryParams = []; @@ -2720,16 +3439,11 @@ public function restoreMerchantCreditRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2747,12 +3461,12 @@ public function restoreMerchantCreditRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2768,10 +3482,11 @@ public function restoreMerchantCreditRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2783,14 +3498,15 @@ public function restoreMerchantCreditRequest($id) * Search for merchant credits * * @param \OpenAPI\Client\Model\MerchantCreditSearch $merchant_credit_search merchant_credit_search (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchMerchantCredits'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PaginatedWTMerchantCredits|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function searchMerchantCredits($merchant_credit_search) + public function searchMerchantCredits($merchant_credit_search, string $contentType = self::contentTypes['searchMerchantCredits'][0]) { - list($response) = $this->searchMerchantCreditsWithHttpInfo($merchant_credit_search); + list($response) = $this->searchMerchantCreditsWithHttpInfo($merchant_credit_search, $contentType); return $response; } @@ -2800,14 +3516,15 @@ public function searchMerchantCredits($merchant_credit_search) * Search for merchant credits * * @param \OpenAPI\Client\Model\MerchantCreditSearch $merchant_credit_search (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchMerchantCredits'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PaginatedWTMerchantCredits|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function searchMerchantCreditsWithHttpInfo($merchant_credit_search) + public function searchMerchantCreditsWithHttpInfo($merchant_credit_search, string $contentType = self::contentTypes['searchMerchantCredits'][0]) { - $request = $this->searchMerchantCreditsRequest($merchant_credit_search); + $request = $this->searchMerchantCreditsRequest($merchant_credit_search, $contentType); try { $options = $this->createHttpClientOption(); @@ -2850,6 +3567,21 @@ public function searchMerchantCreditsWithHttpInfo($merchant_credit_search) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PaginatedWTMerchantCredits' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2862,6 +3594,21 @@ public function searchMerchantCreditsWithHttpInfo($merchant_credit_search) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2874,6 +3621,21 @@ public function searchMerchantCreditsWithHttpInfo($merchant_credit_search) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2886,6 +3648,21 @@ public function searchMerchantCreditsWithHttpInfo($merchant_credit_search) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2900,6 +3677,21 @@ public function searchMerchantCreditsWithHttpInfo($merchant_credit_search) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2953,13 +3745,14 @@ public function searchMerchantCreditsWithHttpInfo($merchant_credit_search) * Search for merchant credits * * @param \OpenAPI\Client\Model\MerchantCreditSearch $merchant_credit_search (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchMerchantCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchMerchantCreditsAsync($merchant_credit_search) + public function searchMerchantCreditsAsync($merchant_credit_search, string $contentType = self::contentTypes['searchMerchantCredits'][0]) { - return $this->searchMerchantCreditsAsyncWithHttpInfo($merchant_credit_search) + return $this->searchMerchantCreditsAsyncWithHttpInfo($merchant_credit_search, $contentType) ->then( function ($response) { return $response[0]; @@ -2973,14 +3766,15 @@ function ($response) { * Search for merchant credits * * @param \OpenAPI\Client\Model\MerchantCreditSearch $merchant_credit_search (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchMerchantCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function searchMerchantCreditsAsyncWithHttpInfo($merchant_credit_search) + public function searchMerchantCreditsAsyncWithHttpInfo($merchant_credit_search, string $contentType = self::contentTypes['searchMerchantCredits'][0]) { $returnType = '\OpenAPI\Client\Model\PaginatedWTMerchantCredits'; - $request = $this->searchMerchantCreditsRequest($merchant_credit_search); + $request = $this->searchMerchantCreditsRequest($merchant_credit_search, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2990,6 +3784,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3019,12 +3816,14 @@ function ($exception) { * Create request for operation 'searchMerchantCredits' * * @param \OpenAPI\Client\Model\MerchantCreditSearch $merchant_credit_search (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['searchMerchantCredits'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function searchMerchantCreditsRequest($merchant_credit_search) + public function searchMerchantCreditsRequest($merchant_credit_search, string $contentType = self::contentTypes['searchMerchantCredits'][0]) { + // verify the required parameter 'merchant_credit_search' is set if ($merchant_credit_search === null || (is_array($merchant_credit_search) && count($merchant_credit_search) === 0)) { throw new \InvalidArgumentException( @@ -3032,6 +3831,7 @@ public function searchMerchantCreditsRequest($merchant_credit_search) ); } + $resourcePath = '/v2/payment/merchantcredit/search'; $formParams = []; $queryParams = []; @@ -3043,21 +3843,17 @@ public function searchMerchantCreditsRequest($merchant_credit_search) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($merchant_credit_search)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($merchant_credit_search)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($merchant_credit_search)); } else { $httpBody = $merchant_credit_search; } @@ -3076,12 +3872,12 @@ public function searchMerchantCreditsRequest($merchant_credit_search) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3097,10 +3893,11 @@ public function searchMerchantCreditsRequest($merchant_credit_search) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3113,14 +3910,15 @@ public function searchMerchantCreditsRequest($merchant_credit_search) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTMerchantCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function updateMerchantCredit($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number) + public function updateMerchantCredit($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number, string $contentType = self::contentTypes['updateMerchantCredit'][0]) { - list($response) = $this->updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number); + list($response) = $this->updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number, $contentType); return $response; } @@ -3131,14 +3929,15 @@ public function updateMerchantCredit($id, $pick_wt_merchant_credit_member_idor_c * * @param mixed $id (required) * @param \OpenAPI\Client\Model\PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchantCredit'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTMerchantCredit|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number) + public function updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number, string $contentType = self::contentTypes['updateMerchantCredit'][0]) { - $request = $this->updateMerchantCreditRequest($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number); + $request = $this->updateMerchantCreditRequest($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number, $contentType); try { $options = $this->createHttpClientOption(); @@ -3181,6 +3980,21 @@ public function updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_m $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTMerchantCredit' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3193,6 +4007,21 @@ public function updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_m $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3205,6 +4034,21 @@ public function updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_m $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3217,6 +4061,21 @@ public function updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_m $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3229,6 +4088,21 @@ public function updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_m $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3241,6 +4115,21 @@ public function updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_m $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3255,6 +4144,21 @@ public function updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_m $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3325,13 +4229,14 @@ public function updateMerchantCreditWithHttpInfo($id, $pick_wt_merchant_credit_m * * @param mixed $id (required) * @param \OpenAPI\Client\Model\PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateMerchantCreditAsync($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number) + public function updateMerchantCreditAsync($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number, string $contentType = self::contentTypes['updateMerchantCredit'][0]) { - return $this->updateMerchantCreditAsyncWithHttpInfo($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number) + return $this->updateMerchantCreditAsyncWithHttpInfo($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number, $contentType) ->then( function ($response) { return $response[0]; @@ -3346,14 +4251,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateMerchantCreditAsyncWithHttpInfo($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number) + public function updateMerchantCreditAsyncWithHttpInfo($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number, string $contentType = self::contentTypes['updateMerchantCredit'][0]) { $returnType = '\OpenAPI\Client\Model\WTMerchantCredit'; - $request = $this->updateMerchantCreditRequest($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number); + $request = $this->updateMerchantCreditRequest($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3363,6 +4269,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3393,18 +4302,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchantCredit'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateMerchantCreditRequest($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number) + public function updateMerchantCreditRequest($id, $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number, string $contentType = self::contentTypes['updateMerchantCredit'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateMerchantCredit' ); } + // verify the required parameter 'pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number' is set if ($pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number === null || (is_array($pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number) && count($pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number) === 0)) { throw new \InvalidArgumentException( @@ -3412,6 +4324,7 @@ public function updateMerchantCreditRequest($id, $pick_wt_merchant_credit_member ); } + $resourcePath = '/v2/payment/merchantcredit/{id}'; $formParams = []; $queryParams = []; @@ -3431,21 +4344,17 @@ public function updateMerchantCreditRequest($id, $pick_wt_merchant_credit_member } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number)); } else { $httpBody = $pick_wt_merchant_credit_member_idor_credit_amount_or_mobile_number; } @@ -3464,12 +4373,12 @@ public function updateMerchantCreditRequest($id, $pick_wt_merchant_credit_member // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3485,10 +4394,11 @@ public function updateMerchantCreditRequest($id, $pick_wt_merchant_credit_member $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/MerchantURLsApi.php b/lib/Api/MerchantURLsApi.php index e043ead..cf95f83 100644 --- a/lib/Api/MerchantURLsApi.php +++ b/lib/Api/MerchantURLsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createMerchantURL' => [ + 'application/json', + ], + 'fetchAllMerchantURLs' => [ + 'application/json', + ], + 'fetchMerchantURL' => [ + 'application/json', + ], + 'fetchMerchantURLRequests' => [ + 'application/json', + ], + 'restoreMerchantURL' => [ + 'application/json', + ], + 'updateMerchantURL' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +147,15 @@ public function getConfig() * Archive merchant url * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantURL'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MerchantURL|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveMerchantURL($id) + public function archiveMerchantURL($id, string $contentType = self::contentTypes['archiveMerchantURL'][0]) { - list($response) = $this->archiveMerchantURLWithHttpInfo($id); + list($response) = $this->archiveMerchantURLWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +165,15 @@ public function archiveMerchantURL($id) * Archive merchant url * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantURL'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MerchantURL|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveMerchantURLWithHttpInfo($id) + public function archiveMerchantURLWithHttpInfo($id, string $contentType = self::contentTypes['archiveMerchantURL'][0]) { - $request = $this->archiveMerchantURLRequest($id); + $request = $this->archiveMerchantURLRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +216,21 @@ public function archiveMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantURL' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +243,21 @@ public function archiveMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +270,21 @@ public function archiveMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +297,21 @@ public function archiveMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +326,21 @@ public function archiveMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +394,14 @@ public function archiveMerchantURLWithHttpInfo($id) * Archive merchant url * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveMerchantURLAsync($id) + public function archiveMerchantURLAsync($id, string $contentType = self::contentTypes['archiveMerchantURL'][0]) { - return $this->archiveMerchantURLAsyncWithHttpInfo($id) + return $this->archiveMerchantURLAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +415,15 @@ function ($response) { * Archive merchant url * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveMerchantURLAsyncWithHttpInfo($id) + public function archiveMerchantURLAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveMerchantURL'][0]) { $returnType = '\OpenAPI\Client\Model\MerchantURL'; - $request = $this->archiveMerchantURLRequest($id); + $request = $this->archiveMerchantURLRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +433,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +465,14 @@ function ($exception) { * Create request for operation 'archiveMerchantURL' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveMerchantURLRequest($id) + public function archiveMerchantURLRequest($id, string $contentType = self::contentTypes['archiveMerchantURL'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +480,7 @@ public function archiveMerchantURLRequest($id) ); } + $resourcePath = '/v2/business/merchantUrl/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +500,11 @@ public function archiveMerchantURLRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +522,12 @@ public function archiveMerchantURLRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +543,11 @@ public function archiveMerchantURLRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +559,15 @@ public function archiveMerchantURLRequest($id) * Create merchant url * * @param \OpenAPI\Client\Model\WTMerchantURLCreate $wt_merchant_url_create wt_merchant_url_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMerchantURL'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MerchantURL|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createMerchantURL($wt_merchant_url_create) + public function createMerchantURL($wt_merchant_url_create, string $contentType = self::contentTypes['createMerchantURL'][0]) { - list($response) = $this->createMerchantURLWithHttpInfo($wt_merchant_url_create); + list($response) = $this->createMerchantURLWithHttpInfo($wt_merchant_url_create, $contentType); return $response; } @@ -470,14 +577,15 @@ public function createMerchantURL($wt_merchant_url_create) * Create merchant url * * @param \OpenAPI\Client\Model\WTMerchantURLCreate $wt_merchant_url_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMerchantURL'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MerchantURL|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createMerchantURLWithHttpInfo($wt_merchant_url_create) + public function createMerchantURLWithHttpInfo($wt_merchant_url_create, string $contentType = self::contentTypes['createMerchantURL'][0]) { - $request = $this->createMerchantURLRequest($wt_merchant_url_create); + $request = $this->createMerchantURLRequest($wt_merchant_url_create, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +628,21 @@ public function createMerchantURLWithHttpInfo($wt_merchant_url_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantURL' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +655,21 @@ public function createMerchantURLWithHttpInfo($wt_merchant_url_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +682,21 @@ public function createMerchantURLWithHttpInfo($wt_merchant_url_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +709,21 @@ public function createMerchantURLWithHttpInfo($wt_merchant_url_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +738,21 @@ public function createMerchantURLWithHttpInfo($wt_merchant_url_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +806,14 @@ public function createMerchantURLWithHttpInfo($wt_merchant_url_create) * Create merchant url * * @param \OpenAPI\Client\Model\WTMerchantURLCreate $wt_merchant_url_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createMerchantURLAsync($wt_merchant_url_create) + public function createMerchantURLAsync($wt_merchant_url_create, string $contentType = self::contentTypes['createMerchantURL'][0]) { - return $this->createMerchantURLAsyncWithHttpInfo($wt_merchant_url_create) + return $this->createMerchantURLAsyncWithHttpInfo($wt_merchant_url_create, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +827,15 @@ function ($response) { * Create merchant url * * @param \OpenAPI\Client\Model\WTMerchantURLCreate $wt_merchant_url_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createMerchantURLAsyncWithHttpInfo($wt_merchant_url_create) + public function createMerchantURLAsyncWithHttpInfo($wt_merchant_url_create, string $contentType = self::contentTypes['createMerchantURL'][0]) { $returnType = '\OpenAPI\Client\Model\MerchantURL'; - $request = $this->createMerchantURLRequest($wt_merchant_url_create); + $request = $this->createMerchantURLRequest($wt_merchant_url_create, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +845,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +877,14 @@ function ($exception) { * Create request for operation 'createMerchantURL' * * @param \OpenAPI\Client\Model\WTMerchantURLCreate $wt_merchant_url_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createMerchantURLRequest($wt_merchant_url_create) + public function createMerchantURLRequest($wt_merchant_url_create, string $contentType = self::contentTypes['createMerchantURL'][0]) { + // verify the required parameter 'wt_merchant_url_create' is set if ($wt_merchant_url_create === null || (is_array($wt_merchant_url_create) && count($wt_merchant_url_create) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +892,7 @@ public function createMerchantURLRequest($wt_merchant_url_create) ); } + $resourcePath = '/v2/business/merchantUrl'; $formParams = []; $queryParams = []; @@ -713,21 +904,17 @@ public function createMerchantURLRequest($wt_merchant_url_create) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_merchant_url_create)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_merchant_url_create)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_merchant_url_create)); } else { $httpBody = $wt_merchant_url_create; } @@ -746,12 +933,12 @@ public function createMerchantURLRequest($wt_merchant_url_create) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +954,11 @@ public function createMerchantURLRequest($wt_merchant_url_create) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +970,15 @@ public function createMerchantURLRequest($wt_merchant_url_create) * Fetch all merchant urls * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMerchantURLs'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllMerchantURLs($is_archive_included = null) + public function fetchAllMerchantURLs($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMerchantURLs'][0]) { - list($response) = $this->fetchAllMerchantURLsWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllMerchantURLsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +988,15 @@ public function fetchAllMerchantURLs($is_archive_included = null) * Fetch all merchant urls * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMerchantURLs'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllMerchantURLsWithHttpInfo($is_archive_included = null) + public function fetchAllMerchantURLsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMerchantURLs'][0]) { - $request = $this->fetchAllMerchantURLsRequest($is_archive_included); + $request = $this->fetchAllMerchantURLsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1039,21 @@ public function fetchAllMerchantURLsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1066,21 @@ public function fetchAllMerchantURLsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1093,21 @@ public function fetchAllMerchantURLsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1120,21 @@ public function fetchAllMerchantURLsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1149,21 @@ public function fetchAllMerchantURLsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1217,14 @@ public function fetchAllMerchantURLsWithHttpInfo($is_archive_included = null) * Fetch all merchant urls * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMerchantURLs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllMerchantURLsAsync($is_archive_included = null) + public function fetchAllMerchantURLsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMerchantURLs'][0]) { - return $this->fetchAllMerchantURLsAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllMerchantURLsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1238,15 @@ function ($response) { * Fetch all merchant urls * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMerchantURLs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllMerchantURLsAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllMerchantURLsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMerchantURLs'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllMerchantURLsRequest($is_archive_included); + $request = $this->fetchAllMerchantURLsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1256,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1288,16 @@ function ($exception) { * Create request for operation 'fetchAllMerchantURLs' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllMerchantURLs'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllMerchantURLsRequest($is_archive_included = null) + public function fetchAllMerchantURLsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllMerchantURLs'][0]) { + + $resourcePath = '/v2/business/merchantUrl/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1306,23 @@ public function fetchAllMerchantURLsRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1340,12 @@ public function fetchAllMerchantURLsRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1361,11 @@ public function fetchAllMerchantURLsRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1377,15 @@ public function fetchAllMerchantURLsRequest($is_archive_included = null) * Fetch merchant url * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantURL'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MerchantURL|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMerchantURL($id) + public function fetchMerchantURL($id, string $contentType = self::contentTypes['fetchMerchantURL'][0]) { - list($response) = $this->fetchMerchantURLWithHttpInfo($id); + list($response) = $this->fetchMerchantURLWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1395,15 @@ public function fetchMerchantURL($id) * Fetch merchant url * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantURL'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MerchantURL|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMerchantURLWithHttpInfo($id) + public function fetchMerchantURLWithHttpInfo($id, string $contentType = self::contentTypes['fetchMerchantURL'][0]) { - $request = $this->fetchMerchantURLRequest($id); + $request = $this->fetchMerchantURLRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1446,21 @@ public function fetchMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantURL' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1473,21 @@ public function fetchMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1500,21 @@ public function fetchMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1527,21 @@ public function fetchMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1556,21 @@ public function fetchMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1624,14 @@ public function fetchMerchantURLWithHttpInfo($id) * Fetch merchant url * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantURLAsync($id) + public function fetchMerchantURLAsync($id, string $contentType = self::contentTypes['fetchMerchantURL'][0]) { - return $this->fetchMerchantURLAsyncWithHttpInfo($id) + return $this->fetchMerchantURLAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1645,15 @@ function ($response) { * Fetch merchant url * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantURLAsyncWithHttpInfo($id) + public function fetchMerchantURLAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchMerchantURL'][0]) { $returnType = '\OpenAPI\Client\Model\MerchantURL'; - $request = $this->fetchMerchantURLRequest($id); + $request = $this->fetchMerchantURLRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1663,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1695,14 @@ function ($exception) { * Create request for operation 'fetchMerchantURL' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMerchantURLRequest($id) + public function fetchMerchantURLRequest($id, string $contentType = self::contentTypes['fetchMerchantURL'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1710,7 @@ public function fetchMerchantURLRequest($id) ); } + $resourcePath = '/v2/business/merchantUrl/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1730,11 @@ public function fetchMerchantURLRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1752,12 @@ public function fetchMerchantURLRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1773,11 @@ public function fetchMerchantURLRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1441,14 +1789,15 @@ public function fetchMerchantURLRequest($id) * Fetch requests * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantURLRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchMerchantURLRequests($id) + public function fetchMerchantURLRequests($id, string $contentType = self::contentTypes['fetchMerchantURLRequests'][0]) { - list($response) = $this->fetchMerchantURLRequestsWithHttpInfo($id); + list($response) = $this->fetchMerchantURLRequestsWithHttpInfo($id, $contentType); return $response; } @@ -1458,14 +1807,15 @@ public function fetchMerchantURLRequests($id) * Fetch requests * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantURLRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchMerchantURLRequestsWithHttpInfo($id) + public function fetchMerchantURLRequestsWithHttpInfo($id, string $contentType = self::contentTypes['fetchMerchantURLRequests'][0]) { - $request = $this->fetchMerchantURLRequestsRequest($id); + $request = $this->fetchMerchantURLRequestsRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1508,6 +1858,21 @@ public function fetchMerchantURLRequestsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WalletPageView[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1520,6 +1885,21 @@ public function fetchMerchantURLRequestsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1532,6 +1912,21 @@ public function fetchMerchantURLRequestsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1544,6 +1939,21 @@ public function fetchMerchantURLRequestsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1558,6 +1968,21 @@ public function fetchMerchantURLRequestsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1611,13 +2036,14 @@ public function fetchMerchantURLRequestsWithHttpInfo($id) * Fetch requests * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantURLRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantURLRequestsAsync($id) + public function fetchMerchantURLRequestsAsync($id, string $contentType = self::contentTypes['fetchMerchantURLRequests'][0]) { - return $this->fetchMerchantURLRequestsAsyncWithHttpInfo($id) + return $this->fetchMerchantURLRequestsAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1631,14 +2057,15 @@ function ($response) { * Fetch requests * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantURLRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchMerchantURLRequestsAsyncWithHttpInfo($id) + public function fetchMerchantURLRequestsAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchMerchantURLRequests'][0]) { $returnType = '\OpenAPI\Client\Model\WalletPageView[]'; - $request = $this->fetchMerchantURLRequestsRequest($id); + $request = $this->fetchMerchantURLRequestsRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1648,6 +2075,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1677,12 +2107,14 @@ function ($exception) { * Create request for operation 'fetchMerchantURLRequests' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchMerchantURLRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchMerchantURLRequestsRequest($id) + public function fetchMerchantURLRequestsRequest($id, string $contentType = self::contentTypes['fetchMerchantURLRequests'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1690,6 +2122,7 @@ public function fetchMerchantURLRequestsRequest($id) ); } + $resourcePath = '/v2/business/merchantUrl/requests/{id}'; $formParams = []; $queryParams = []; @@ -1709,16 +2142,11 @@ public function fetchMerchantURLRequestsRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1736,12 +2164,12 @@ public function fetchMerchantURLRequestsRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1757,10 +2185,11 @@ public function fetchMerchantURLRequestsRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1772,14 +2201,15 @@ public function fetchMerchantURLRequestsRequest($id) * Restore merchant url * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMerchantURL'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MerchantURL|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreMerchantURL($id) + public function restoreMerchantURL($id, string $contentType = self::contentTypes['restoreMerchantURL'][0]) { - list($response) = $this->restoreMerchantURLWithHttpInfo($id); + list($response) = $this->restoreMerchantURLWithHttpInfo($id, $contentType); return $response; } @@ -1789,14 +2219,15 @@ public function restoreMerchantURL($id) * Restore merchant url * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMerchantURL'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MerchantURL|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreMerchantURLWithHttpInfo($id) + public function restoreMerchantURLWithHttpInfo($id, string $contentType = self::contentTypes['restoreMerchantURL'][0]) { - $request = $this->restoreMerchantURLRequest($id); + $request = $this->restoreMerchantURLRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1839,6 +2270,21 @@ public function restoreMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantURL' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1851,6 +2297,21 @@ public function restoreMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1863,6 +2324,21 @@ public function restoreMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1875,6 +2351,21 @@ public function restoreMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1889,6 +2380,21 @@ public function restoreMerchantURLWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1942,13 +2448,14 @@ public function restoreMerchantURLWithHttpInfo($id) * Restore merchant url * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreMerchantURLAsync($id) + public function restoreMerchantURLAsync($id, string $contentType = self::contentTypes['restoreMerchantURL'][0]) { - return $this->restoreMerchantURLAsyncWithHttpInfo($id) + return $this->restoreMerchantURLAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1962,14 +2469,15 @@ function ($response) { * Restore merchant url * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreMerchantURLAsyncWithHttpInfo($id) + public function restoreMerchantURLAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreMerchantURL'][0]) { $returnType = '\OpenAPI\Client\Model\MerchantURL'; - $request = $this->restoreMerchantURLRequest($id); + $request = $this->restoreMerchantURLRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1979,6 +2487,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2008,12 +2519,14 @@ function ($exception) { * Create request for operation 'restoreMerchantURL' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreMerchantURLRequest($id) + public function restoreMerchantURLRequest($id, string $contentType = self::contentTypes['restoreMerchantURL'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -2021,6 +2534,7 @@ public function restoreMerchantURLRequest($id) ); } + $resourcePath = '/v2/business/merchantUrl/{id}'; $formParams = []; $queryParams = []; @@ -2040,16 +2554,11 @@ public function restoreMerchantURLRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2067,12 +2576,12 @@ public function restoreMerchantURLRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2088,10 +2597,11 @@ public function restoreMerchantURLRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2104,14 +2614,15 @@ public function restoreMerchantURLRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTMerchantURLUpdate $wt_merchant_url_update wt_merchant_url_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchantURL'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\MerchantURL|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateMerchantURL($id, $wt_merchant_url_update) + public function updateMerchantURL($id, $wt_merchant_url_update, string $contentType = self::contentTypes['updateMerchantURL'][0]) { - list($response) = $this->updateMerchantURLWithHttpInfo($id, $wt_merchant_url_update); + list($response) = $this->updateMerchantURLWithHttpInfo($id, $wt_merchant_url_update, $contentType); return $response; } @@ -2122,14 +2633,15 @@ public function updateMerchantURL($id, $wt_merchant_url_update) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTMerchantURLUpdate $wt_merchant_url_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchantURL'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\MerchantURL|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateMerchantURLWithHttpInfo($id, $wt_merchant_url_update) + public function updateMerchantURLWithHttpInfo($id, $wt_merchant_url_update, string $contentType = self::contentTypes['updateMerchantURL'][0]) { - $request = $this->updateMerchantURLRequest($id, $wt_merchant_url_update); + $request = $this->updateMerchantURLRequest($id, $wt_merchant_url_update, $contentType); try { $options = $this->createHttpClientOption(); @@ -2172,6 +2684,21 @@ public function updateMerchantURLWithHttpInfo($id, $wt_merchant_url_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantURL' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2184,6 +2711,21 @@ public function updateMerchantURLWithHttpInfo($id, $wt_merchant_url_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2196,6 +2738,21 @@ public function updateMerchantURLWithHttpInfo($id, $wt_merchant_url_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2208,6 +2765,21 @@ public function updateMerchantURLWithHttpInfo($id, $wt_merchant_url_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2222,6 +2794,21 @@ public function updateMerchantURLWithHttpInfo($id, $wt_merchant_url_update) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2276,13 +2863,14 @@ public function updateMerchantURLWithHttpInfo($id, $wt_merchant_url_update) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTMerchantURLUpdate $wt_merchant_url_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateMerchantURLAsync($id, $wt_merchant_url_update) + public function updateMerchantURLAsync($id, $wt_merchant_url_update, string $contentType = self::contentTypes['updateMerchantURL'][0]) { - return $this->updateMerchantURLAsyncWithHttpInfo($id, $wt_merchant_url_update) + return $this->updateMerchantURLAsyncWithHttpInfo($id, $wt_merchant_url_update, $contentType) ->then( function ($response) { return $response[0]; @@ -2297,14 +2885,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTMerchantURLUpdate $wt_merchant_url_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateMerchantURLAsyncWithHttpInfo($id, $wt_merchant_url_update) + public function updateMerchantURLAsyncWithHttpInfo($id, $wt_merchant_url_update, string $contentType = self::contentTypes['updateMerchantURL'][0]) { $returnType = '\OpenAPI\Client\Model\MerchantURL'; - $request = $this->updateMerchantURLRequest($id, $wt_merchant_url_update); + $request = $this->updateMerchantURLRequest($id, $wt_merchant_url_update, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2314,6 +2903,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2344,18 +2936,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTMerchantURLUpdate $wt_merchant_url_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateMerchantURL'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateMerchantURLRequest($id, $wt_merchant_url_update) + public function updateMerchantURLRequest($id, $wt_merchant_url_update, string $contentType = self::contentTypes['updateMerchantURL'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateMerchantURL' ); } + // verify the required parameter 'wt_merchant_url_update' is set if ($wt_merchant_url_update === null || (is_array($wt_merchant_url_update) && count($wt_merchant_url_update) === 0)) { throw new \InvalidArgumentException( @@ -2363,6 +2958,7 @@ public function updateMerchantURLRequest($id, $wt_merchant_url_update) ); } + $resourcePath = '/v2/business/merchantUrl/{id}'; $formParams = []; $queryParams = []; @@ -2382,21 +2978,17 @@ public function updateMerchantURLRequest($id, $wt_merchant_url_update) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_merchant_url_update)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_merchant_url_update)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_merchant_url_update)); } else { $httpBody = $wt_merchant_url_update; } @@ -2415,12 +3007,12 @@ public function updateMerchantURLRequest($id, $wt_merchant_url_update) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2436,10 +3028,11 @@ public function updateMerchantURLRequest($id, $wt_merchant_url_update) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/MobileTerminalApi.php b/lib/Api/MobileTerminalApi.php index 4d9deaa..06f6e56 100644 --- a/lib/Api/MobileTerminalApi.php +++ b/lib/Api/MobileTerminalApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'findMemberByID' => [ + 'application/json', + ], + 'redeemWalletItemFromMobileTerminal' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +135,15 @@ public function getConfig() * Fetch item * * @param string $item_id item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromMobileTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchWalletItemFromMobileTerminal($item_id) + public function fetchWalletItemFromMobileTerminal($item_id, string $contentType = self::contentTypes['fetchWalletItemFromMobileTerminal'][0]) { - list($response) = $this->fetchWalletItemFromMobileTerminalWithHttpInfo($item_id); + list($response) = $this->fetchWalletItemFromMobileTerminalWithHttpInfo($item_id, $contentType); return $response; } @@ -139,14 +153,15 @@ public function fetchWalletItemFromMobileTerminal($item_id) * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromMobileTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchWalletItemFromMobileTerminalWithHttpInfo($item_id) + public function fetchWalletItemFromMobileTerminalWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchWalletItemFromMobileTerminal'][0]) { - $request = $this->fetchWalletItemFromMobileTerminalRequest($item_id); + $request = $this->fetchWalletItemFromMobileTerminalRequest($item_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +204,21 @@ public function fetchWalletItemFromMobileTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +231,21 @@ public function fetchWalletItemFromMobileTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +258,21 @@ public function fetchWalletItemFromMobileTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +285,21 @@ public function fetchWalletItemFromMobileTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +314,21 @@ public function fetchWalletItemFromMobileTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +382,14 @@ public function fetchWalletItemFromMobileTerminalWithHttpInfo($item_id) * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromMobileTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletItemFromMobileTerminalAsync($item_id) + public function fetchWalletItemFromMobileTerminalAsync($item_id, string $contentType = self::contentTypes['fetchWalletItemFromMobileTerminal'][0]) { - return $this->fetchWalletItemFromMobileTerminalAsyncWithHttpInfo($item_id) + return $this->fetchWalletItemFromMobileTerminalAsyncWithHttpInfo($item_id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +403,15 @@ function ($response) { * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromMobileTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletItemFromMobileTerminalAsyncWithHttpInfo($item_id) + public function fetchWalletItemFromMobileTerminalAsyncWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchWalletItemFromMobileTerminal'][0]) { $returnType = 'mixed'; - $request = $this->fetchWalletItemFromMobileTerminalRequest($item_id); + $request = $this->fetchWalletItemFromMobileTerminalRequest($item_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +421,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +453,14 @@ function ($exception) { * Create request for operation 'fetchWalletItemFromMobileTerminal' * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromMobileTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchWalletItemFromMobileTerminalRequest($item_id) + public function fetchWalletItemFromMobileTerminalRequest($item_id, string $contentType = self::contentTypes['fetchWalletItemFromMobileTerminal'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +468,7 @@ public function fetchWalletItemFromMobileTerminalRequest($item_id) ); } + $resourcePath = '/v2/pos/mobile/item/{itemID}'; $formParams = []; $queryParams = []; @@ -390,16 +488,11 @@ public function fetchWalletItemFromMobileTerminalRequest($item_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +510,12 @@ public function fetchWalletItemFromMobileTerminalRequest($item_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +531,11 @@ public function fetchWalletItemFromMobileTerminalRequest($item_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +547,15 @@ public function fetchWalletItemFromMobileTerminalRequest($item_id) * Find member * * @param string $member_id member_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMemberByID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Member|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function findMemberByID($member_id) + public function findMemberByID($member_id, string $contentType = self::contentTypes['findMemberByID'][0]) { - list($response) = $this->findMemberByIDWithHttpInfo($member_id); + list($response) = $this->findMemberByIDWithHttpInfo($member_id, $contentType); return $response; } @@ -470,14 +565,15 @@ public function findMemberByID($member_id) * Find member * * @param string $member_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMemberByID'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Member|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function findMemberByIDWithHttpInfo($member_id) + public function findMemberByIDWithHttpInfo($member_id, string $contentType = self::contentTypes['findMemberByID'][0]) { - $request = $this->findMemberByIDRequest($member_id); + $request = $this->findMemberByIDRequest($member_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +616,21 @@ public function findMemberByIDWithHttpInfo($member_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Member' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +643,21 @@ public function findMemberByIDWithHttpInfo($member_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +670,21 @@ public function findMemberByIDWithHttpInfo($member_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +697,21 @@ public function findMemberByIDWithHttpInfo($member_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +726,21 @@ public function findMemberByIDWithHttpInfo($member_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +794,14 @@ public function findMemberByIDWithHttpInfo($member_id) * Find member * * @param string $member_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMemberByID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findMemberByIDAsync($member_id) + public function findMemberByIDAsync($member_id, string $contentType = self::contentTypes['findMemberByID'][0]) { - return $this->findMemberByIDAsyncWithHttpInfo($member_id) + return $this->findMemberByIDAsyncWithHttpInfo($member_id, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +815,15 @@ function ($response) { * Find member * * @param string $member_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMemberByID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function findMemberByIDAsyncWithHttpInfo($member_id) + public function findMemberByIDAsyncWithHttpInfo($member_id, string $contentType = self::contentTypes['findMemberByID'][0]) { $returnType = '\OpenAPI\Client\Model\Member'; - $request = $this->findMemberByIDRequest($member_id); + $request = $this->findMemberByIDRequest($member_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +833,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +865,14 @@ function ($exception) { * Create request for operation 'findMemberByID' * * @param string $member_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['findMemberByID'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function findMemberByIDRequest($member_id) + public function findMemberByIDRequest($member_id, string $contentType = self::contentTypes['findMemberByID'][0]) { + // verify the required parameter 'member_id' is set if ($member_id === null || (is_array($member_id) && count($member_id) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +880,7 @@ public function findMemberByIDRequest($member_id) ); } + $resourcePath = '/v2/pos/mobile/member/{memberID}'; $formParams = []; $queryParams = []; @@ -721,16 +900,11 @@ public function findMemberByIDRequest($member_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -748,12 +922,12 @@ public function findMemberByIDRequest($member_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -769,10 +943,11 @@ public function findMemberByIDRequest($member_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -785,14 +960,15 @@ public function findMemberByIDRequest($member_id) * * @param string $item_id item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromMobileTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function redeemWalletItemFromMobileTerminal($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromMobileTerminal($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromMobileTerminal'][0]) { - list($response) = $this->redeemWalletItemFromMobileTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption); + list($response) = $this->redeemWalletItemFromMobileTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption, $contentType); return $response; } @@ -803,14 +979,15 @@ public function redeemWalletItemFromMobileTerminal($item_id, $wt_wallet_item_red * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromMobileTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function redeemWalletItemFromMobileTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromMobileTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromMobileTerminal'][0]) { - $request = $this->redeemWalletItemFromMobileTerminalRequest($item_id, $wt_wallet_item_redemption); + $request = $this->redeemWalletItemFromMobileTerminalRequest($item_id, $wt_wallet_item_redemption, $contentType); try { $options = $this->createHttpClientOption(); @@ -853,6 +1030,21 @@ public function redeemWalletItemFromMobileTerminalWithHttpInfo($item_id, $wt_wal $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -865,6 +1057,21 @@ public function redeemWalletItemFromMobileTerminalWithHttpInfo($item_id, $wt_wal $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -877,6 +1084,21 @@ public function redeemWalletItemFromMobileTerminalWithHttpInfo($item_id, $wt_wal $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -889,6 +1111,21 @@ public function redeemWalletItemFromMobileTerminalWithHttpInfo($item_id, $wt_wal $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -903,6 +1140,21 @@ public function redeemWalletItemFromMobileTerminalWithHttpInfo($item_id, $wt_wal $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -957,13 +1209,14 @@ public function redeemWalletItemFromMobileTerminalWithHttpInfo($item_id, $wt_wal * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromMobileTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function redeemWalletItemFromMobileTerminalAsync($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromMobileTerminalAsync($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromMobileTerminal'][0]) { - return $this->redeemWalletItemFromMobileTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption) + return $this->redeemWalletItemFromMobileTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption, $contentType) ->then( function ($response) { return $response[0]; @@ -978,14 +1231,15 @@ function ($response) { * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromMobileTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function redeemWalletItemFromMobileTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromMobileTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromMobileTerminal'][0]) { $returnType = 'mixed'; - $request = $this->redeemWalletItemFromMobileTerminalRequest($item_id, $wt_wallet_item_redemption); + $request = $this->redeemWalletItemFromMobileTerminalRequest($item_id, $wt_wallet_item_redemption, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -995,6 +1249,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1025,18 +1282,21 @@ function ($exception) { * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromMobileTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function redeemWalletItemFromMobileTerminalRequest($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromMobileTerminalRequest($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromMobileTerminal'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $item_id when calling redeemWalletItemFromMobileTerminal' ); } + // verify the required parameter 'wt_wallet_item_redemption' is set if ($wt_wallet_item_redemption === null || (is_array($wt_wallet_item_redemption) && count($wt_wallet_item_redemption) === 0)) { throw new \InvalidArgumentException( @@ -1044,6 +1304,7 @@ public function redeemWalletItemFromMobileTerminalRequest($item_id, $wt_wallet_i ); } + $resourcePath = '/v2/pos/mobile/item/redeem/{itemID}'; $formParams = []; $queryParams = []; @@ -1063,21 +1324,17 @@ public function redeemWalletItemFromMobileTerminalRequest($item_id, $wt_wallet_i } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_wallet_item_redemption)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_wallet_item_redemption)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_wallet_item_redemption)); } else { $httpBody = $wt_wallet_item_redemption; } @@ -1096,12 +1353,12 @@ public function redeemWalletItemFromMobileTerminalRequest($item_id, $wt_wallet_i // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1117,10 +1374,11 @@ public function redeemWalletItemFromMobileTerminalRequest($item_id, $wt_wallet_i $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/NewsApi.php b/lib/Api/NewsApi.php index abf4073..a130faa 100644 --- a/lib/Api/NewsApi.php +++ b/lib/Api/NewsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createNewsArticle' => [ + 'application/json', + ], + 'fetchAllNewsArticles' => [ + 'application/json', + ], + 'restoreNewsArticle' => [ + 'application/json', + ], + 'updateNewsArticle' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive news article * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveNewsArticle'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\NewsArticle|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveNewsArticle($id) + public function archiveNewsArticle($id, string $contentType = self::contentTypes['archiveNewsArticle'][0]) { - list($response) = $this->archiveNewsArticleWithHttpInfo($id); + list($response) = $this->archiveNewsArticleWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveNewsArticle($id) * Archive news article * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveNewsArticle'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\NewsArticle|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveNewsArticleWithHttpInfo($id) + public function archiveNewsArticleWithHttpInfo($id, string $contentType = self::contentTypes['archiveNewsArticle'][0]) { - $request = $this->archiveNewsArticleRequest($id); + $request = $this->archiveNewsArticleRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveNewsArticleWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\NewsArticle' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveNewsArticleWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveNewsArticleWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveNewsArticleWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveNewsArticleWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveNewsArticleWithHttpInfo($id) * Archive news article * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveNewsArticleAsync($id) + public function archiveNewsArticleAsync($id, string $contentType = self::contentTypes['archiveNewsArticle'][0]) { - return $this->archiveNewsArticleAsyncWithHttpInfo($id) + return $this->archiveNewsArticleAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive news article * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveNewsArticleAsyncWithHttpInfo($id) + public function archiveNewsArticleAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveNewsArticle'][0]) { $returnType = '\OpenAPI\Client\Model\NewsArticle'; - $request = $this->archiveNewsArticleRequest($id); + $request = $this->archiveNewsArticleRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveNewsArticle' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveNewsArticleRequest($id) + public function archiveNewsArticleRequest($id, string $contentType = self::contentTypes['archiveNewsArticle'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveNewsArticleRequest($id) ); } + $resourcePath = '/v2/news/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveNewsArticleRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveNewsArticleRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveNewsArticleRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveNewsArticleRequest($id) * Create news article * * @param \OpenAPI\Client\Model\WTNewsArticleCreateParams $wt_news_article_create_params wt_news_article_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNewsArticle'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\NewsArticle|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createNewsArticle($wt_news_article_create_params) + public function createNewsArticle($wt_news_article_create_params, string $contentType = self::contentTypes['createNewsArticle'][0]) { - list($response) = $this->createNewsArticleWithHttpInfo($wt_news_article_create_params); + list($response) = $this->createNewsArticleWithHttpInfo($wt_news_article_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createNewsArticle($wt_news_article_create_params) * Create news article * * @param \OpenAPI\Client\Model\WTNewsArticleCreateParams $wt_news_article_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNewsArticle'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\NewsArticle|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createNewsArticleWithHttpInfo($wt_news_article_create_params) + public function createNewsArticleWithHttpInfo($wt_news_article_create_params, string $contentType = self::contentTypes['createNewsArticle'][0]) { - $request = $this->createNewsArticleRequest($wt_news_article_create_params); + $request = $this->createNewsArticleRequest($wt_news_article_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createNewsArticleWithHttpInfo($wt_news_article_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\NewsArticle' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createNewsArticleWithHttpInfo($wt_news_article_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createNewsArticleWithHttpInfo($wt_news_article_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createNewsArticleWithHttpInfo($wt_news_article_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createNewsArticleWithHttpInfo($wt_news_article_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createNewsArticleWithHttpInfo($wt_news_article_create_params) * Create news article * * @param \OpenAPI\Client\Model\WTNewsArticleCreateParams $wt_news_article_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createNewsArticleAsync($wt_news_article_create_params) + public function createNewsArticleAsync($wt_news_article_create_params, string $contentType = self::contentTypes['createNewsArticle'][0]) { - return $this->createNewsArticleAsyncWithHttpInfo($wt_news_article_create_params) + return $this->createNewsArticleAsyncWithHttpInfo($wt_news_article_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create news article * * @param \OpenAPI\Client\Model\WTNewsArticleCreateParams $wt_news_article_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createNewsArticleAsyncWithHttpInfo($wt_news_article_create_params) + public function createNewsArticleAsyncWithHttpInfo($wt_news_article_create_params, string $contentType = self::contentTypes['createNewsArticle'][0]) { $returnType = '\OpenAPI\Client\Model\NewsArticle'; - $request = $this->createNewsArticleRequest($wt_news_article_create_params); + $request = $this->createNewsArticleRequest($wt_news_article_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createNewsArticle' * * @param \OpenAPI\Client\Model\WTNewsArticleCreateParams $wt_news_article_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createNewsArticleRequest($wt_news_article_create_params) + public function createNewsArticleRequest($wt_news_article_create_params, string $contentType = self::contentTypes['createNewsArticle'][0]) { + // verify the required parameter 'wt_news_article_create_params' is set if ($wt_news_article_create_params === null || (is_array($wt_news_article_create_params) && count($wt_news_article_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createNewsArticleRequest($wt_news_article_create_params) ); } + $resourcePath = '/v2/news'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createNewsArticleRequest($wt_news_article_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_news_article_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_news_article_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_news_article_create_params)); } else { $httpBody = $wt_news_article_create_params; } @@ -746,12 +927,12 @@ public function createNewsArticleRequest($wt_news_article_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createNewsArticleRequest($wt_news_article_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createNewsArticleRequest($wt_news_article_create_params) * Fetch all news articles * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllNewsArticles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllNewsArticles($is_archive_included = null) + public function fetchAllNewsArticles($is_archive_included = null, string $contentType = self::contentTypes['fetchAllNewsArticles'][0]) { - list($response) = $this->fetchAllNewsArticlesWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllNewsArticlesWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllNewsArticles($is_archive_included = null) * Fetch all news articles * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllNewsArticles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllNewsArticlesWithHttpInfo($is_archive_included = null) + public function fetchAllNewsArticlesWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllNewsArticles'][0]) { - $request = $this->fetchAllNewsArticlesRequest($is_archive_included); + $request = $this->fetchAllNewsArticlesRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllNewsArticlesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllNewsArticlesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllNewsArticlesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllNewsArticlesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllNewsArticlesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllNewsArticlesWithHttpInfo($is_archive_included = null) * Fetch all news articles * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllNewsArticles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllNewsArticlesAsync($is_archive_included = null) + public function fetchAllNewsArticlesAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllNewsArticles'][0]) { - return $this->fetchAllNewsArticlesAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllNewsArticlesAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all news articles * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllNewsArticles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllNewsArticlesAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllNewsArticlesAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllNewsArticles'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllNewsArticlesRequest($is_archive_included); + $request = $this->fetchAllNewsArticlesRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllNewsArticles' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllNewsArticles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllNewsArticlesRequest($is_archive_included = null) + public function fetchAllNewsArticlesRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllNewsArticles'][0]) { + + $resourcePath = '/v2/news/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllNewsArticlesRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllNewsArticlesRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllNewsArticlesRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllNewsArticlesRequest($is_archive_included = null) * Restore news article * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreNewsArticle'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\NewsArticle|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreNewsArticle($id) + public function restoreNewsArticle($id, string $contentType = self::contentTypes['restoreNewsArticle'][0]) { - list($response) = $this->restoreNewsArticleWithHttpInfo($id); + list($response) = $this->restoreNewsArticleWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restoreNewsArticle($id) * Restore news article * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreNewsArticle'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\NewsArticle|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreNewsArticleWithHttpInfo($id) + public function restoreNewsArticleWithHttpInfo($id, string $contentType = self::contentTypes['restoreNewsArticle'][0]) { - $request = $this->restoreNewsArticleRequest($id); + $request = $this->restoreNewsArticleRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restoreNewsArticleWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\NewsArticle' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restoreNewsArticleWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restoreNewsArticleWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restoreNewsArticleWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restoreNewsArticleWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restoreNewsArticleWithHttpInfo($id) * Restore news article * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreNewsArticleAsync($id) + public function restoreNewsArticleAsync($id, string $contentType = self::contentTypes['restoreNewsArticle'][0]) { - return $this->restoreNewsArticleAsyncWithHttpInfo($id) + return $this->restoreNewsArticleAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore news article * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreNewsArticleAsyncWithHttpInfo($id) + public function restoreNewsArticleAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreNewsArticle'][0]) { $returnType = '\OpenAPI\Client\Model\NewsArticle'; - $request = $this->restoreNewsArticleRequest($id); + $request = $this->restoreNewsArticleRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restoreNewsArticle' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreNewsArticleRequest($id) + public function restoreNewsArticleRequest($id, string $contentType = self::contentTypes['restoreNewsArticle'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restoreNewsArticleRequest($id) ); } + $resourcePath = '/v2/news/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restoreNewsArticleRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restoreNewsArticleRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restoreNewsArticleRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restoreNewsArticleRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTNewsArticleUpdateParams $wt_news_article_update_params wt_news_article_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNewsArticle'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\NewsArticle|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateNewsArticle($id, $wt_news_article_update_params) + public function updateNewsArticle($id, $wt_news_article_update_params, string $contentType = self::contentTypes['updateNewsArticle'][0]) { - list($response) = $this->updateNewsArticleWithHttpInfo($id, $wt_news_article_update_params); + list($response) = $this->updateNewsArticleWithHttpInfo($id, $wt_news_article_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateNewsArticle($id, $wt_news_article_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTNewsArticleUpdateParams $wt_news_article_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNewsArticle'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\NewsArticle|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateNewsArticleWithHttpInfo($id, $wt_news_article_update_params) + public function updateNewsArticleWithHttpInfo($id, $wt_news_article_update_params, string $contentType = self::contentTypes['updateNewsArticle'][0]) { - $request = $this->updateNewsArticleRequest($id, $wt_news_article_update_params); + $request = $this->updateNewsArticleRequest($id, $wt_news_article_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateNewsArticleWithHttpInfo($id, $wt_news_article_update_param $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\NewsArticle' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateNewsArticleWithHttpInfo($id, $wt_news_article_update_param $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateNewsArticleWithHttpInfo($id, $wt_news_article_update_param $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateNewsArticleWithHttpInfo($id, $wt_news_article_update_param $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateNewsArticleWithHttpInfo($id, $wt_news_article_update_param $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateNewsArticleWithHttpInfo($id, $wt_news_article_update_param * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTNewsArticleUpdateParams $wt_news_article_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateNewsArticleAsync($id, $wt_news_article_update_params) + public function updateNewsArticleAsync($id, $wt_news_article_update_params, string $contentType = self::contentTypes['updateNewsArticle'][0]) { - return $this->updateNewsArticleAsyncWithHttpInfo($id, $wt_news_article_update_params) + return $this->updateNewsArticleAsyncWithHttpInfo($id, $wt_news_article_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTNewsArticleUpdateParams $wt_news_article_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateNewsArticleAsyncWithHttpInfo($id, $wt_news_article_update_params) + public function updateNewsArticleAsyncWithHttpInfo($id, $wt_news_article_update_params, string $contentType = self::contentTypes['updateNewsArticle'][0]) { $returnType = '\OpenAPI\Client\Model\NewsArticle'; - $request = $this->updateNewsArticleRequest($id, $wt_news_article_update_params); + $request = $this->updateNewsArticleRequest($id, $wt_news_article_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTNewsArticleUpdateParams $wt_news_article_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateNewsArticle'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateNewsArticleRequest($id, $wt_news_article_update_params) + public function updateNewsArticleRequest($id, $wt_news_article_update_params, string $contentType = self::contentTypes['updateNewsArticle'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateNewsArticle' ); } + // verify the required parameter 'wt_news_article_update_params' is set if ($wt_news_article_update_params === null || (is_array($wt_news_article_update_params) && count($wt_news_article_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateNewsArticleRequest($id, $wt_news_article_update_params) ); } + $resourcePath = '/v2/news/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateNewsArticleRequest($id, $wt_news_article_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_news_article_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_news_article_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_news_article_update_params)); } else { $httpBody = $wt_news_article_update_params; } @@ -1753,12 +2177,12 @@ public function updateNewsArticleRequest($id, $wt_news_article_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateNewsArticleRequest($id, $wt_news_article_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/PaymentDesignsApi.php b/lib/Api/PaymentDesignsApi.php index 584bd30..d04d4b6 100644 --- a/lib/Api/PaymentDesignsApi.php +++ b/lib/Api/PaymentDesignsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createPaymentDesign' => [ + 'application/json', + ], + 'fetchAllPaymentDesigns' => [ + 'application/json', + ], + 'fetchPaymentDesignById' => [ + 'application/json', + ], + 'restorePaymentDesign' => [ + 'application/json', + ], + 'updatePaymentDesign' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +144,15 @@ public function getConfig() * Archive payment design * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTPaymentDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archivePaymentDesign($id) + public function archivePaymentDesign($id, string $contentType = self::contentTypes['archivePaymentDesign'][0]) { - list($response) = $this->archivePaymentDesignWithHttpInfo($id); + list($response) = $this->archivePaymentDesignWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +162,15 @@ public function archivePaymentDesign($id) * Archive payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTPaymentDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archivePaymentDesignWithHttpInfo($id) + public function archivePaymentDesignWithHttpInfo($id, string $contentType = self::contentTypes['archivePaymentDesign'][0]) { - $request = $this->archivePaymentDesignRequest($id); + $request = $this->archivePaymentDesignRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +213,21 @@ public function archivePaymentDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTPaymentDesign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +240,21 @@ public function archivePaymentDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +267,21 @@ public function archivePaymentDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +294,21 @@ public function archivePaymentDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +323,21 @@ public function archivePaymentDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +391,14 @@ public function archivePaymentDesignWithHttpInfo($id) * Archive payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePaymentDesignAsync($id) + public function archivePaymentDesignAsync($id, string $contentType = self::contentTypes['archivePaymentDesign'][0]) { - return $this->archivePaymentDesignAsyncWithHttpInfo($id) + return $this->archivePaymentDesignAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +412,15 @@ function ($response) { * Archive payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePaymentDesignAsyncWithHttpInfo($id) + public function archivePaymentDesignAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archivePaymentDesign'][0]) { $returnType = '\OpenAPI\Client\Model\WTPaymentDesign'; - $request = $this->archivePaymentDesignRequest($id); + $request = $this->archivePaymentDesignRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +430,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +462,14 @@ function ($exception) { * Create request for operation 'archivePaymentDesign' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archivePaymentDesignRequest($id) + public function archivePaymentDesignRequest($id, string $contentType = self::contentTypes['archivePaymentDesign'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +477,7 @@ public function archivePaymentDesignRequest($id) ); } + $resourcePath = '/v2/payment/design/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +497,11 @@ public function archivePaymentDesignRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +519,12 @@ public function archivePaymentDesignRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +540,11 @@ public function archivePaymentDesignRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +556,15 @@ public function archivePaymentDesignRequest($id) * Create payment design * * @param \OpenAPI\Client\Model\WTPaymentDesignCreateParams $wt_payment_design_create_params wt_payment_design_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTPaymentDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError */ - public function createPaymentDesign($wt_payment_design_create_params) + public function createPaymentDesign($wt_payment_design_create_params, string $contentType = self::contentTypes['createPaymentDesign'][0]) { - list($response) = $this->createPaymentDesignWithHttpInfo($wt_payment_design_create_params); + list($response) = $this->createPaymentDesignWithHttpInfo($wt_payment_design_create_params, $contentType); return $response; } @@ -470,14 +574,15 @@ public function createPaymentDesign($wt_payment_design_create_params) * Create payment design * * @param \OpenAPI\Client\Model\WTPaymentDesignCreateParams $wt_payment_design_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTPaymentDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createPaymentDesignWithHttpInfo($wt_payment_design_create_params) + public function createPaymentDesignWithHttpInfo($wt_payment_design_create_params, string $contentType = self::contentTypes['createPaymentDesign'][0]) { - $request = $this->createPaymentDesignRequest($wt_payment_design_create_params); + $request = $this->createPaymentDesignRequest($wt_payment_design_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +625,21 @@ public function createPaymentDesignWithHttpInfo($wt_payment_design_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTPaymentDesign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +652,21 @@ public function createPaymentDesignWithHttpInfo($wt_payment_design_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +679,21 @@ public function createPaymentDesignWithHttpInfo($wt_payment_design_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +706,21 @@ public function createPaymentDesignWithHttpInfo($wt_payment_design_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -568,6 +733,21 @@ public function createPaymentDesignWithHttpInfo($wt_payment_design_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantNotInitialized' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -580,6 +760,21 @@ public function createPaymentDesignWithHttpInfo($wt_payment_design_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -594,6 +789,21 @@ public function createPaymentDesignWithHttpInfo($wt_payment_design_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -663,13 +873,14 @@ public function createPaymentDesignWithHttpInfo($wt_payment_design_create_params * Create payment design * * @param \OpenAPI\Client\Model\WTPaymentDesignCreateParams $wt_payment_design_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPaymentDesignAsync($wt_payment_design_create_params) + public function createPaymentDesignAsync($wt_payment_design_create_params, string $contentType = self::contentTypes['createPaymentDesign'][0]) { - return $this->createPaymentDesignAsyncWithHttpInfo($wt_payment_design_create_params) + return $this->createPaymentDesignAsyncWithHttpInfo($wt_payment_design_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -683,14 +894,15 @@ function ($response) { * Create payment design * * @param \OpenAPI\Client\Model\WTPaymentDesignCreateParams $wt_payment_design_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPaymentDesignAsyncWithHttpInfo($wt_payment_design_create_params) + public function createPaymentDesignAsyncWithHttpInfo($wt_payment_design_create_params, string $contentType = self::contentTypes['createPaymentDesign'][0]) { $returnType = '\OpenAPI\Client\Model\WTPaymentDesign'; - $request = $this->createPaymentDesignRequest($wt_payment_design_create_params); + $request = $this->createPaymentDesignRequest($wt_payment_design_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -700,6 +912,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -729,12 +944,14 @@ function ($exception) { * Create request for operation 'createPaymentDesign' * * @param \OpenAPI\Client\Model\WTPaymentDesignCreateParams $wt_payment_design_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createPaymentDesignRequest($wt_payment_design_create_params) + public function createPaymentDesignRequest($wt_payment_design_create_params, string $contentType = self::contentTypes['createPaymentDesign'][0]) { + // verify the required parameter 'wt_payment_design_create_params' is set if ($wt_payment_design_create_params === null || (is_array($wt_payment_design_create_params) && count($wt_payment_design_create_params) === 0)) { throw new \InvalidArgumentException( @@ -742,6 +959,7 @@ public function createPaymentDesignRequest($wt_payment_design_create_params) ); } + $resourcePath = '/v2/payment/design'; $formParams = []; $queryParams = []; @@ -753,21 +971,17 @@ public function createPaymentDesignRequest($wt_payment_design_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_payment_design_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_payment_design_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_payment_design_create_params)); } else { $httpBody = $wt_payment_design_create_params; } @@ -786,12 +1000,12 @@ public function createPaymentDesignRequest($wt_payment_design_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -807,10 +1021,11 @@ public function createPaymentDesignRequest($wt_payment_design_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -822,14 +1037,15 @@ public function createPaymentDesignRequest($wt_payment_design_create_params) * Fetch all active payment designs * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPaymentDesigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTPaymentDesign[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllPaymentDesigns($is_archive_included = null) + public function fetchAllPaymentDesigns($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPaymentDesigns'][0]) { - list($response) = $this->fetchAllPaymentDesignsWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllPaymentDesignsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -839,14 +1055,15 @@ public function fetchAllPaymentDesigns($is_archive_included = null) * Fetch all active payment designs * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPaymentDesigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTPaymentDesign[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllPaymentDesignsWithHttpInfo($is_archive_included = null) + public function fetchAllPaymentDesignsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPaymentDesigns'][0]) { - $request = $this->fetchAllPaymentDesignsRequest($is_archive_included); + $request = $this->fetchAllPaymentDesignsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -889,6 +1106,21 @@ public function fetchAllPaymentDesignsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTPaymentDesign[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -901,6 +1133,21 @@ public function fetchAllPaymentDesignsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -913,6 +1160,21 @@ public function fetchAllPaymentDesignsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -925,6 +1187,21 @@ public function fetchAllPaymentDesignsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -939,6 +1216,21 @@ public function fetchAllPaymentDesignsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -992,13 +1284,14 @@ public function fetchAllPaymentDesignsWithHttpInfo($is_archive_included = null) * Fetch all active payment designs * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPaymentDesigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllPaymentDesignsAsync($is_archive_included = null) + public function fetchAllPaymentDesignsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPaymentDesigns'][0]) { - return $this->fetchAllPaymentDesignsAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllPaymentDesignsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -1012,14 +1305,15 @@ function ($response) { * Fetch all active payment designs * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPaymentDesigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllPaymentDesignsAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllPaymentDesignsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPaymentDesigns'][0]) { $returnType = '\OpenAPI\Client\Model\WTPaymentDesign[]'; - $request = $this->fetchAllPaymentDesignsRequest($is_archive_included); + $request = $this->fetchAllPaymentDesignsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1029,6 +1323,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1058,13 +1355,16 @@ function ($exception) { * Create request for operation 'fetchAllPaymentDesigns' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPaymentDesigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllPaymentDesignsRequest($is_archive_included = null) + public function fetchAllPaymentDesignsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPaymentDesigns'][0]) { + + $resourcePath = '/v2/payment/design/all'; $formParams = []; $queryParams = []; @@ -1073,30 +1373,23 @@ public function fetchAllPaymentDesignsRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1114,12 +1407,12 @@ public function fetchAllPaymentDesignsRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1135,10 +1428,11 @@ public function fetchAllPaymentDesignsRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1150,14 +1444,15 @@ public function fetchAllPaymentDesignsRequest($is_archive_included = null) * Fetch payment design * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPaymentDesignById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTPaymentDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchPaymentDesignById($id) + public function fetchPaymentDesignById($id, string $contentType = self::contentTypes['fetchPaymentDesignById'][0]) { - list($response) = $this->fetchPaymentDesignByIdWithHttpInfo($id); + list($response) = $this->fetchPaymentDesignByIdWithHttpInfo($id, $contentType); return $response; } @@ -1167,14 +1462,15 @@ public function fetchPaymentDesignById($id) * Fetch payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPaymentDesignById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTPaymentDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchPaymentDesignByIdWithHttpInfo($id) + public function fetchPaymentDesignByIdWithHttpInfo($id, string $contentType = self::contentTypes['fetchPaymentDesignById'][0]) { - $request = $this->fetchPaymentDesignByIdRequest($id); + $request = $this->fetchPaymentDesignByIdRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1217,6 +1513,21 @@ public function fetchPaymentDesignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTPaymentDesign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1229,6 +1540,21 @@ public function fetchPaymentDesignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1241,6 +1567,21 @@ public function fetchPaymentDesignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1253,6 +1594,21 @@ public function fetchPaymentDesignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1267,6 +1623,21 @@ public function fetchPaymentDesignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1320,13 +1691,14 @@ public function fetchPaymentDesignByIdWithHttpInfo($id) * Fetch payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPaymentDesignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPaymentDesignByIdAsync($id) + public function fetchPaymentDesignByIdAsync($id, string $contentType = self::contentTypes['fetchPaymentDesignById'][0]) { - return $this->fetchPaymentDesignByIdAsyncWithHttpInfo($id) + return $this->fetchPaymentDesignByIdAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1340,14 +1712,15 @@ function ($response) { * Fetch payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPaymentDesignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPaymentDesignByIdAsyncWithHttpInfo($id) + public function fetchPaymentDesignByIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchPaymentDesignById'][0]) { $returnType = '\OpenAPI\Client\Model\WTPaymentDesign'; - $request = $this->fetchPaymentDesignByIdRequest($id); + $request = $this->fetchPaymentDesignByIdRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1357,6 +1730,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1386,12 +1762,14 @@ function ($exception) { * Create request for operation 'fetchPaymentDesignById' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPaymentDesignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchPaymentDesignByIdRequest($id) + public function fetchPaymentDesignByIdRequest($id, string $contentType = self::contentTypes['fetchPaymentDesignById'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1399,6 +1777,7 @@ public function fetchPaymentDesignByIdRequest($id) ); } + $resourcePath = '/v2/payment/design/{id}'; $formParams = []; $queryParams = []; @@ -1418,16 +1797,11 @@ public function fetchPaymentDesignByIdRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1445,12 +1819,12 @@ public function fetchPaymentDesignByIdRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1466,10 +1840,11 @@ public function fetchPaymentDesignByIdRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1481,14 +1856,15 @@ public function fetchPaymentDesignByIdRequest($id) * Restore payment design * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTPaymentDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restorePaymentDesign($id) + public function restorePaymentDesign($id, string $contentType = self::contentTypes['restorePaymentDesign'][0]) { - list($response) = $this->restorePaymentDesignWithHttpInfo($id); + list($response) = $this->restorePaymentDesignWithHttpInfo($id, $contentType); return $response; } @@ -1498,14 +1874,15 @@ public function restorePaymentDesign($id) * Restore payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTPaymentDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restorePaymentDesignWithHttpInfo($id) + public function restorePaymentDesignWithHttpInfo($id, string $contentType = self::contentTypes['restorePaymentDesign'][0]) { - $request = $this->restorePaymentDesignRequest($id); + $request = $this->restorePaymentDesignRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1548,6 +1925,21 @@ public function restorePaymentDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTPaymentDesign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1952,21 @@ public function restorePaymentDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1572,6 +1979,21 @@ public function restorePaymentDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1584,6 +2006,21 @@ public function restorePaymentDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1598,6 +2035,21 @@ public function restorePaymentDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1651,13 +2103,14 @@ public function restorePaymentDesignWithHttpInfo($id) * Restore payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restorePaymentDesignAsync($id) + public function restorePaymentDesignAsync($id, string $contentType = self::contentTypes['restorePaymentDesign'][0]) { - return $this->restorePaymentDesignAsyncWithHttpInfo($id) + return $this->restorePaymentDesignAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1671,14 +2124,15 @@ function ($response) { * Restore payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restorePaymentDesignAsyncWithHttpInfo($id) + public function restorePaymentDesignAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restorePaymentDesign'][0]) { $returnType = '\OpenAPI\Client\Model\WTPaymentDesign'; - $request = $this->restorePaymentDesignRequest($id); + $request = $this->restorePaymentDesignRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1688,6 +2142,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1717,12 +2174,14 @@ function ($exception) { * Create request for operation 'restorePaymentDesign' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restorePaymentDesignRequest($id) + public function restorePaymentDesignRequest($id, string $contentType = self::contentTypes['restorePaymentDesign'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1730,6 +2189,7 @@ public function restorePaymentDesignRequest($id) ); } + $resourcePath = '/v2/payment/design/{id}'; $formParams = []; $queryParams = []; @@ -1749,16 +2209,11 @@ public function restorePaymentDesignRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1776,12 +2231,12 @@ public function restorePaymentDesignRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1797,10 +2252,11 @@ public function restorePaymentDesignRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1813,14 +2269,15 @@ public function restorePaymentDesignRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTPaymentDesignUpdateParams $wt_payment_design_update_params wt_payment_design_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTPaymentDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function updatePaymentDesign($id, $wt_payment_design_update_params) + public function updatePaymentDesign($id, $wt_payment_design_update_params, string $contentType = self::contentTypes['updatePaymentDesign'][0]) { - list($response) = $this->updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_params); + list($response) = $this->updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_params, $contentType); return $response; } @@ -1831,14 +2288,15 @@ public function updatePaymentDesign($id, $wt_payment_design_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPaymentDesignUpdateParams $wt_payment_design_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTPaymentDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_params) + public function updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_params, string $contentType = self::contentTypes['updatePaymentDesign'][0]) { - $request = $this->updatePaymentDesignRequest($id, $wt_payment_design_update_params); + $request = $this->updatePaymentDesignRequest($id, $wt_payment_design_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1881,6 +2339,21 @@ public function updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTPaymentDesign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1893,6 +2366,21 @@ public function updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1905,6 +2393,21 @@ public function updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1917,6 +2420,21 @@ public function updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1929,6 +2447,21 @@ public function updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1941,6 +2474,21 @@ public function updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1955,6 +2503,21 @@ public function updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2025,13 +2588,14 @@ public function updatePaymentDesignWithHttpInfo($id, $wt_payment_design_update_p * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPaymentDesignUpdateParams $wt_payment_design_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePaymentDesignAsync($id, $wt_payment_design_update_params) + public function updatePaymentDesignAsync($id, $wt_payment_design_update_params, string $contentType = self::contentTypes['updatePaymentDesign'][0]) { - return $this->updatePaymentDesignAsyncWithHttpInfo($id, $wt_payment_design_update_params) + return $this->updatePaymentDesignAsyncWithHttpInfo($id, $wt_payment_design_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -2046,14 +2610,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPaymentDesignUpdateParams $wt_payment_design_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePaymentDesignAsyncWithHttpInfo($id, $wt_payment_design_update_params) + public function updatePaymentDesignAsyncWithHttpInfo($id, $wt_payment_design_update_params, string $contentType = self::contentTypes['updatePaymentDesign'][0]) { $returnType = '\OpenAPI\Client\Model\WTPaymentDesign'; - $request = $this->updatePaymentDesignRequest($id, $wt_payment_design_update_params); + $request = $this->updatePaymentDesignRequest($id, $wt_payment_design_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2063,6 +2628,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2093,18 +2661,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPaymentDesignUpdateParams $wt_payment_design_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePaymentDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePaymentDesignRequest($id, $wt_payment_design_update_params) + public function updatePaymentDesignRequest($id, $wt_payment_design_update_params, string $contentType = self::contentTypes['updatePaymentDesign'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updatePaymentDesign' ); } + // verify the required parameter 'wt_payment_design_update_params' is set if ($wt_payment_design_update_params === null || (is_array($wt_payment_design_update_params) && count($wt_payment_design_update_params) === 0)) { throw new \InvalidArgumentException( @@ -2112,6 +2683,7 @@ public function updatePaymentDesignRequest($id, $wt_payment_design_update_params ); } + $resourcePath = '/v2/payment/design/{id}'; $formParams = []; $queryParams = []; @@ -2131,21 +2703,17 @@ public function updatePaymentDesignRequest($id, $wt_payment_design_update_params } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_payment_design_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_payment_design_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_payment_design_update_params)); } else { $httpBody = $wt_payment_design_update_params; } @@ -2164,12 +2732,12 @@ public function updatePaymentDesignRequest($id, $wt_payment_design_update_params // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2185,10 +2753,11 @@ public function updatePaymentDesignRequest($id, $wt_payment_design_update_params $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/PerformancesApi.php b/lib/Api/PerformancesApi.php index 1988799..dbac9cb 100644 --- a/lib/Api/PerformancesApi.php +++ b/lib/Api/PerformancesApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'countClaimedComps' => [ + 'application/json', + ], + 'countRedeemedComps' => [ + 'application/json', + ], + 'createPerformance' => [ + 'application/json', + ], + 'exportTickets' => [ + 'application/json', + ], + 'fetchAllPerformanceTickets' => [ + 'application/json', + ], + 'fetchAllPerformances' => [ + 'application/json', + ], + 'fetchPerformance' => [ + 'application/json', + ], + 'fetchPerformanceTicketsPage' => [ + 'application/json', + ], + 'importTickets' => [ + 'application/json', + ], + 'restorePerformance' => [ + 'application/json', + ], + 'saveTicketSettings' => [ + 'application/json', + ], + 'updatePerformance' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +165,15 @@ public function getConfig() * Archive performance * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePerformance'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archivePerformance($id) + public function archivePerformance($id, string $contentType = self::contentTypes['archivePerformance'][0]) { - list($response) = $this->archivePerformanceWithHttpInfo($id); + list($response) = $this->archivePerformanceWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +183,15 @@ public function archivePerformance($id) * Archive performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePerformance'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archivePerformanceWithHttpInfo($id) + public function archivePerformanceWithHttpInfo($id, string $contentType = self::contentTypes['archivePerformance'][0]) { - $request = $this->archivePerformanceRequest($id); + $request = $this->archivePerformanceRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +234,21 @@ public function archivePerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Performance' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +261,21 @@ public function archivePerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +288,21 @@ public function archivePerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +315,21 @@ public function archivePerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +344,21 @@ public function archivePerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +412,14 @@ public function archivePerformanceWithHttpInfo($id) * Archive performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePerformanceAsync($id) + public function archivePerformanceAsync($id, string $contentType = self::contentTypes['archivePerformance'][0]) { - return $this->archivePerformanceAsyncWithHttpInfo($id) + return $this->archivePerformanceAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +433,15 @@ function ($response) { * Archive performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePerformanceAsyncWithHttpInfo($id) + public function archivePerformanceAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archivePerformance'][0]) { $returnType = '\OpenAPI\Client\Model\Performance'; - $request = $this->archivePerformanceRequest($id); + $request = $this->archivePerformanceRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +451,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +483,14 @@ function ($exception) { * Create request for operation 'archivePerformance' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archivePerformanceRequest($id) + public function archivePerformanceRequest($id, string $contentType = self::contentTypes['archivePerformance'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +498,7 @@ public function archivePerformanceRequest($id) ); } + $resourcePath = '/v2/performances/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +518,11 @@ public function archivePerformanceRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +540,12 @@ public function archivePerformanceRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +561,11 @@ public function archivePerformanceRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +577,15 @@ public function archivePerformanceRequest($id) * Count number claimed * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countClaimedComps'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\CountClaimedComps200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countClaimedComps($id) + public function countClaimedComps($id, string $contentType = self::contentTypes['countClaimedComps'][0]) { - list($response) = $this->countClaimedCompsWithHttpInfo($id); + list($response) = $this->countClaimedCompsWithHttpInfo($id, $contentType); return $response; } @@ -470,14 +595,15 @@ public function countClaimedComps($id) * Count number claimed * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countClaimedComps'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\CountClaimedComps200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countClaimedCompsWithHttpInfo($id) + public function countClaimedCompsWithHttpInfo($id, string $contentType = self::contentTypes['countClaimedComps'][0]) { - $request = $this->countClaimedCompsRequest($id); + $request = $this->countClaimedCompsRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -516,14 +642,29 @@ public function countClaimedCompsWithHttpInfo($id) switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2003' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\CountClaimedComps200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CountClaimedComps200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2003', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CountClaimedComps200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -532,6 +673,21 @@ public function countClaimedCompsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +700,21 @@ public function countClaimedCompsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +727,21 @@ public function countClaimedCompsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -565,11 +751,26 @@ public function countClaimedCompsWithHttpInfo($id) ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; + $returnType = '\OpenAPI\Client\Model\CountClaimedComps200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -583,7 +784,7 @@ public function countClaimedCompsWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2003', + '\OpenAPI\Client\Model\CountClaimedComps200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -623,13 +824,14 @@ public function countClaimedCompsWithHttpInfo($id) * Count number claimed * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countClaimedComps'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countClaimedCompsAsync($id) + public function countClaimedCompsAsync($id, string $contentType = self::contentTypes['countClaimedComps'][0]) { - return $this->countClaimedCompsAsyncWithHttpInfo($id) + return $this->countClaimedCompsAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +845,15 @@ function ($response) { * Count number claimed * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countClaimedComps'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countClaimedCompsAsyncWithHttpInfo($id) + public function countClaimedCompsAsyncWithHttpInfo($id, string $contentType = self::contentTypes['countClaimedComps'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; - $request = $this->countClaimedCompsRequest($id); + $returnType = '\OpenAPI\Client\Model\CountClaimedComps200Response'; + $request = $this->countClaimedCompsRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +863,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +895,14 @@ function ($exception) { * Create request for operation 'countClaimedComps' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countClaimedComps'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countClaimedCompsRequest($id) + public function countClaimedCompsRequest($id, string $contentType = self::contentTypes['countClaimedComps'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +910,7 @@ public function countClaimedCompsRequest($id) ); } + $resourcePath = '/v2/performances/{id}/claimed/count'; $formParams = []; $queryParams = []; @@ -721,16 +930,11 @@ public function countClaimedCompsRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -748,12 +952,12 @@ public function countClaimedCompsRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -769,10 +973,11 @@ public function countClaimedCompsRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -784,14 +989,15 @@ public function countClaimedCompsRequest($id) * Count number redeemed * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countRedeemedComps'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\CountClaimedComps200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countRedeemedComps($id) + public function countRedeemedComps($id, string $contentType = self::contentTypes['countRedeemedComps'][0]) { - list($response) = $this->countRedeemedCompsWithHttpInfo($id); + list($response) = $this->countRedeemedCompsWithHttpInfo($id, $contentType); return $response; } @@ -801,14 +1007,15 @@ public function countRedeemedComps($id) * Count number redeemed * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countRedeemedComps'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\CountClaimedComps200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countRedeemedCompsWithHttpInfo($id) + public function countRedeemedCompsWithHttpInfo($id, string $contentType = self::contentTypes['countRedeemedComps'][0]) { - $request = $this->countRedeemedCompsRequest($id); + $request = $this->countRedeemedCompsRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -847,14 +1054,29 @@ public function countRedeemedCompsWithHttpInfo($id) switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2003' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\CountClaimedComps200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\CountClaimedComps200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2003', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\CountClaimedComps200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -863,6 +1085,21 @@ public function countRedeemedCompsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -875,6 +1112,21 @@ public function countRedeemedCompsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -887,6 +1139,21 @@ public function countRedeemedCompsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -896,11 +1163,26 @@ public function countRedeemedCompsWithHttpInfo($id) ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; + $returnType = '\OpenAPI\Client\Model\CountClaimedComps200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -914,7 +1196,7 @@ public function countRedeemedCompsWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2003', + '\OpenAPI\Client\Model\CountClaimedComps200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -954,13 +1236,14 @@ public function countRedeemedCompsWithHttpInfo($id) * Count number redeemed * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countRedeemedComps'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countRedeemedCompsAsync($id) + public function countRedeemedCompsAsync($id, string $contentType = self::contentTypes['countRedeemedComps'][0]) { - return $this->countRedeemedCompsAsyncWithHttpInfo($id) + return $this->countRedeemedCompsAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -974,14 +1257,15 @@ function ($response) { * Count number redeemed * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countRedeemedComps'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countRedeemedCompsAsyncWithHttpInfo($id) + public function countRedeemedCompsAsyncWithHttpInfo($id, string $contentType = self::contentTypes['countRedeemedComps'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; - $request = $this->countRedeemedCompsRequest($id); + $returnType = '\OpenAPI\Client\Model\CountClaimedComps200Response'; + $request = $this->countRedeemedCompsRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -991,6 +1275,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1020,12 +1307,14 @@ function ($exception) { * Create request for operation 'countRedeemedComps' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countRedeemedComps'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countRedeemedCompsRequest($id) + public function countRedeemedCompsRequest($id, string $contentType = self::contentTypes['countRedeemedComps'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1033,6 +1322,7 @@ public function countRedeemedCompsRequest($id) ); } + $resourcePath = '/v2/performances/{id}/redeemed/count'; $formParams = []; $queryParams = []; @@ -1052,16 +1342,11 @@ public function countRedeemedCompsRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1079,12 +1364,12 @@ public function countRedeemedCompsRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1100,10 +1385,11 @@ public function countRedeemedCompsRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1115,14 +1401,15 @@ public function countRedeemedCompsRequest($id) * Create performance * * @param \OpenAPI\Client\Model\WTPerformanceCreateParams $wt_performance_create_params wt_performance_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPerformance'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createPerformance($wt_performance_create_params) + public function createPerformance($wt_performance_create_params, string $contentType = self::contentTypes['createPerformance'][0]) { - list($response) = $this->createPerformanceWithHttpInfo($wt_performance_create_params); + list($response) = $this->createPerformanceWithHttpInfo($wt_performance_create_params, $contentType); return $response; } @@ -1132,14 +1419,15 @@ public function createPerformance($wt_performance_create_params) * Create performance * * @param \OpenAPI\Client\Model\WTPerformanceCreateParams $wt_performance_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPerformance'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createPerformanceWithHttpInfo($wt_performance_create_params) + public function createPerformanceWithHttpInfo($wt_performance_create_params, string $contentType = self::contentTypes['createPerformance'][0]) { - $request = $this->createPerformanceRequest($wt_performance_create_params); + $request = $this->createPerformanceRequest($wt_performance_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1182,6 +1470,21 @@ public function createPerformanceWithHttpInfo($wt_performance_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Performance' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1194,6 +1497,21 @@ public function createPerformanceWithHttpInfo($wt_performance_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1206,6 +1524,21 @@ public function createPerformanceWithHttpInfo($wt_performance_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1218,6 +1551,21 @@ public function createPerformanceWithHttpInfo($wt_performance_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1232,6 +1580,21 @@ public function createPerformanceWithHttpInfo($wt_performance_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1285,13 +1648,14 @@ public function createPerformanceWithHttpInfo($wt_performance_create_params) * Create performance * * @param \OpenAPI\Client\Model\WTPerformanceCreateParams $wt_performance_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPerformanceAsync($wt_performance_create_params) + public function createPerformanceAsync($wt_performance_create_params, string $contentType = self::contentTypes['createPerformance'][0]) { - return $this->createPerformanceAsyncWithHttpInfo($wt_performance_create_params) + return $this->createPerformanceAsyncWithHttpInfo($wt_performance_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1305,14 +1669,15 @@ function ($response) { * Create performance * * @param \OpenAPI\Client\Model\WTPerformanceCreateParams $wt_performance_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPerformanceAsyncWithHttpInfo($wt_performance_create_params) + public function createPerformanceAsyncWithHttpInfo($wt_performance_create_params, string $contentType = self::contentTypes['createPerformance'][0]) { $returnType = '\OpenAPI\Client\Model\Performance'; - $request = $this->createPerformanceRequest($wt_performance_create_params); + $request = $this->createPerformanceRequest($wt_performance_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1322,6 +1687,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1351,12 +1719,14 @@ function ($exception) { * Create request for operation 'createPerformance' * * @param \OpenAPI\Client\Model\WTPerformanceCreateParams $wt_performance_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createPerformanceRequest($wt_performance_create_params) + public function createPerformanceRequest($wt_performance_create_params, string $contentType = self::contentTypes['createPerformance'][0]) { + // verify the required parameter 'wt_performance_create_params' is set if ($wt_performance_create_params === null || (is_array($wt_performance_create_params) && count($wt_performance_create_params) === 0)) { throw new \InvalidArgumentException( @@ -1364,6 +1734,7 @@ public function createPerformanceRequest($wt_performance_create_params) ); } + $resourcePath = '/v2/performances'; $formParams = []; $queryParams = []; @@ -1375,21 +1746,17 @@ public function createPerformanceRequest($wt_performance_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_performance_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_performance_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_performance_create_params)); } else { $httpBody = $wt_performance_create_params; } @@ -1408,12 +1775,12 @@ public function createPerformanceRequest($wt_performance_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1429,10 +1796,11 @@ public function createPerformanceRequest($wt_performance_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1444,14 +1812,15 @@ public function createPerformanceRequest($wt_performance_create_params) * Update performance * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportTickets'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Ticket[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function exportTickets($id) + public function exportTickets($id, string $contentType = self::contentTypes['exportTickets'][0]) { - list($response) = $this->exportTicketsWithHttpInfo($id); + list($response) = $this->exportTicketsWithHttpInfo($id, $contentType); return $response; } @@ -1461,14 +1830,15 @@ public function exportTickets($id) * Update performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportTickets'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Ticket[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function exportTicketsWithHttpInfo($id) + public function exportTicketsWithHttpInfo($id, string $contentType = self::contentTypes['exportTickets'][0]) { - $request = $this->exportTicketsRequest($id); + $request = $this->exportTicketsRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1511,6 +1881,21 @@ public function exportTicketsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Ticket[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1523,6 +1908,21 @@ public function exportTicketsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1535,6 +1935,21 @@ public function exportTicketsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1547,6 +1962,21 @@ public function exportTicketsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1561,6 +1991,21 @@ public function exportTicketsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2059,14 @@ public function exportTicketsWithHttpInfo($id) * Update performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportTickets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportTicketsAsync($id) + public function exportTicketsAsync($id, string $contentType = self::contentTypes['exportTickets'][0]) { - return $this->exportTicketsAsyncWithHttpInfo($id) + return $this->exportTicketsAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1634,14 +2080,15 @@ function ($response) { * Update performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportTickets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportTicketsAsyncWithHttpInfo($id) + public function exportTicketsAsyncWithHttpInfo($id, string $contentType = self::contentTypes['exportTickets'][0]) { $returnType = '\OpenAPI\Client\Model\Ticket[]'; - $request = $this->exportTicketsRequest($id); + $request = $this->exportTicketsRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1651,6 +2098,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1680,12 +2130,14 @@ function ($exception) { * Create request for operation 'exportTickets' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportTickets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function exportTicketsRequest($id) + public function exportTicketsRequest($id, string $contentType = self::contentTypes['exportTickets'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1693,6 +2145,7 @@ public function exportTicketsRequest($id) ); } + $resourcePath = '/v2/performances/{id}/tickets/export'; $formParams = []; $queryParams = []; @@ -1712,16 +2165,11 @@ public function exportTicketsRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1739,12 +2187,12 @@ public function exportTicketsRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1760,10 +2208,11 @@ public function exportTicketsRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1776,14 +2225,15 @@ public function exportTicketsRequest($id) * * @param mixed $id id (required) * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPerformanceTickets'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Ticket[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllPerformanceTickets($id, $is_archive_included = null) + public function fetchAllPerformanceTickets($id, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllPerformanceTickets'][0]) { - list($response) = $this->fetchAllPerformanceTicketsWithHttpInfo($id, $is_archive_included); + list($response) = $this->fetchAllPerformanceTicketsWithHttpInfo($id, $is_archive_included, $contentType); return $response; } @@ -1794,14 +2244,15 @@ public function fetchAllPerformanceTickets($id, $is_archive_included = null) * * @param mixed $id (required) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPerformanceTickets'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Ticket[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllPerformanceTicketsWithHttpInfo($id, $is_archive_included = null) + public function fetchAllPerformanceTicketsWithHttpInfo($id, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllPerformanceTickets'][0]) { - $request = $this->fetchAllPerformanceTicketsRequest($id, $is_archive_included); + $request = $this->fetchAllPerformanceTicketsRequest($id, $is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -1844,6 +2295,21 @@ public function fetchAllPerformanceTicketsWithHttpInfo($id, $is_archive_included $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Ticket[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1856,6 +2322,21 @@ public function fetchAllPerformanceTicketsWithHttpInfo($id, $is_archive_included $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1868,6 +2349,21 @@ public function fetchAllPerformanceTicketsWithHttpInfo($id, $is_archive_included $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1880,6 +2376,21 @@ public function fetchAllPerformanceTicketsWithHttpInfo($id, $is_archive_included $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1894,6 +2405,21 @@ public function fetchAllPerformanceTicketsWithHttpInfo($id, $is_archive_included $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1948,13 +2474,14 @@ public function fetchAllPerformanceTicketsWithHttpInfo($id, $is_archive_included * * @param mixed $id (required) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPerformanceTickets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllPerformanceTicketsAsync($id, $is_archive_included = null) + public function fetchAllPerformanceTicketsAsync($id, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllPerformanceTickets'][0]) { - return $this->fetchAllPerformanceTicketsAsyncWithHttpInfo($id, $is_archive_included) + return $this->fetchAllPerformanceTicketsAsyncWithHttpInfo($id, $is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -1969,14 +2496,15 @@ function ($response) { * * @param mixed $id (required) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPerformanceTickets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllPerformanceTicketsAsyncWithHttpInfo($id, $is_archive_included = null) + public function fetchAllPerformanceTicketsAsyncWithHttpInfo($id, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllPerformanceTickets'][0]) { $returnType = '\OpenAPI\Client\Model\Ticket[]'; - $request = $this->fetchAllPerformanceTicketsRequest($id, $is_archive_included); + $request = $this->fetchAllPerformanceTicketsRequest($id, $is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1986,6 +2514,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2016,12 +2547,14 @@ function ($exception) { * * @param mixed $id (required) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPerformanceTickets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllPerformanceTicketsRequest($id, $is_archive_included = null) + public function fetchAllPerformanceTicketsRequest($id, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllPerformanceTickets'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -2029,6 +2562,8 @@ public function fetchAllPerformanceTicketsRequest($id, $is_archive_included = nu ); } + + $resourcePath = '/v2/performances/tickets/all/{id}'; $formParams = []; $queryParams = []; @@ -2037,16 +2572,14 @@ public function fetchAllPerformanceTicketsRequest($id, $is_archive_included = nu $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -2059,16 +2592,11 @@ public function fetchAllPerformanceTicketsRequest($id, $is_archive_included = nu } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2086,12 +2614,12 @@ public function fetchAllPerformanceTicketsRequest($id, $is_archive_included = nu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2107,10 +2635,11 @@ public function fetchAllPerformanceTicketsRequest($id, $is_archive_included = nu $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2122,14 +2651,15 @@ public function fetchAllPerformanceTicketsRequest($id, $is_archive_included = nu * Fetch all performances * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPerformances'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllPerformances($is_archive_included = null) + public function fetchAllPerformances($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPerformances'][0]) { - list($response) = $this->fetchAllPerformancesWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllPerformancesWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -2139,14 +2669,15 @@ public function fetchAllPerformances($is_archive_included = null) * Fetch all performances * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPerformances'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllPerformancesWithHttpInfo($is_archive_included = null) + public function fetchAllPerformancesWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPerformances'][0]) { - $request = $this->fetchAllPerformancesRequest($is_archive_included); + $request = $this->fetchAllPerformancesRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -2189,6 +2720,21 @@ public function fetchAllPerformancesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2201,6 +2747,21 @@ public function fetchAllPerformancesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2213,6 +2774,21 @@ public function fetchAllPerformancesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2225,6 +2801,21 @@ public function fetchAllPerformancesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2239,6 +2830,21 @@ public function fetchAllPerformancesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2292,13 +2898,14 @@ public function fetchAllPerformancesWithHttpInfo($is_archive_included = null) * Fetch all performances * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPerformances'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllPerformancesAsync($is_archive_included = null) + public function fetchAllPerformancesAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPerformances'][0]) { - return $this->fetchAllPerformancesAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllPerformancesAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -2312,14 +2919,15 @@ function ($response) { * Fetch all performances * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPerformances'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllPerformancesAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllPerformancesAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPerformances'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllPerformancesRequest($is_archive_included); + $request = $this->fetchAllPerformancesRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2329,6 +2937,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2358,13 +2969,16 @@ function ($exception) { * Create request for operation 'fetchAllPerformances' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPerformances'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllPerformancesRequest($is_archive_included = null) + public function fetchAllPerformancesRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPerformances'][0]) { + + $resourcePath = '/v2/performances/all'; $formParams = []; $queryParams = []; @@ -2373,30 +2987,23 @@ public function fetchAllPerformancesRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2414,12 +3021,12 @@ public function fetchAllPerformancesRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2435,10 +3042,11 @@ public function fetchAllPerformancesRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2450,14 +3058,15 @@ public function fetchAllPerformancesRequest($is_archive_included = null) * Fetch a single performance * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformance'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchPerformance($id) + public function fetchPerformance($id, string $contentType = self::contentTypes['fetchPerformance'][0]) { - list($response) = $this->fetchPerformanceWithHttpInfo($id); + list($response) = $this->fetchPerformanceWithHttpInfo($id, $contentType); return $response; } @@ -2467,14 +3076,15 @@ public function fetchPerformance($id) * Fetch a single performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformance'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchPerformanceWithHttpInfo($id) + public function fetchPerformanceWithHttpInfo($id, string $contentType = self::contentTypes['fetchPerformance'][0]) { - $request = $this->fetchPerformanceRequest($id); + $request = $this->fetchPerformanceRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2517,6 +3127,21 @@ public function fetchPerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Performance' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2529,6 +3154,21 @@ public function fetchPerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2541,6 +3181,21 @@ public function fetchPerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2553,6 +3208,21 @@ public function fetchPerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2567,6 +3237,21 @@ public function fetchPerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2620,13 +3305,14 @@ public function fetchPerformanceWithHttpInfo($id) * Fetch a single performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPerformanceAsync($id) + public function fetchPerformanceAsync($id, string $contentType = self::contentTypes['fetchPerformance'][0]) { - return $this->fetchPerformanceAsyncWithHttpInfo($id) + return $this->fetchPerformanceAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -2640,14 +3326,15 @@ function ($response) { * Fetch a single performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPerformanceAsyncWithHttpInfo($id) + public function fetchPerformanceAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchPerformance'][0]) { $returnType = '\OpenAPI\Client\Model\Performance'; - $request = $this->fetchPerformanceRequest($id); + $request = $this->fetchPerformanceRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2657,6 +3344,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2686,12 +3376,14 @@ function ($exception) { * Create request for operation 'fetchPerformance' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchPerformanceRequest($id) + public function fetchPerformanceRequest($id, string $contentType = self::contentTypes['fetchPerformance'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -2699,6 +3391,7 @@ public function fetchPerformanceRequest($id) ); } + $resourcePath = '/v2/performances/{id}'; $formParams = []; $queryParams = []; @@ -2718,16 +3411,11 @@ public function fetchPerformanceRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2745,12 +3433,12 @@ public function fetchPerformanceRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2766,10 +3454,11 @@ public function fetchPerformanceRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2781,19 +3470,22 @@ public function fetchPerformanceRequest($id) * Fetch tickets by page * * @param mixed $performance_id performance_id (required) - * @param double $page_num page_num (required) - * @param double $page_size page_size (required) + * @param float $page_num page_num (required) + * @param float $page_size page_size (required) * @param bool $filter_comps filter_comps (optional) * @param bool $filter_claimed filter_claimed (optional) + * @param mixed $sort_by sort_by (optional) + * @param mixed $sort_direction sort_direction (optional) * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformanceTicketsPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2004|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchPerformanceTicketsPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchPerformanceTicketsPage($performance_id, $page_num, $page_size, $filter_comps = null, $filter_claimed = null, $is_archive_included = null) + public function fetchPerformanceTicketsPage($performance_id, $page_num, $page_size, $filter_comps = null, $filter_claimed = null, $sort_by = null, $sort_direction = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchPerformanceTicketsPage'][0]) { - list($response) = $this->fetchPerformanceTicketsPageWithHttpInfo($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $is_archive_included); + list($response) = $this->fetchPerformanceTicketsPageWithHttpInfo($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $sort_by, $sort_direction, $is_archive_included, $contentType); return $response; } @@ -2803,19 +3495,22 @@ public function fetchPerformanceTicketsPage($performance_id, $page_num, $page_si * Fetch tickets by page * * @param mixed $performance_id (required) - * @param double $page_num (required) - * @param double $page_size (required) + * @param float $page_num (required) + * @param float $page_size (required) * @param bool $filter_comps (optional) * @param bool $filter_claimed (optional) + * @param mixed $sort_by (optional) + * @param mixed $sort_direction (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformanceTicketsPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2004|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchPerformanceTicketsPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchPerformanceTicketsPageWithHttpInfo($performance_id, $page_num, $page_size, $filter_comps = null, $filter_claimed = null, $is_archive_included = null) + public function fetchPerformanceTicketsPageWithHttpInfo($performance_id, $page_num, $page_size, $filter_comps = null, $filter_claimed = null, $sort_by = null, $sort_direction = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchPerformanceTicketsPage'][0]) { - $request = $this->fetchPerformanceTicketsPageRequest($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $is_archive_included); + $request = $this->fetchPerformanceTicketsPageRequest($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $sort_by, $sort_direction, $is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -2854,14 +3549,29 @@ public function fetchPerformanceTicketsPageWithHttpInfo($performance_id, $page_n switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2004' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchPerformanceTicketsPage200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchPerformanceTicketsPage200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2004', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchPerformanceTicketsPage200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2870,6 +3580,21 @@ public function fetchPerformanceTicketsPageWithHttpInfo($performance_id, $page_n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2882,6 +3607,21 @@ public function fetchPerformanceTicketsPageWithHttpInfo($performance_id, $page_n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2894,6 +3634,21 @@ public function fetchPerformanceTicketsPageWithHttpInfo($performance_id, $page_n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2903,11 +3658,26 @@ public function fetchPerformanceTicketsPageWithHttpInfo($performance_id, $page_n ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2004'; + $returnType = '\OpenAPI\Client\Model\FetchPerformanceTicketsPage200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2921,7 +3691,7 @@ public function fetchPerformanceTicketsPageWithHttpInfo($performance_id, $page_n case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2004', + '\OpenAPI\Client\Model\FetchPerformanceTicketsPage200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2961,18 +3731,21 @@ public function fetchPerformanceTicketsPageWithHttpInfo($performance_id, $page_n * Fetch tickets by page * * @param mixed $performance_id (required) - * @param double $page_num (required) - * @param double $page_size (required) + * @param float $page_num (required) + * @param float $page_size (required) * @param bool $filter_comps (optional) * @param bool $filter_claimed (optional) + * @param mixed $sort_by (optional) + * @param mixed $sort_direction (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformanceTicketsPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPerformanceTicketsPageAsync($performance_id, $page_num, $page_size, $filter_comps = null, $filter_claimed = null, $is_archive_included = null) + public function fetchPerformanceTicketsPageAsync($performance_id, $page_num, $page_size, $filter_comps = null, $filter_claimed = null, $sort_by = null, $sort_direction = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchPerformanceTicketsPage'][0]) { - return $this->fetchPerformanceTicketsPageAsyncWithHttpInfo($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $is_archive_included) + return $this->fetchPerformanceTicketsPageAsyncWithHttpInfo($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $sort_by, $sort_direction, $is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -2986,19 +3759,22 @@ function ($response) { * Fetch tickets by page * * @param mixed $performance_id (required) - * @param double $page_num (required) - * @param double $page_size (required) + * @param float $page_num (required) + * @param float $page_size (required) * @param bool $filter_comps (optional) * @param bool $filter_claimed (optional) + * @param mixed $sort_by (optional) + * @param mixed $sort_direction (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformanceTicketsPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPerformanceTicketsPageAsyncWithHttpInfo($performance_id, $page_num, $page_size, $filter_comps = null, $filter_claimed = null, $is_archive_included = null) + public function fetchPerformanceTicketsPageAsyncWithHttpInfo($performance_id, $page_num, $page_size, $filter_comps = null, $filter_claimed = null, $sort_by = null, $sort_direction = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchPerformanceTicketsPage'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2004'; - $request = $this->fetchPerformanceTicketsPageRequest($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $is_archive_included); + $returnType = '\OpenAPI\Client\Model\FetchPerformanceTicketsPage200Response'; + $request = $this->fetchPerformanceTicketsPageRequest($performance_id, $page_num, $page_size, $filter_comps, $filter_claimed, $sort_by, $sort_direction, $is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3008,6 +3784,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3037,29 +3816,35 @@ function ($exception) { * Create request for operation 'fetchPerformanceTicketsPage' * * @param mixed $performance_id (required) - * @param double $page_num (required) - * @param double $page_size (required) + * @param float $page_num (required) + * @param float $page_size (required) * @param bool $filter_comps (optional) * @param bool $filter_claimed (optional) + * @param mixed $sort_by (optional) + * @param mixed $sort_direction (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformanceTicketsPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchPerformanceTicketsPageRequest($performance_id, $page_num, $page_size, $filter_comps = null, $filter_claimed = null, $is_archive_included = null) + public function fetchPerformanceTicketsPageRequest($performance_id, $page_num, $page_size, $filter_comps = null, $filter_claimed = null, $sort_by = null, $sort_direction = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchPerformanceTicketsPage'][0]) { + // verify the required parameter 'performance_id' is set if ($performance_id === null || (is_array($performance_id) && count($performance_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $performance_id when calling fetchPerformanceTicketsPage' ); } + // verify the required parameter 'page_num' is set if ($page_num === null || (is_array($page_num) && count($page_num) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $page_num when calling fetchPerformanceTicketsPage' ); } + // verify the required parameter 'page_size' is set if ($page_size === null || (is_array($page_size) && count($page_size) === 0)) { throw new \InvalidArgumentException( @@ -3067,6 +3852,12 @@ public function fetchPerformanceTicketsPageRequest($performance_id, $page_num, $ ); } + + + + + + $resourcePath = '/v2/performances/tickets/page/{performanceID}'; $formParams = []; $queryParams = []; @@ -3075,60 +3866,68 @@ public function fetchPerformanceTicketsPageRequest($performance_id, $page_num, $ $multipart = false; // query params - if ($page_num !== null) { - if('form' === 'form' && is_array($page_num)) { - foreach($page_num as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageNum'] = $page_num; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_num, + 'pageNum', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($page_size !== null) { - if('form' === 'form' && is_array($page_size)) { - foreach($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageSize'] = $page_size; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($filter_comps !== null) { - if('form' === 'form' && is_array($filter_comps)) { - foreach($filter_comps as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['filterComps'] = $filter_comps; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter_comps, + 'filterComps', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($filter_claimed !== null) { - if('form' === 'form' && is_array($filter_claimed)) { - foreach($filter_claimed as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['filterClaimed'] = $filter_claimed; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $filter_claimed, + 'filterClaimed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort_by, + 'sortBy', // param base name + 'mixed', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $sort_direction, + 'sortDirection', // param base name + 'mixed', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -3141,16 +3940,11 @@ public function fetchPerformanceTicketsPageRequest($performance_id, $page_num, $ } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3168,12 +3962,12 @@ public function fetchPerformanceTicketsPageRequest($performance_id, $page_num, $ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3189,10 +3983,11 @@ public function fetchPerformanceTicketsPageRequest($performance_id, $page_num, $ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3204,15 +3999,16 @@ public function fetchPerformanceTicketsPageRequest($performance_id, $page_num, $ * Update performance * * @param mixed $id id (required) - * @param \OpenAPI\Client\Model\InlineObject2 $inline_object2 inline_object2 (required) + * @param \OpenAPI\Client\Model\ImportTicketsRequest $import_tickets_request import_tickets_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importTickets'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function importTickets($id, $inline_object2) + public function importTickets($id, $import_tickets_request, string $contentType = self::contentTypes['importTickets'][0]) { - list($response) = $this->importTicketsWithHttpInfo($id, $inline_object2); + list($response) = $this->importTicketsWithHttpInfo($id, $import_tickets_request, $contentType); return $response; } @@ -3222,15 +4018,16 @@ public function importTickets($id, $inline_object2) * Update performance * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject2 $inline_object2 (required) + * @param \OpenAPI\Client\Model\ImportTicketsRequest $import_tickets_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importTickets'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function importTicketsWithHttpInfo($id, $inline_object2) + public function importTicketsWithHttpInfo($id, $import_tickets_request, string $contentType = self::contentTypes['importTickets'][0]) { - $request = $this->importTicketsRequest($id, $inline_object2); + $request = $this->importTicketsRequest($id, $import_tickets_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3273,6 +4070,21 @@ public function importTicketsWithHttpInfo($id, $inline_object2) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3285,6 +4097,21 @@ public function importTicketsWithHttpInfo($id, $inline_object2) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3297,6 +4124,21 @@ public function importTicketsWithHttpInfo($id, $inline_object2) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3309,6 +4151,21 @@ public function importTicketsWithHttpInfo($id, $inline_object2) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3323,6 +4180,21 @@ public function importTicketsWithHttpInfo($id, $inline_object2) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3376,14 +4248,15 @@ public function importTicketsWithHttpInfo($id, $inline_object2) * Update performance * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject2 $inline_object2 (required) + * @param \OpenAPI\Client\Model\ImportTicketsRequest $import_tickets_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importTickets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importTicketsAsync($id, $inline_object2) + public function importTicketsAsync($id, $import_tickets_request, string $contentType = self::contentTypes['importTickets'][0]) { - return $this->importTicketsAsyncWithHttpInfo($id, $inline_object2) + return $this->importTicketsAsyncWithHttpInfo($id, $import_tickets_request, $contentType) ->then( function ($response) { return $response[0]; @@ -3397,15 +4270,16 @@ function ($response) { * Update performance * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject2 $inline_object2 (required) + * @param \OpenAPI\Client\Model\ImportTicketsRequest $import_tickets_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importTickets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importTicketsAsyncWithHttpInfo($id, $inline_object2) + public function importTicketsAsyncWithHttpInfo($id, $import_tickets_request, string $contentType = self::contentTypes['importTickets'][0]) { $returnType = 'string'; - $request = $this->importTicketsRequest($id, $inline_object2); + $request = $this->importTicketsRequest($id, $import_tickets_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3415,6 +4289,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3444,26 +4321,30 @@ function ($exception) { * Create request for operation 'importTickets' * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject2 $inline_object2 (required) + * @param \OpenAPI\Client\Model\ImportTicketsRequest $import_tickets_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importTickets'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function importTicketsRequest($id, $inline_object2) + public function importTicketsRequest($id, $import_tickets_request, string $contentType = self::contentTypes['importTickets'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling importTickets' ); } - // verify the required parameter 'inline_object2' is set - if ($inline_object2 === null || (is_array($inline_object2) && count($inline_object2) === 0)) { + + // verify the required parameter 'import_tickets_request' is set + if ($import_tickets_request === null || (is_array($import_tickets_request) && count($import_tickets_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $inline_object2 when calling importTickets' + 'Missing the required parameter $import_tickets_request when calling importTickets' ); } + $resourcePath = '/v2/performances/{id}/tickets/import'; $formParams = []; $queryParams = []; @@ -3483,23 +4364,19 @@ public function importTicketsRequest($id, $inline_object2) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($inline_object2)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($inline_object2)); + if (isset($import_tickets_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($import_tickets_request)); } else { - $httpBody = $inline_object2; + $httpBody = $import_tickets_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3516,12 +4393,12 @@ public function importTicketsRequest($id, $inline_object2) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3537,10 +4414,11 @@ public function importTicketsRequest($id, $inline_object2) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3552,14 +4430,15 @@ public function importTicketsRequest($id, $inline_object2) * Restore performance * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePerformance'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restorePerformance($id) + public function restorePerformance($id, string $contentType = self::contentTypes['restorePerformance'][0]) { - list($response) = $this->restorePerformanceWithHttpInfo($id); + list($response) = $this->restorePerformanceWithHttpInfo($id, $contentType); return $response; } @@ -3569,14 +4448,15 @@ public function restorePerformance($id) * Restore performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePerformance'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restorePerformanceWithHttpInfo($id) + public function restorePerformanceWithHttpInfo($id, string $contentType = self::contentTypes['restorePerformance'][0]) { - $request = $this->restorePerformanceRequest($id); + $request = $this->restorePerformanceRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3619,6 +4499,21 @@ public function restorePerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Performance' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3631,6 +4526,21 @@ public function restorePerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3643,6 +4553,21 @@ public function restorePerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3655,6 +4580,21 @@ public function restorePerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3669,6 +4609,21 @@ public function restorePerformanceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3722,13 +4677,14 @@ public function restorePerformanceWithHttpInfo($id) * Restore performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restorePerformanceAsync($id) + public function restorePerformanceAsync($id, string $contentType = self::contentTypes['restorePerformance'][0]) { - return $this->restorePerformanceAsyncWithHttpInfo($id) + return $this->restorePerformanceAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -3742,14 +4698,15 @@ function ($response) { * Restore performance * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restorePerformanceAsyncWithHttpInfo($id) + public function restorePerformanceAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restorePerformance'][0]) { $returnType = '\OpenAPI\Client\Model\Performance'; - $request = $this->restorePerformanceRequest($id); + $request = $this->restorePerformanceRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3759,6 +4716,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3788,12 +4748,14 @@ function ($exception) { * Create request for operation 'restorePerformance' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restorePerformanceRequest($id) + public function restorePerformanceRequest($id, string $contentType = self::contentTypes['restorePerformance'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -3801,6 +4763,7 @@ public function restorePerformanceRequest($id) ); } + $resourcePath = '/v2/performances/{id}'; $formParams = []; $queryParams = []; @@ -3820,16 +4783,11 @@ public function restorePerformanceRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3847,12 +4805,12 @@ public function restorePerformanceRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3868,10 +4826,11 @@ public function restorePerformanceRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3883,15 +4842,16 @@ public function restorePerformanceRequest($id) * Update performance * * @param mixed $id id (required) - * @param \OpenAPI\Client\Model\InlineObject1 $inline_object1 inline_object1 (required) + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequest $save_ticket_settings_request save_ticket_settings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveTicketSettings'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function saveTicketSettings($id, $inline_object1) + public function saveTicketSettings($id, $save_ticket_settings_request, string $contentType = self::contentTypes['saveTicketSettings'][0]) { - list($response) = $this->saveTicketSettingsWithHttpInfo($id, $inline_object1); + list($response) = $this->saveTicketSettingsWithHttpInfo($id, $save_ticket_settings_request, $contentType); return $response; } @@ -3901,15 +4861,16 @@ public function saveTicketSettings($id, $inline_object1) * Update performance * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject1 $inline_object1 (required) + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequest $save_ticket_settings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveTicketSettings'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function saveTicketSettingsWithHttpInfo($id, $inline_object1) + public function saveTicketSettingsWithHttpInfo($id, $save_ticket_settings_request, string $contentType = self::contentTypes['saveTicketSettings'][0]) { - $request = $this->saveTicketSettingsRequest($id, $inline_object1); + $request = $this->saveTicketSettingsRequest($id, $save_ticket_settings_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -3952,6 +4913,21 @@ public function saveTicketSettingsWithHttpInfo($id, $inline_object1) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Performance' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3964,6 +4940,21 @@ public function saveTicketSettingsWithHttpInfo($id, $inline_object1) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3976,6 +4967,21 @@ public function saveTicketSettingsWithHttpInfo($id, $inline_object1) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3988,6 +4994,21 @@ public function saveTicketSettingsWithHttpInfo($id, $inline_object1) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4002,6 +5023,21 @@ public function saveTicketSettingsWithHttpInfo($id, $inline_object1) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4055,14 +5091,15 @@ public function saveTicketSettingsWithHttpInfo($id, $inline_object1) * Update performance * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject1 $inline_object1 (required) + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequest $save_ticket_settings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveTicketSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveTicketSettingsAsync($id, $inline_object1) + public function saveTicketSettingsAsync($id, $save_ticket_settings_request, string $contentType = self::contentTypes['saveTicketSettings'][0]) { - return $this->saveTicketSettingsAsyncWithHttpInfo($id, $inline_object1) + return $this->saveTicketSettingsAsyncWithHttpInfo($id, $save_ticket_settings_request, $contentType) ->then( function ($response) { return $response[0]; @@ -4076,15 +5113,16 @@ function ($response) { * Update performance * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject1 $inline_object1 (required) + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequest $save_ticket_settings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveTicketSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveTicketSettingsAsyncWithHttpInfo($id, $inline_object1) + public function saveTicketSettingsAsyncWithHttpInfo($id, $save_ticket_settings_request, string $contentType = self::contentTypes['saveTicketSettings'][0]) { $returnType = '\OpenAPI\Client\Model\Performance'; - $request = $this->saveTicketSettingsRequest($id, $inline_object1); + $request = $this->saveTicketSettingsRequest($id, $save_ticket_settings_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4094,6 +5132,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4123,26 +5164,30 @@ function ($exception) { * Create request for operation 'saveTicketSettings' * * @param mixed $id (required) - * @param \OpenAPI\Client\Model\InlineObject1 $inline_object1 (required) + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequest $save_ticket_settings_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveTicketSettings'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function saveTicketSettingsRequest($id, $inline_object1) + public function saveTicketSettingsRequest($id, $save_ticket_settings_request, string $contentType = self::contentTypes['saveTicketSettings'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling saveTicketSettings' ); } - // verify the required parameter 'inline_object1' is set - if ($inline_object1 === null || (is_array($inline_object1) && count($inline_object1) === 0)) { + + // verify the required parameter 'save_ticket_settings_request' is set + if ($save_ticket_settings_request === null || (is_array($save_ticket_settings_request) && count($save_ticket_settings_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $inline_object1 when calling saveTicketSettings' + 'Missing the required parameter $save_ticket_settings_request when calling saveTicketSettings' ); } + $resourcePath = '/v2/performances/{id}'; $formParams = []; $queryParams = []; @@ -4162,23 +5207,19 @@ public function saveTicketSettingsRequest($id, $inline_object1) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) - if (isset($inline_object1)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($inline_object1)); + if (isset($save_ticket_settings_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($save_ticket_settings_request)); } else { - $httpBody = $inline_object1; + $httpBody = $save_ticket_settings_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -4195,12 +5236,12 @@ public function saveTicketSettingsRequest($id, $inline_object1) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4216,10 +5257,11 @@ public function saveTicketSettingsRequest($id, $inline_object1) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4232,14 +5274,15 @@ public function saveTicketSettingsRequest($id, $inline_object1) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTPerformanceUpdateParams $wt_performance_update_params wt_performance_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePerformance'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updatePerformance($id, $wt_performance_update_params) + public function updatePerformance($id, $wt_performance_update_params, string $contentType = self::contentTypes['updatePerformance'][0]) { - list($response) = $this->updatePerformanceWithHttpInfo($id, $wt_performance_update_params); + list($response) = $this->updatePerformanceWithHttpInfo($id, $wt_performance_update_params, $contentType); return $response; } @@ -4250,14 +5293,15 @@ public function updatePerformance($id, $wt_performance_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPerformanceUpdateParams $wt_performance_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePerformance'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Performance|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updatePerformanceWithHttpInfo($id, $wt_performance_update_params) + public function updatePerformanceWithHttpInfo($id, $wt_performance_update_params, string $contentType = self::contentTypes['updatePerformance'][0]) { - $request = $this->updatePerformanceRequest($id, $wt_performance_update_params); + $request = $this->updatePerformanceRequest($id, $wt_performance_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -4300,6 +5344,21 @@ public function updatePerformanceWithHttpInfo($id, $wt_performance_update_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Performance' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4312,6 +5371,21 @@ public function updatePerformanceWithHttpInfo($id, $wt_performance_update_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4324,6 +5398,21 @@ public function updatePerformanceWithHttpInfo($id, $wt_performance_update_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4336,6 +5425,21 @@ public function updatePerformanceWithHttpInfo($id, $wt_performance_update_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4350,6 +5454,21 @@ public function updatePerformanceWithHttpInfo($id, $wt_performance_update_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4404,13 +5523,14 @@ public function updatePerformanceWithHttpInfo($id, $wt_performance_update_params * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPerformanceUpdateParams $wt_performance_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePerformanceAsync($id, $wt_performance_update_params) + public function updatePerformanceAsync($id, $wt_performance_update_params, string $contentType = self::contentTypes['updatePerformance'][0]) { - return $this->updatePerformanceAsyncWithHttpInfo($id, $wt_performance_update_params) + return $this->updatePerformanceAsyncWithHttpInfo($id, $wt_performance_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -4425,14 +5545,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPerformanceUpdateParams $wt_performance_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePerformanceAsyncWithHttpInfo($id, $wt_performance_update_params) + public function updatePerformanceAsyncWithHttpInfo($id, $wt_performance_update_params, string $contentType = self::contentTypes['updatePerformance'][0]) { $returnType = '\OpenAPI\Client\Model\Performance'; - $request = $this->updatePerformanceRequest($id, $wt_performance_update_params); + $request = $this->updatePerformanceRequest($id, $wt_performance_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4442,6 +5563,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4472,18 +5596,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPerformanceUpdateParams $wt_performance_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePerformance'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePerformanceRequest($id, $wt_performance_update_params) + public function updatePerformanceRequest($id, $wt_performance_update_params, string $contentType = self::contentTypes['updatePerformance'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updatePerformance' ); } + // verify the required parameter 'wt_performance_update_params' is set if ($wt_performance_update_params === null || (is_array($wt_performance_update_params) && count($wt_performance_update_params) === 0)) { throw new \InvalidArgumentException( @@ -4491,6 +5618,7 @@ public function updatePerformanceRequest($id, $wt_performance_update_params) ); } + $resourcePath = '/v2/performances/{id}'; $formParams = []; $queryParams = []; @@ -4510,21 +5638,17 @@ public function updatePerformanceRequest($id, $wt_performance_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_performance_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_performance_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_performance_update_params)); } else { $httpBody = $wt_performance_update_params; } @@ -4543,12 +5667,12 @@ public function updatePerformanceRequest($id, $wt_performance_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4564,10 +5688,11 @@ public function updatePerformanceRequest($id, $wt_performance_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/ProductsApi.php b/lib/Api/ProductsApi.php index fe6b397..0bd9998 100644 --- a/lib/Api/ProductsApi.php +++ b/lib/Api/ProductsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createProduct' => [ + 'application/json', + ], + 'fetchAllProducts' => [ + 'application/json', + ], + 'restoreProduct' => [ + 'application/json', + ], + 'updateProduct' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive product * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveProduct'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Product|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveProduct($id) + public function archiveProduct($id, string $contentType = self::contentTypes['archiveProduct'][0]) { - list($response) = $this->archiveProductWithHttpInfo($id); + list($response) = $this->archiveProductWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveProduct($id) * Archive product * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveProduct'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Product|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveProductWithHttpInfo($id) + public function archiveProductWithHttpInfo($id, string $contentType = self::contentTypes['archiveProduct'][0]) { - $request = $this->archiveProductRequest($id); + $request = $this->archiveProductRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveProductWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Product' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveProductWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveProductWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveProductWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveProductWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveProductWithHttpInfo($id) * Archive product * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveProductAsync($id) + public function archiveProductAsync($id, string $contentType = self::contentTypes['archiveProduct'][0]) { - return $this->archiveProductAsyncWithHttpInfo($id) + return $this->archiveProductAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive product * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveProductAsyncWithHttpInfo($id) + public function archiveProductAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveProduct'][0]) { $returnType = '\OpenAPI\Client\Model\Product'; - $request = $this->archiveProductRequest($id); + $request = $this->archiveProductRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveProduct' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveProductRequest($id) + public function archiveProductRequest($id, string $contentType = self::contentTypes['archiveProduct'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveProductRequest($id) ); } + $resourcePath = '/v2/products/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveProductRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveProductRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveProductRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveProductRequest($id) * Create product * * @param \OpenAPI\Client\Model\WTProductCreateParams $wt_product_create_params wt_product_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProduct'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Product|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createProduct($wt_product_create_params) + public function createProduct($wt_product_create_params, string $contentType = self::contentTypes['createProduct'][0]) { - list($response) = $this->createProductWithHttpInfo($wt_product_create_params); + list($response) = $this->createProductWithHttpInfo($wt_product_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createProduct($wt_product_create_params) * Create product * * @param \OpenAPI\Client\Model\WTProductCreateParams $wt_product_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProduct'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Product|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createProductWithHttpInfo($wt_product_create_params) + public function createProductWithHttpInfo($wt_product_create_params, string $contentType = self::contentTypes['createProduct'][0]) { - $request = $this->createProductRequest($wt_product_create_params); + $request = $this->createProductRequest($wt_product_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createProductWithHttpInfo($wt_product_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Product' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createProductWithHttpInfo($wt_product_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createProductWithHttpInfo($wt_product_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createProductWithHttpInfo($wt_product_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createProductWithHttpInfo($wt_product_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createProductWithHttpInfo($wt_product_create_params) * Create product * * @param \OpenAPI\Client\Model\WTProductCreateParams $wt_product_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createProductAsync($wt_product_create_params) + public function createProductAsync($wt_product_create_params, string $contentType = self::contentTypes['createProduct'][0]) { - return $this->createProductAsyncWithHttpInfo($wt_product_create_params) + return $this->createProductAsyncWithHttpInfo($wt_product_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create product * * @param \OpenAPI\Client\Model\WTProductCreateParams $wt_product_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createProductAsyncWithHttpInfo($wt_product_create_params) + public function createProductAsyncWithHttpInfo($wt_product_create_params, string $contentType = self::contentTypes['createProduct'][0]) { $returnType = '\OpenAPI\Client\Model\Product'; - $request = $this->createProductRequest($wt_product_create_params); + $request = $this->createProductRequest($wt_product_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createProduct' * * @param \OpenAPI\Client\Model\WTProductCreateParams $wt_product_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createProductRequest($wt_product_create_params) + public function createProductRequest($wt_product_create_params, string $contentType = self::contentTypes['createProduct'][0]) { + // verify the required parameter 'wt_product_create_params' is set if ($wt_product_create_params === null || (is_array($wt_product_create_params) && count($wt_product_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createProductRequest($wt_product_create_params) ); } + $resourcePath = '/v2/products'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createProductRequest($wt_product_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_product_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_product_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_product_create_params)); } else { $httpBody = $wt_product_create_params; } @@ -746,12 +927,12 @@ public function createProductRequest($wt_product_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createProductRequest($wt_product_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createProductRequest($wt_product_create_params) * Fetch all products * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllProducts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllProducts($is_archive_included = null) + public function fetchAllProducts($is_archive_included = null, string $contentType = self::contentTypes['fetchAllProducts'][0]) { - list($response) = $this->fetchAllProductsWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllProductsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllProducts($is_archive_included = null) * Fetch all products * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllProducts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllProductsWithHttpInfo($is_archive_included = null) + public function fetchAllProductsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllProducts'][0]) { - $request = $this->fetchAllProductsRequest($is_archive_included); + $request = $this->fetchAllProductsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllProductsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllProductsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllProductsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllProductsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllProductsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllProductsWithHttpInfo($is_archive_included = null) * Fetch all products * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllProducts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllProductsAsync($is_archive_included = null) + public function fetchAllProductsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllProducts'][0]) { - return $this->fetchAllProductsAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllProductsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all products * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllProducts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllProductsAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllProductsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllProducts'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllProductsRequest($is_archive_included); + $request = $this->fetchAllProductsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllProducts' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllProducts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllProductsRequest($is_archive_included = null) + public function fetchAllProductsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllProducts'][0]) { + + $resourcePath = '/v2/products/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllProductsRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllProductsRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllProductsRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllProductsRequest($is_archive_included = null) * Restore product * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreProduct'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Product|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreProduct($id) + public function restoreProduct($id, string $contentType = self::contentTypes['restoreProduct'][0]) { - list($response) = $this->restoreProductWithHttpInfo($id); + list($response) = $this->restoreProductWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restoreProduct($id) * Restore product * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreProduct'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Product|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreProductWithHttpInfo($id) + public function restoreProductWithHttpInfo($id, string $contentType = self::contentTypes['restoreProduct'][0]) { - $request = $this->restoreProductRequest($id); + $request = $this->restoreProductRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restoreProductWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Product' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restoreProductWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restoreProductWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restoreProductWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restoreProductWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restoreProductWithHttpInfo($id) * Restore product * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreProductAsync($id) + public function restoreProductAsync($id, string $contentType = self::contentTypes['restoreProduct'][0]) { - return $this->restoreProductAsyncWithHttpInfo($id) + return $this->restoreProductAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore product * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreProductAsyncWithHttpInfo($id) + public function restoreProductAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreProduct'][0]) { $returnType = '\OpenAPI\Client\Model\Product'; - $request = $this->restoreProductRequest($id); + $request = $this->restoreProductRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restoreProduct' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreProductRequest($id) + public function restoreProductRequest($id, string $contentType = self::contentTypes['restoreProduct'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restoreProductRequest($id) ); } + $resourcePath = '/v2/products/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restoreProductRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restoreProductRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restoreProductRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restoreProductRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTProductUpdateParams $wt_product_update_params wt_product_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProduct'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Product|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateProduct($id, $wt_product_update_params) + public function updateProduct($id, $wt_product_update_params, string $contentType = self::contentTypes['updateProduct'][0]) { - list($response) = $this->updateProductWithHttpInfo($id, $wt_product_update_params); + list($response) = $this->updateProductWithHttpInfo($id, $wt_product_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateProduct($id, $wt_product_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTProductUpdateParams $wt_product_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProduct'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Product|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateProductWithHttpInfo($id, $wt_product_update_params) + public function updateProductWithHttpInfo($id, $wt_product_update_params, string $contentType = self::contentTypes['updateProduct'][0]) { - $request = $this->updateProductRequest($id, $wt_product_update_params); + $request = $this->updateProductRequest($id, $wt_product_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateProductWithHttpInfo($id, $wt_product_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Product' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateProductWithHttpInfo($id, $wt_product_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateProductWithHttpInfo($id, $wt_product_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateProductWithHttpInfo($id, $wt_product_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateProductWithHttpInfo($id, $wt_product_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateProductWithHttpInfo($id, $wt_product_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTProductUpdateParams $wt_product_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateProductAsync($id, $wt_product_update_params) + public function updateProductAsync($id, $wt_product_update_params, string $contentType = self::contentTypes['updateProduct'][0]) { - return $this->updateProductAsyncWithHttpInfo($id, $wt_product_update_params) + return $this->updateProductAsyncWithHttpInfo($id, $wt_product_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTProductUpdateParams $wt_product_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateProductAsyncWithHttpInfo($id, $wt_product_update_params) + public function updateProductAsyncWithHttpInfo($id, $wt_product_update_params, string $contentType = self::contentTypes['updateProduct'][0]) { $returnType = '\OpenAPI\Client\Model\Product'; - $request = $this->updateProductRequest($id, $wt_product_update_params); + $request = $this->updateProductRequest($id, $wt_product_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTProductUpdateParams $wt_product_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateProduct'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateProductRequest($id, $wt_product_update_params) + public function updateProductRequest($id, $wt_product_update_params, string $contentType = self::contentTypes['updateProduct'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateProduct' ); } + // verify the required parameter 'wt_product_update_params' is set if ($wt_product_update_params === null || (is_array($wt_product_update_params) && count($wt_product_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateProductRequest($id, $wt_product_update_params) ); } + $resourcePath = '/v2/products/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateProductRequest($id, $wt_product_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_product_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_product_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_product_update_params)); } else { $httpBody = $wt_product_update_params; } @@ -1753,12 +2177,12 @@ public function updateProductRequest($id, $wt_product_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateProductRequest($id, $wt_product_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/PromotionCodesApi.php b/lib/Api/PromotionCodesApi.php index 589bbf5..242d852 100644 --- a/lib/Api/PromotionCodesApi.php +++ b/lib/Api/PromotionCodesApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createPromoCode' => [ + 'application/json', + ], + 'fetchAllPromoCodes' => [ + 'application/json', + ], + 'restorePromoCode' => [ + 'application/json', + ], + 'updatePromoCode' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive promo code * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePromoCode'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PromoCode|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archivePromoCode($id) + public function archivePromoCode($id, string $contentType = self::contentTypes['archivePromoCode'][0]) { - list($response) = $this->archivePromoCodeWithHttpInfo($id); + list($response) = $this->archivePromoCodeWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archivePromoCode($id) * Archive promo code * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePromoCode'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PromoCode|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archivePromoCodeWithHttpInfo($id) + public function archivePromoCodeWithHttpInfo($id, string $contentType = self::contentTypes['archivePromoCode'][0]) { - $request = $this->archivePromoCodeRequest($id); + $request = $this->archivePromoCodeRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archivePromoCodeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PromoCode' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archivePromoCodeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archivePromoCodeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archivePromoCodeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archivePromoCodeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archivePromoCodeWithHttpInfo($id) * Archive promo code * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePromoCodeAsync($id) + public function archivePromoCodeAsync($id, string $contentType = self::contentTypes['archivePromoCode'][0]) { - return $this->archivePromoCodeAsyncWithHttpInfo($id) + return $this->archivePromoCodeAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive promo code * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePromoCodeAsyncWithHttpInfo($id) + public function archivePromoCodeAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archivePromoCode'][0]) { $returnType = '\OpenAPI\Client\Model\PromoCode'; - $request = $this->archivePromoCodeRequest($id); + $request = $this->archivePromoCodeRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archivePromoCode' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archivePromoCodeRequest($id) + public function archivePromoCodeRequest($id, string $contentType = self::contentTypes['archivePromoCode'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archivePromoCodeRequest($id) ); } + $resourcePath = '/v2/promoCodes/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archivePromoCodeRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archivePromoCodeRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archivePromoCodeRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archivePromoCodeRequest($id) * Create promo code * * @param \OpenAPI\Client\Model\WTPromoCodeCreateParams $wt_promo_code_create_params wt_promo_code_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPromoCode'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PromoCode|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createPromoCode($wt_promo_code_create_params) + public function createPromoCode($wt_promo_code_create_params, string $contentType = self::contentTypes['createPromoCode'][0]) { - list($response) = $this->createPromoCodeWithHttpInfo($wt_promo_code_create_params); + list($response) = $this->createPromoCodeWithHttpInfo($wt_promo_code_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createPromoCode($wt_promo_code_create_params) * Create promo code * * @param \OpenAPI\Client\Model\WTPromoCodeCreateParams $wt_promo_code_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPromoCode'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PromoCode|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createPromoCodeWithHttpInfo($wt_promo_code_create_params) + public function createPromoCodeWithHttpInfo($wt_promo_code_create_params, string $contentType = self::contentTypes['createPromoCode'][0]) { - $request = $this->createPromoCodeRequest($wt_promo_code_create_params); + $request = $this->createPromoCodeRequest($wt_promo_code_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createPromoCodeWithHttpInfo($wt_promo_code_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PromoCode' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createPromoCodeWithHttpInfo($wt_promo_code_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createPromoCodeWithHttpInfo($wt_promo_code_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createPromoCodeWithHttpInfo($wt_promo_code_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createPromoCodeWithHttpInfo($wt_promo_code_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createPromoCodeWithHttpInfo($wt_promo_code_create_params) * Create promo code * * @param \OpenAPI\Client\Model\WTPromoCodeCreateParams $wt_promo_code_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPromoCodeAsync($wt_promo_code_create_params) + public function createPromoCodeAsync($wt_promo_code_create_params, string $contentType = self::contentTypes['createPromoCode'][0]) { - return $this->createPromoCodeAsyncWithHttpInfo($wt_promo_code_create_params) + return $this->createPromoCodeAsyncWithHttpInfo($wt_promo_code_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create promo code * * @param \OpenAPI\Client\Model\WTPromoCodeCreateParams $wt_promo_code_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createPromoCodeAsyncWithHttpInfo($wt_promo_code_create_params) + public function createPromoCodeAsyncWithHttpInfo($wt_promo_code_create_params, string $contentType = self::contentTypes['createPromoCode'][0]) { $returnType = '\OpenAPI\Client\Model\PromoCode'; - $request = $this->createPromoCodeRequest($wt_promo_code_create_params); + $request = $this->createPromoCodeRequest($wt_promo_code_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createPromoCode' * * @param \OpenAPI\Client\Model\WTPromoCodeCreateParams $wt_promo_code_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createPromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createPromoCodeRequest($wt_promo_code_create_params) + public function createPromoCodeRequest($wt_promo_code_create_params, string $contentType = self::contentTypes['createPromoCode'][0]) { + // verify the required parameter 'wt_promo_code_create_params' is set if ($wt_promo_code_create_params === null || (is_array($wt_promo_code_create_params) && count($wt_promo_code_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createPromoCodeRequest($wt_promo_code_create_params) ); } + $resourcePath = '/v2/promoCodes'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createPromoCodeRequest($wt_promo_code_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_promo_code_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_promo_code_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_promo_code_create_params)); } else { $httpBody = $wt_promo_code_create_params; } @@ -746,12 +927,12 @@ public function createPromoCodeRequest($wt_promo_code_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createPromoCodeRequest($wt_promo_code_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createPromoCodeRequest($wt_promo_code_create_params) * Fetch all promo codes * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPromoCodes'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllPromoCodes($is_archive_included = null) + public function fetchAllPromoCodes($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPromoCodes'][0]) { - list($response) = $this->fetchAllPromoCodesWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllPromoCodesWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllPromoCodes($is_archive_included = null) * Fetch all promo codes * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPromoCodes'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllPromoCodesWithHttpInfo($is_archive_included = null) + public function fetchAllPromoCodesWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPromoCodes'][0]) { - $request = $this->fetchAllPromoCodesRequest($is_archive_included); + $request = $this->fetchAllPromoCodesRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllPromoCodesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllPromoCodesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllPromoCodesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllPromoCodesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllPromoCodesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllPromoCodesWithHttpInfo($is_archive_included = null) * Fetch all promo codes * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPromoCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllPromoCodesAsync($is_archive_included = null) + public function fetchAllPromoCodesAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPromoCodes'][0]) { - return $this->fetchAllPromoCodesAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllPromoCodesAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all promo codes * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPromoCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllPromoCodesAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllPromoCodesAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPromoCodes'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllPromoCodesRequest($is_archive_included); + $request = $this->fetchAllPromoCodesRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllPromoCodes' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllPromoCodes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllPromoCodesRequest($is_archive_included = null) + public function fetchAllPromoCodesRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllPromoCodes'][0]) { + + $resourcePath = '/v2/promoCodes/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllPromoCodesRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllPromoCodesRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllPromoCodesRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllPromoCodesRequest($is_archive_included = null) * Restore promo code * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePromoCode'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PromoCode|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restorePromoCode($id) + public function restorePromoCode($id, string $contentType = self::contentTypes['restorePromoCode'][0]) { - list($response) = $this->restorePromoCodeWithHttpInfo($id); + list($response) = $this->restorePromoCodeWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restorePromoCode($id) * Restore promo code * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePromoCode'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PromoCode|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restorePromoCodeWithHttpInfo($id) + public function restorePromoCodeWithHttpInfo($id, string $contentType = self::contentTypes['restorePromoCode'][0]) { - $request = $this->restorePromoCodeRequest($id); + $request = $this->restorePromoCodeRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restorePromoCodeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PromoCode' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restorePromoCodeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restorePromoCodeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restorePromoCodeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restorePromoCodeWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restorePromoCodeWithHttpInfo($id) * Restore promo code * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restorePromoCodeAsync($id) + public function restorePromoCodeAsync($id, string $contentType = self::contentTypes['restorePromoCode'][0]) { - return $this->restorePromoCodeAsyncWithHttpInfo($id) + return $this->restorePromoCodeAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore promo code * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restorePromoCodeAsyncWithHttpInfo($id) + public function restorePromoCodeAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restorePromoCode'][0]) { $returnType = '\OpenAPI\Client\Model\PromoCode'; - $request = $this->restorePromoCodeRequest($id); + $request = $this->restorePromoCodeRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restorePromoCode' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restorePromoCodeRequest($id) + public function restorePromoCodeRequest($id, string $contentType = self::contentTypes['restorePromoCode'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restorePromoCodeRequest($id) ); } + $resourcePath = '/v2/promoCodes/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restorePromoCodeRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restorePromoCodeRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restorePromoCodeRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restorePromoCodeRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTPromoCodeUpdateParams $wt_promo_code_update_params wt_promo_code_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoCode'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PromoCode|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updatePromoCode($id, $wt_promo_code_update_params) + public function updatePromoCode($id, $wt_promo_code_update_params, string $contentType = self::contentTypes['updatePromoCode'][0]) { - list($response) = $this->updatePromoCodeWithHttpInfo($id, $wt_promo_code_update_params); + list($response) = $this->updatePromoCodeWithHttpInfo($id, $wt_promo_code_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updatePromoCode($id, $wt_promo_code_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPromoCodeUpdateParams $wt_promo_code_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoCode'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PromoCode|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updatePromoCodeWithHttpInfo($id, $wt_promo_code_update_params) + public function updatePromoCodeWithHttpInfo($id, $wt_promo_code_update_params, string $contentType = self::contentTypes['updatePromoCode'][0]) { - $request = $this->updatePromoCodeRequest($id, $wt_promo_code_update_params); + $request = $this->updatePromoCodeRequest($id, $wt_promo_code_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updatePromoCodeWithHttpInfo($id, $wt_promo_code_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PromoCode' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updatePromoCodeWithHttpInfo($id, $wt_promo_code_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updatePromoCodeWithHttpInfo($id, $wt_promo_code_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updatePromoCodeWithHttpInfo($id, $wt_promo_code_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updatePromoCodeWithHttpInfo($id, $wt_promo_code_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updatePromoCodeWithHttpInfo($id, $wt_promo_code_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPromoCodeUpdateParams $wt_promo_code_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePromoCodeAsync($id, $wt_promo_code_update_params) + public function updatePromoCodeAsync($id, $wt_promo_code_update_params, string $contentType = self::contentTypes['updatePromoCode'][0]) { - return $this->updatePromoCodeAsyncWithHttpInfo($id, $wt_promo_code_update_params) + return $this->updatePromoCodeAsyncWithHttpInfo($id, $wt_promo_code_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPromoCodeUpdateParams $wt_promo_code_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePromoCodeAsyncWithHttpInfo($id, $wt_promo_code_update_params) + public function updatePromoCodeAsyncWithHttpInfo($id, $wt_promo_code_update_params, string $contentType = self::contentTypes['updatePromoCode'][0]) { $returnType = '\OpenAPI\Client\Model\PromoCode'; - $request = $this->updatePromoCodeRequest($id, $wt_promo_code_update_params); + $request = $this->updatePromoCodeRequest($id, $wt_promo_code_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTPromoCodeUpdateParams $wt_promo_code_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePromoCode'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePromoCodeRequest($id, $wt_promo_code_update_params) + public function updatePromoCodeRequest($id, $wt_promo_code_update_params, string $contentType = self::contentTypes['updatePromoCode'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updatePromoCode' ); } + // verify the required parameter 'wt_promo_code_update_params' is set if ($wt_promo_code_update_params === null || (is_array($wt_promo_code_update_params) && count($wt_promo_code_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updatePromoCodeRequest($id, $wt_promo_code_update_params) ); } + $resourcePath = '/v2/promoCodes/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updatePromoCodeRequest($id, $wt_promo_code_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_promo_code_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_promo_code_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_promo_code_update_params)); } else { $httpBody = $wt_promo_code_update_params; } @@ -1753,12 +2177,12 @@ public function updatePromoCodeRequest($id, $wt_promo_code_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updatePromoCodeRequest($id, $wt_promo_code_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/QRCodeDesignsApi.php b/lib/Api/QRCodeDesignsApi.php index 33adc06..1148cd0 100644 --- a/lib/Api/QRCodeDesignsApi.php +++ b/lib/Api/QRCodeDesignsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createQRCodeDesign' => [ + 'application/json', + ], + 'fetchAllQRCodeDesigns' => [ + 'application/json', + ], + 'fetchQRCodeDesignById' => [ + 'application/json', + ], + 'restoreQRCodeDesign' => [ + 'application/json', + ], + 'updateQRCodeDesign' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +144,15 @@ public function getConfig() * Archive QR Code Design * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveQRCodeDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTQRCodeDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveQRCodeDesign($id) + public function archiveQRCodeDesign($id, string $contentType = self::contentTypes['archiveQRCodeDesign'][0]) { - list($response) = $this->archiveQRCodeDesignWithHttpInfo($id); + list($response) = $this->archiveQRCodeDesignWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +162,15 @@ public function archiveQRCodeDesign($id) * Archive QR Code Design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveQRCodeDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTQRCodeDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveQRCodeDesignWithHttpInfo($id) + public function archiveQRCodeDesignWithHttpInfo($id, string $contentType = self::contentTypes['archiveQRCodeDesign'][0]) { - $request = $this->archiveQRCodeDesignRequest($id); + $request = $this->archiveQRCodeDesignRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +213,21 @@ public function archiveQRCodeDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTQRCodeDesign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +240,21 @@ public function archiveQRCodeDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +267,21 @@ public function archiveQRCodeDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +294,21 @@ public function archiveQRCodeDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +323,21 @@ public function archiveQRCodeDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +391,14 @@ public function archiveQRCodeDesignWithHttpInfo($id) * Archive QR Code Design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveQRCodeDesignAsync($id) + public function archiveQRCodeDesignAsync($id, string $contentType = self::contentTypes['archiveQRCodeDesign'][0]) { - return $this->archiveQRCodeDesignAsyncWithHttpInfo($id) + return $this->archiveQRCodeDesignAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +412,15 @@ function ($response) { * Archive QR Code Design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveQRCodeDesignAsyncWithHttpInfo($id) + public function archiveQRCodeDesignAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveQRCodeDesign'][0]) { $returnType = '\OpenAPI\Client\Model\WTQRCodeDesign'; - $request = $this->archiveQRCodeDesignRequest($id); + $request = $this->archiveQRCodeDesignRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +430,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +462,14 @@ function ($exception) { * Create request for operation 'archiveQRCodeDesign' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveQRCodeDesignRequest($id) + public function archiveQRCodeDesignRequest($id, string $contentType = self::contentTypes['archiveQRCodeDesign'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +477,7 @@ public function archiveQRCodeDesignRequest($id) ); } + $resourcePath = '/v2/qrcodedesign/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +497,11 @@ public function archiveQRCodeDesignRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +519,12 @@ public function archiveQRCodeDesignRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +540,11 @@ public function archiveQRCodeDesignRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +556,15 @@ public function archiveQRCodeDesignRequest($id) * Create QR Code design * * @param \OpenAPI\Client\Model\WTQRCodeDesignCreateParams $wtqr_code_design_create_params wtqr_code_design_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createQRCodeDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTQRCodeDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError */ - public function createQRCodeDesign($wtqr_code_design_create_params) + public function createQRCodeDesign($wtqr_code_design_create_params, string $contentType = self::contentTypes['createQRCodeDesign'][0]) { - list($response) = $this->createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params); + list($response) = $this->createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params, $contentType); return $response; } @@ -470,14 +574,15 @@ public function createQRCodeDesign($wtqr_code_design_create_params) * Create QR Code design * * @param \OpenAPI\Client\Model\WTQRCodeDesignCreateParams $wtqr_code_design_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createQRCodeDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTQRCodeDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params) + public function createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params, string $contentType = self::contentTypes['createQRCodeDesign'][0]) { - $request = $this->createQRCodeDesignRequest($wtqr_code_design_create_params); + $request = $this->createQRCodeDesignRequest($wtqr_code_design_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +625,21 @@ public function createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTQRCodeDesign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +652,21 @@ public function createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +679,21 @@ public function createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +706,21 @@ public function createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -568,6 +733,21 @@ public function createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantNotInitialized' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -580,6 +760,21 @@ public function createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -594,6 +789,21 @@ public function createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -663,13 +873,14 @@ public function createQRCodeDesignWithHttpInfo($wtqr_code_design_create_params) * Create QR Code design * * @param \OpenAPI\Client\Model\WTQRCodeDesignCreateParams $wtqr_code_design_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createQRCodeDesignAsync($wtqr_code_design_create_params) + public function createQRCodeDesignAsync($wtqr_code_design_create_params, string $contentType = self::contentTypes['createQRCodeDesign'][0]) { - return $this->createQRCodeDesignAsyncWithHttpInfo($wtqr_code_design_create_params) + return $this->createQRCodeDesignAsyncWithHttpInfo($wtqr_code_design_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -683,14 +894,15 @@ function ($response) { * Create QR Code design * * @param \OpenAPI\Client\Model\WTQRCodeDesignCreateParams $wtqr_code_design_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createQRCodeDesignAsyncWithHttpInfo($wtqr_code_design_create_params) + public function createQRCodeDesignAsyncWithHttpInfo($wtqr_code_design_create_params, string $contentType = self::contentTypes['createQRCodeDesign'][0]) { $returnType = '\OpenAPI\Client\Model\WTQRCodeDesign'; - $request = $this->createQRCodeDesignRequest($wtqr_code_design_create_params); + $request = $this->createQRCodeDesignRequest($wtqr_code_design_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -700,6 +912,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -729,12 +944,14 @@ function ($exception) { * Create request for operation 'createQRCodeDesign' * * @param \OpenAPI\Client\Model\WTQRCodeDesignCreateParams $wtqr_code_design_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createQRCodeDesignRequest($wtqr_code_design_create_params) + public function createQRCodeDesignRequest($wtqr_code_design_create_params, string $contentType = self::contentTypes['createQRCodeDesign'][0]) { + // verify the required parameter 'wtqr_code_design_create_params' is set if ($wtqr_code_design_create_params === null || (is_array($wtqr_code_design_create_params) && count($wtqr_code_design_create_params) === 0)) { throw new \InvalidArgumentException( @@ -742,6 +959,7 @@ public function createQRCodeDesignRequest($wtqr_code_design_create_params) ); } + $resourcePath = '/v2/qrcodedesign'; $formParams = []; $queryParams = []; @@ -753,21 +971,17 @@ public function createQRCodeDesignRequest($wtqr_code_design_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wtqr_code_design_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wtqr_code_design_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wtqr_code_design_create_params)); } else { $httpBody = $wtqr_code_design_create_params; } @@ -786,12 +1000,12 @@ public function createQRCodeDesignRequest($wtqr_code_design_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -807,10 +1021,11 @@ public function createQRCodeDesignRequest($wtqr_code_design_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -822,14 +1037,15 @@ public function createQRCodeDesignRequest($wtqr_code_design_create_params) * Fetch all active QR Code Designs * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllQRCodeDesigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTQRCodeDesign[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllQRCodeDesigns($is_archive_included = null) + public function fetchAllQRCodeDesigns($is_archive_included = null, string $contentType = self::contentTypes['fetchAllQRCodeDesigns'][0]) { - list($response) = $this->fetchAllQRCodeDesignsWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllQRCodeDesignsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -839,14 +1055,15 @@ public function fetchAllQRCodeDesigns($is_archive_included = null) * Fetch all active QR Code Designs * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllQRCodeDesigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTQRCodeDesign[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllQRCodeDesignsWithHttpInfo($is_archive_included = null) + public function fetchAllQRCodeDesignsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllQRCodeDesigns'][0]) { - $request = $this->fetchAllQRCodeDesignsRequest($is_archive_included); + $request = $this->fetchAllQRCodeDesignsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -889,6 +1106,21 @@ public function fetchAllQRCodeDesignsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTQRCodeDesign[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -901,6 +1133,21 @@ public function fetchAllQRCodeDesignsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -913,6 +1160,21 @@ public function fetchAllQRCodeDesignsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -925,6 +1187,21 @@ public function fetchAllQRCodeDesignsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -939,6 +1216,21 @@ public function fetchAllQRCodeDesignsWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -992,13 +1284,14 @@ public function fetchAllQRCodeDesignsWithHttpInfo($is_archive_included = null) * Fetch all active QR Code Designs * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllQRCodeDesigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllQRCodeDesignsAsync($is_archive_included = null) + public function fetchAllQRCodeDesignsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllQRCodeDesigns'][0]) { - return $this->fetchAllQRCodeDesignsAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllQRCodeDesignsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -1012,14 +1305,15 @@ function ($response) { * Fetch all active QR Code Designs * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllQRCodeDesigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllQRCodeDesignsAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllQRCodeDesignsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllQRCodeDesigns'][0]) { $returnType = '\OpenAPI\Client\Model\WTQRCodeDesign[]'; - $request = $this->fetchAllQRCodeDesignsRequest($is_archive_included); + $request = $this->fetchAllQRCodeDesignsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1029,6 +1323,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1058,13 +1355,16 @@ function ($exception) { * Create request for operation 'fetchAllQRCodeDesigns' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllQRCodeDesigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllQRCodeDesignsRequest($is_archive_included = null) + public function fetchAllQRCodeDesignsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllQRCodeDesigns'][0]) { + + $resourcePath = '/v2/qrcodedesign/all'; $formParams = []; $queryParams = []; @@ -1073,30 +1373,23 @@ public function fetchAllQRCodeDesignsRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1114,12 +1407,12 @@ public function fetchAllQRCodeDesignsRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1135,10 +1428,11 @@ public function fetchAllQRCodeDesignsRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1150,14 +1444,15 @@ public function fetchAllQRCodeDesignsRequest($is_archive_included = null) * Fetch QR Code Design * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchQRCodeDesignById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTQRCodeDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchQRCodeDesignById($id) + public function fetchQRCodeDesignById($id, string $contentType = self::contentTypes['fetchQRCodeDesignById'][0]) { - list($response) = $this->fetchQRCodeDesignByIdWithHttpInfo($id); + list($response) = $this->fetchQRCodeDesignByIdWithHttpInfo($id, $contentType); return $response; } @@ -1167,14 +1462,15 @@ public function fetchQRCodeDesignById($id) * Fetch QR Code Design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchQRCodeDesignById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTQRCodeDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchQRCodeDesignByIdWithHttpInfo($id) + public function fetchQRCodeDesignByIdWithHttpInfo($id, string $contentType = self::contentTypes['fetchQRCodeDesignById'][0]) { - $request = $this->fetchQRCodeDesignByIdRequest($id); + $request = $this->fetchQRCodeDesignByIdRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1217,6 +1513,21 @@ public function fetchQRCodeDesignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTQRCodeDesign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1229,6 +1540,21 @@ public function fetchQRCodeDesignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1241,6 +1567,21 @@ public function fetchQRCodeDesignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1253,6 +1594,21 @@ public function fetchQRCodeDesignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1267,6 +1623,21 @@ public function fetchQRCodeDesignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1320,13 +1691,14 @@ public function fetchQRCodeDesignByIdWithHttpInfo($id) * Fetch QR Code Design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchQRCodeDesignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchQRCodeDesignByIdAsync($id) + public function fetchQRCodeDesignByIdAsync($id, string $contentType = self::contentTypes['fetchQRCodeDesignById'][0]) { - return $this->fetchQRCodeDesignByIdAsyncWithHttpInfo($id) + return $this->fetchQRCodeDesignByIdAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1340,14 +1712,15 @@ function ($response) { * Fetch QR Code Design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchQRCodeDesignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchQRCodeDesignByIdAsyncWithHttpInfo($id) + public function fetchQRCodeDesignByIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchQRCodeDesignById'][0]) { $returnType = '\OpenAPI\Client\Model\WTQRCodeDesign'; - $request = $this->fetchQRCodeDesignByIdRequest($id); + $request = $this->fetchQRCodeDesignByIdRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1357,6 +1730,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1386,12 +1762,14 @@ function ($exception) { * Create request for operation 'fetchQRCodeDesignById' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchQRCodeDesignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchQRCodeDesignByIdRequest($id) + public function fetchQRCodeDesignByIdRequest($id, string $contentType = self::contentTypes['fetchQRCodeDesignById'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1399,6 +1777,7 @@ public function fetchQRCodeDesignByIdRequest($id) ); } + $resourcePath = '/v2/qrcodedesign/{id}'; $formParams = []; $queryParams = []; @@ -1418,16 +1797,11 @@ public function fetchQRCodeDesignByIdRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1445,12 +1819,12 @@ public function fetchQRCodeDesignByIdRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1466,10 +1840,11 @@ public function fetchQRCodeDesignByIdRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1481,14 +1856,15 @@ public function fetchQRCodeDesignByIdRequest($id) * Restore payment design * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreQRCodeDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\QRCodeDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreQRCodeDesign($id) + public function restoreQRCodeDesign($id, string $contentType = self::contentTypes['restoreQRCodeDesign'][0]) { - list($response) = $this->restoreQRCodeDesignWithHttpInfo($id); + list($response) = $this->restoreQRCodeDesignWithHttpInfo($id, $contentType); return $response; } @@ -1498,14 +1874,15 @@ public function restoreQRCodeDesign($id) * Restore payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreQRCodeDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\QRCodeDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreQRCodeDesignWithHttpInfo($id) + public function restoreQRCodeDesignWithHttpInfo($id, string $contentType = self::contentTypes['restoreQRCodeDesign'][0]) { - $request = $this->restoreQRCodeDesignRequest($id); + $request = $this->restoreQRCodeDesignRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1548,6 +1925,21 @@ public function restoreQRCodeDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\QRCodeDesign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1952,21 @@ public function restoreQRCodeDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1572,6 +1979,21 @@ public function restoreQRCodeDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1584,6 +2006,21 @@ public function restoreQRCodeDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1598,6 +2035,21 @@ public function restoreQRCodeDesignWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1651,13 +2103,14 @@ public function restoreQRCodeDesignWithHttpInfo($id) * Restore payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreQRCodeDesignAsync($id) + public function restoreQRCodeDesignAsync($id, string $contentType = self::contentTypes['restoreQRCodeDesign'][0]) { - return $this->restoreQRCodeDesignAsyncWithHttpInfo($id) + return $this->restoreQRCodeDesignAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1671,14 +2124,15 @@ function ($response) { * Restore payment design * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreQRCodeDesignAsyncWithHttpInfo($id) + public function restoreQRCodeDesignAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreQRCodeDesign'][0]) { $returnType = '\OpenAPI\Client\Model\QRCodeDesign'; - $request = $this->restoreQRCodeDesignRequest($id); + $request = $this->restoreQRCodeDesignRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1688,6 +2142,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1717,12 +2174,14 @@ function ($exception) { * Create request for operation 'restoreQRCodeDesign' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreQRCodeDesignRequest($id) + public function restoreQRCodeDesignRequest($id, string $contentType = self::contentTypes['restoreQRCodeDesign'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1730,6 +2189,7 @@ public function restoreQRCodeDesignRequest($id) ); } + $resourcePath = '/v2/qrcodedesign/{id}'; $formParams = []; $queryParams = []; @@ -1749,16 +2209,11 @@ public function restoreQRCodeDesignRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1776,12 +2231,12 @@ public function restoreQRCodeDesignRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1797,10 +2252,11 @@ public function restoreQRCodeDesignRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1813,14 +2269,15 @@ public function restoreQRCodeDesignRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTQRCodeDesignUpdateParams $wtqr_code_design_update_params wtqr_code_design_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateQRCodeDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTQRCodeDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function updateQRCodeDesign($id, $wtqr_code_design_update_params) + public function updateQRCodeDesign($id, $wtqr_code_design_update_params, string $contentType = self::contentTypes['updateQRCodeDesign'][0]) { - list($response) = $this->updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_params); + list($response) = $this->updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_params, $contentType); return $response; } @@ -1831,14 +2288,15 @@ public function updateQRCodeDesign($id, $wtqr_code_design_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTQRCodeDesignUpdateParams $wtqr_code_design_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateQRCodeDesign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTQRCodeDesign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_params) + public function updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_params, string $contentType = self::contentTypes['updateQRCodeDesign'][0]) { - $request = $this->updateQRCodeDesignRequest($id, $wtqr_code_design_update_params); + $request = $this->updateQRCodeDesignRequest($id, $wtqr_code_design_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1881,6 +2339,21 @@ public function updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTQRCodeDesign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1893,6 +2366,21 @@ public function updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1905,6 +2393,21 @@ public function updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1917,6 +2420,21 @@ public function updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1929,6 +2447,21 @@ public function updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1941,6 +2474,21 @@ public function updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1955,6 +2503,21 @@ public function updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2025,13 +2588,14 @@ public function updateQRCodeDesignWithHttpInfo($id, $wtqr_code_design_update_par * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTQRCodeDesignUpdateParams $wtqr_code_design_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateQRCodeDesignAsync($id, $wtqr_code_design_update_params) + public function updateQRCodeDesignAsync($id, $wtqr_code_design_update_params, string $contentType = self::contentTypes['updateQRCodeDesign'][0]) { - return $this->updateQRCodeDesignAsyncWithHttpInfo($id, $wtqr_code_design_update_params) + return $this->updateQRCodeDesignAsyncWithHttpInfo($id, $wtqr_code_design_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -2046,14 +2610,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTQRCodeDesignUpdateParams $wtqr_code_design_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateQRCodeDesignAsyncWithHttpInfo($id, $wtqr_code_design_update_params) + public function updateQRCodeDesignAsyncWithHttpInfo($id, $wtqr_code_design_update_params, string $contentType = self::contentTypes['updateQRCodeDesign'][0]) { $returnType = '\OpenAPI\Client\Model\WTQRCodeDesign'; - $request = $this->updateQRCodeDesignRequest($id, $wtqr_code_design_update_params); + $request = $this->updateQRCodeDesignRequest($id, $wtqr_code_design_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2063,6 +2628,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2093,18 +2661,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTQRCodeDesignUpdateParams $wtqr_code_design_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateQRCodeDesign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateQRCodeDesignRequest($id, $wtqr_code_design_update_params) + public function updateQRCodeDesignRequest($id, $wtqr_code_design_update_params, string $contentType = self::contentTypes['updateQRCodeDesign'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateQRCodeDesign' ); } + // verify the required parameter 'wtqr_code_design_update_params' is set if ($wtqr_code_design_update_params === null || (is_array($wtqr_code_design_update_params) && count($wtqr_code_design_update_params) === 0)) { throw new \InvalidArgumentException( @@ -2112,6 +2683,7 @@ public function updateQRCodeDesignRequest($id, $wtqr_code_design_update_params) ); } + $resourcePath = '/v2/qrcodedesign/{id}'; $formParams = []; $queryParams = []; @@ -2131,21 +2703,17 @@ public function updateQRCodeDesignRequest($id, $wtqr_code_design_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wtqr_code_design_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wtqr_code_design_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wtqr_code_design_update_params)); } else { $httpBody = $wtqr_code_design_update_params; } @@ -2164,12 +2732,12 @@ public function updateQRCodeDesignRequest($id, $wtqr_code_design_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2185,10 +2753,11 @@ public function updateQRCodeDesignRequest($id, $wtqr_code_design_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/QuickLinksApi.php b/lib/Api/QuickLinksApi.php index b1b7ba2..389eb4b 100644 --- a/lib/Api/QuickLinksApi.php +++ b/lib/Api/QuickLinksApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createLinkBook' => [ + 'application/json', + ], + 'fetchAllLinkBook' => [ + 'application/json', + ], + 'fetchLinkBookById' => [ + 'application/json', + ], + 'restoreLinkBook' => [ + 'application/json', + ], + 'updateLinkBook' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +144,15 @@ public function getConfig() * Archive link * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLinkBook'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\LinkBook|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveLinkBook($id) + public function archiveLinkBook($id, string $contentType = self::contentTypes['archiveLinkBook'][0]) { - list($response) = $this->archiveLinkBookWithHttpInfo($id); + list($response) = $this->archiveLinkBookWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +162,15 @@ public function archiveLinkBook($id) * Archive link * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLinkBook'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\LinkBook|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveLinkBookWithHttpInfo($id) + public function archiveLinkBookWithHttpInfo($id, string $contentType = self::contentTypes['archiveLinkBook'][0]) { - $request = $this->archiveLinkBookRequest($id); + $request = $this->archiveLinkBookRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +213,21 @@ public function archiveLinkBookWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LinkBook' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +240,21 @@ public function archiveLinkBookWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +267,21 @@ public function archiveLinkBookWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +294,21 @@ public function archiveLinkBookWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +323,21 @@ public function archiveLinkBookWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +391,14 @@ public function archiveLinkBookWithHttpInfo($id) * Archive link * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveLinkBookAsync($id) + public function archiveLinkBookAsync($id, string $contentType = self::contentTypes['archiveLinkBook'][0]) { - return $this->archiveLinkBookAsyncWithHttpInfo($id) + return $this->archiveLinkBookAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +412,15 @@ function ($response) { * Archive link * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveLinkBookAsyncWithHttpInfo($id) + public function archiveLinkBookAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveLinkBook'][0]) { $returnType = '\OpenAPI\Client\Model\LinkBook'; - $request = $this->archiveLinkBookRequest($id); + $request = $this->archiveLinkBookRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +430,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +462,14 @@ function ($exception) { * Create request for operation 'archiveLinkBook' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveLinkBookRequest($id) + public function archiveLinkBookRequest($id, string $contentType = self::contentTypes['archiveLinkBook'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +477,7 @@ public function archiveLinkBookRequest($id) ); } + $resourcePath = '/v2/linkBook/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +497,11 @@ public function archiveLinkBookRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +519,12 @@ public function archiveLinkBookRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +540,11 @@ public function archiveLinkBookRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +556,15 @@ public function archiveLinkBookRequest($id) * Create link * * @param \OpenAPI\Client\Model\WTLinkBookCreateParams $wt_link_book_create_params wt_link_book_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLinkBook'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\LinkBook|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createLinkBook($wt_link_book_create_params) + public function createLinkBook($wt_link_book_create_params, string $contentType = self::contentTypes['createLinkBook'][0]) { - list($response) = $this->createLinkBookWithHttpInfo($wt_link_book_create_params); + list($response) = $this->createLinkBookWithHttpInfo($wt_link_book_create_params, $contentType); return $response; } @@ -470,14 +574,15 @@ public function createLinkBook($wt_link_book_create_params) * Create link * * @param \OpenAPI\Client\Model\WTLinkBookCreateParams $wt_link_book_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLinkBook'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\LinkBook|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createLinkBookWithHttpInfo($wt_link_book_create_params) + public function createLinkBookWithHttpInfo($wt_link_book_create_params, string $contentType = self::contentTypes['createLinkBook'][0]) { - $request = $this->createLinkBookRequest($wt_link_book_create_params); + $request = $this->createLinkBookRequest($wt_link_book_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +625,21 @@ public function createLinkBookWithHttpInfo($wt_link_book_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LinkBook' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +652,21 @@ public function createLinkBookWithHttpInfo($wt_link_book_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +679,21 @@ public function createLinkBookWithHttpInfo($wt_link_book_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +706,21 @@ public function createLinkBookWithHttpInfo($wt_link_book_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +735,21 @@ public function createLinkBookWithHttpInfo($wt_link_book_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +803,14 @@ public function createLinkBookWithHttpInfo($wt_link_book_create_params) * Create link * * @param \OpenAPI\Client\Model\WTLinkBookCreateParams $wt_link_book_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createLinkBookAsync($wt_link_book_create_params) + public function createLinkBookAsync($wt_link_book_create_params, string $contentType = self::contentTypes['createLinkBook'][0]) { - return $this->createLinkBookAsyncWithHttpInfo($wt_link_book_create_params) + return $this->createLinkBookAsyncWithHttpInfo($wt_link_book_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +824,15 @@ function ($response) { * Create link * * @param \OpenAPI\Client\Model\WTLinkBookCreateParams $wt_link_book_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createLinkBookAsyncWithHttpInfo($wt_link_book_create_params) + public function createLinkBookAsyncWithHttpInfo($wt_link_book_create_params, string $contentType = self::contentTypes['createLinkBook'][0]) { $returnType = '\OpenAPI\Client\Model\LinkBook'; - $request = $this->createLinkBookRequest($wt_link_book_create_params); + $request = $this->createLinkBookRequest($wt_link_book_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +842,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +874,14 @@ function ($exception) { * Create request for operation 'createLinkBook' * * @param \OpenAPI\Client\Model\WTLinkBookCreateParams $wt_link_book_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createLinkBookRequest($wt_link_book_create_params) + public function createLinkBookRequest($wt_link_book_create_params, string $contentType = self::contentTypes['createLinkBook'][0]) { + // verify the required parameter 'wt_link_book_create_params' is set if ($wt_link_book_create_params === null || (is_array($wt_link_book_create_params) && count($wt_link_book_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +889,7 @@ public function createLinkBookRequest($wt_link_book_create_params) ); } + $resourcePath = '/v2/linkBook'; $formParams = []; $queryParams = []; @@ -713,21 +901,17 @@ public function createLinkBookRequest($wt_link_book_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_link_book_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_link_book_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_link_book_create_params)); } else { $httpBody = $wt_link_book_create_params; } @@ -746,12 +930,12 @@ public function createLinkBookRequest($wt_link_book_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +951,11 @@ public function createLinkBookRequest($wt_link_book_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +967,15 @@ public function createLinkBookRequest($wt_link_book_create_params) * Fetch all links * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLinkBook'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllLinkBook($is_archive_included = null) + public function fetchAllLinkBook($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLinkBook'][0]) { - list($response) = $this->fetchAllLinkBookWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllLinkBookWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +985,15 @@ public function fetchAllLinkBook($is_archive_included = null) * Fetch all links * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLinkBook'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllLinkBookWithHttpInfo($is_archive_included = null) + public function fetchAllLinkBookWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLinkBook'][0]) { - $request = $this->fetchAllLinkBookRequest($is_archive_included); + $request = $this->fetchAllLinkBookRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1036,21 @@ public function fetchAllLinkBookWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1063,21 @@ public function fetchAllLinkBookWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1090,21 @@ public function fetchAllLinkBookWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1117,21 @@ public function fetchAllLinkBookWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1146,21 @@ public function fetchAllLinkBookWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1214,14 @@ public function fetchAllLinkBookWithHttpInfo($is_archive_included = null) * Fetch all links * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllLinkBookAsync($is_archive_included = null) + public function fetchAllLinkBookAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLinkBook'][0]) { - return $this->fetchAllLinkBookAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllLinkBookAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1235,15 @@ function ($response) { * Fetch all links * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllLinkBookAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllLinkBookAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLinkBook'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllLinkBookRequest($is_archive_included); + $request = $this->fetchAllLinkBookRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1253,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1285,16 @@ function ($exception) { * Create request for operation 'fetchAllLinkBook' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllLinkBookRequest($is_archive_included = null) + public function fetchAllLinkBookRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLinkBook'][0]) { + + $resourcePath = '/v2/linkBook/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1303,23 @@ public function fetchAllLinkBookRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1337,12 @@ public function fetchAllLinkBookRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1358,11 @@ public function fetchAllLinkBookRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1374,15 @@ public function fetchAllLinkBookRequest($is_archive_included = null) * Fetch link book by id * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchLinkBookById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTLinkBook|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchLinkBookById($id) + public function fetchLinkBookById($id, string $contentType = self::contentTypes['fetchLinkBookById'][0]) { - list($response) = $this->fetchLinkBookByIdWithHttpInfo($id); + list($response) = $this->fetchLinkBookByIdWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1392,15 @@ public function fetchLinkBookById($id) * Fetch link book by id * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchLinkBookById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTLinkBook|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchLinkBookByIdWithHttpInfo($id) + public function fetchLinkBookByIdWithHttpInfo($id, string $contentType = self::contentTypes['fetchLinkBookById'][0]) { - $request = $this->fetchLinkBookByIdRequest($id); + $request = $this->fetchLinkBookByIdRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1443,21 @@ public function fetchLinkBookByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTLinkBook' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1470,21 @@ public function fetchLinkBookByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1497,21 @@ public function fetchLinkBookByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1524,21 @@ public function fetchLinkBookByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1553,21 @@ public function fetchLinkBookByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1621,14 @@ public function fetchLinkBookByIdWithHttpInfo($id) * Fetch link book by id * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchLinkBookById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchLinkBookByIdAsync($id) + public function fetchLinkBookByIdAsync($id, string $contentType = self::contentTypes['fetchLinkBookById'][0]) { - return $this->fetchLinkBookByIdAsyncWithHttpInfo($id) + return $this->fetchLinkBookByIdAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1642,15 @@ function ($response) { * Fetch link book by id * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchLinkBookById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchLinkBookByIdAsyncWithHttpInfo($id) + public function fetchLinkBookByIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchLinkBookById'][0]) { $returnType = '\OpenAPI\Client\Model\WTLinkBook'; - $request = $this->fetchLinkBookByIdRequest($id); + $request = $this->fetchLinkBookByIdRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1660,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1692,14 @@ function ($exception) { * Create request for operation 'fetchLinkBookById' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchLinkBookById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchLinkBookByIdRequest($id) + public function fetchLinkBookByIdRequest($id, string $contentType = self::contentTypes['fetchLinkBookById'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1707,7 @@ public function fetchLinkBookByIdRequest($id) ); } + $resourcePath = '/v2/linkBook/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1727,11 @@ public function fetchLinkBookByIdRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1749,12 @@ public function fetchLinkBookByIdRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1770,11 @@ public function fetchLinkBookByIdRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1441,14 +1786,15 @@ public function fetchLinkBookByIdRequest($id) * Restore link * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLinkBook'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\LinkBook|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreLinkBook($id) + public function restoreLinkBook($id, string $contentType = self::contentTypes['restoreLinkBook'][0]) { - list($response) = $this->restoreLinkBookWithHttpInfo($id); + list($response) = $this->restoreLinkBookWithHttpInfo($id, $contentType); return $response; } @@ -1458,14 +1804,15 @@ public function restoreLinkBook($id) * Restore link * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLinkBook'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\LinkBook|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreLinkBookWithHttpInfo($id) + public function restoreLinkBookWithHttpInfo($id, string $contentType = self::contentTypes['restoreLinkBook'][0]) { - $request = $this->restoreLinkBookRequest($id); + $request = $this->restoreLinkBookRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1508,6 +1855,21 @@ public function restoreLinkBookWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LinkBook' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1520,6 +1882,21 @@ public function restoreLinkBookWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1532,6 +1909,21 @@ public function restoreLinkBookWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1544,6 +1936,21 @@ public function restoreLinkBookWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1558,6 +1965,21 @@ public function restoreLinkBookWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1611,13 +2033,14 @@ public function restoreLinkBookWithHttpInfo($id) * Restore link * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreLinkBookAsync($id) + public function restoreLinkBookAsync($id, string $contentType = self::contentTypes['restoreLinkBook'][0]) { - return $this->restoreLinkBookAsyncWithHttpInfo($id) + return $this->restoreLinkBookAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1631,14 +2054,15 @@ function ($response) { * Restore link * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreLinkBookAsyncWithHttpInfo($id) + public function restoreLinkBookAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreLinkBook'][0]) { $returnType = '\OpenAPI\Client\Model\LinkBook'; - $request = $this->restoreLinkBookRequest($id); + $request = $this->restoreLinkBookRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1648,6 +2072,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1677,12 +2104,14 @@ function ($exception) { * Create request for operation 'restoreLinkBook' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreLinkBookRequest($id) + public function restoreLinkBookRequest($id, string $contentType = self::contentTypes['restoreLinkBook'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1690,6 +2119,7 @@ public function restoreLinkBookRequest($id) ); } + $resourcePath = '/v2/linkBook/{id}'; $formParams = []; $queryParams = []; @@ -1709,16 +2139,11 @@ public function restoreLinkBookRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1736,12 +2161,12 @@ public function restoreLinkBookRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1757,10 +2182,11 @@ public function restoreLinkBookRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1773,14 +2199,15 @@ public function restoreLinkBookRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTLinkBookUpdateParams $wt_link_book_update_params wt_link_book_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLinkBook'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\LinkBook|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateLinkBook($id, $wt_link_book_update_params) + public function updateLinkBook($id, $wt_link_book_update_params, string $contentType = self::contentTypes['updateLinkBook'][0]) { - list($response) = $this->updateLinkBookWithHttpInfo($id, $wt_link_book_update_params); + list($response) = $this->updateLinkBookWithHttpInfo($id, $wt_link_book_update_params, $contentType); return $response; } @@ -1791,14 +2218,15 @@ public function updateLinkBook($id, $wt_link_book_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLinkBookUpdateParams $wt_link_book_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLinkBook'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\LinkBook|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateLinkBookWithHttpInfo($id, $wt_link_book_update_params) + public function updateLinkBookWithHttpInfo($id, $wt_link_book_update_params, string $contentType = self::contentTypes['updateLinkBook'][0]) { - $request = $this->updateLinkBookRequest($id, $wt_link_book_update_params); + $request = $this->updateLinkBookRequest($id, $wt_link_book_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1841,6 +2269,21 @@ public function updateLinkBookWithHttpInfo($id, $wt_link_book_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LinkBook' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1853,6 +2296,21 @@ public function updateLinkBookWithHttpInfo($id, $wt_link_book_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1865,6 +2323,21 @@ public function updateLinkBookWithHttpInfo($id, $wt_link_book_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1877,6 +2350,21 @@ public function updateLinkBookWithHttpInfo($id, $wt_link_book_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1891,6 +2379,21 @@ public function updateLinkBookWithHttpInfo($id, $wt_link_book_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1945,13 +2448,14 @@ public function updateLinkBookWithHttpInfo($id, $wt_link_book_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLinkBookUpdateParams $wt_link_book_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLinkBookAsync($id, $wt_link_book_update_params) + public function updateLinkBookAsync($id, $wt_link_book_update_params, string $contentType = self::contentTypes['updateLinkBook'][0]) { - return $this->updateLinkBookAsyncWithHttpInfo($id, $wt_link_book_update_params) + return $this->updateLinkBookAsyncWithHttpInfo($id, $wt_link_book_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1966,14 +2470,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLinkBookUpdateParams $wt_link_book_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLinkBookAsyncWithHttpInfo($id, $wt_link_book_update_params) + public function updateLinkBookAsyncWithHttpInfo($id, $wt_link_book_update_params, string $contentType = self::contentTypes['updateLinkBook'][0]) { $returnType = '\OpenAPI\Client\Model\LinkBook'; - $request = $this->updateLinkBookRequest($id, $wt_link_book_update_params); + $request = $this->updateLinkBookRequest($id, $wt_link_book_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1983,6 +2488,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2013,18 +2521,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLinkBookUpdateParams $wt_link_book_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLinkBook'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateLinkBookRequest($id, $wt_link_book_update_params) + public function updateLinkBookRequest($id, $wt_link_book_update_params, string $contentType = self::contentTypes['updateLinkBook'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateLinkBook' ); } + // verify the required parameter 'wt_link_book_update_params' is set if ($wt_link_book_update_params === null || (is_array($wt_link_book_update_params) && count($wt_link_book_update_params) === 0)) { throw new \InvalidArgumentException( @@ -2032,6 +2543,7 @@ public function updateLinkBookRequest($id, $wt_link_book_update_params) ); } + $resourcePath = '/v2/linkBook/{id}'; $formParams = []; $queryParams = []; @@ -2051,21 +2563,17 @@ public function updateLinkBookRequest($id, $wt_link_book_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_link_book_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_link_book_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_link_book_update_params)); } else { $httpBody = $wt_link_book_update_params; } @@ -2084,12 +2592,12 @@ public function updateLinkBookRequest($id, $wt_link_book_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2105,10 +2613,11 @@ public function updateLinkBookRequest($id, $wt_link_book_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/QuickLinksSectionApi.php b/lib/Api/QuickLinksSectionApi.php index 38ca524..66605b3 100644 --- a/lib/Api/QuickLinksSectionApi.php +++ b/lib/Api/QuickLinksSectionApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createLinkBookSection' => [ + 'application/json', + ], + 'fetchAllLinkBookSections' => [ + 'application/json', + ], + 'restoreLinkBookSection' => [ + 'application/json', + ], + 'updateLinkBookSection' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive link book section * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLinkBookSection'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\LinkBookSection|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveLinkBookSection($id) + public function archiveLinkBookSection($id, string $contentType = self::contentTypes['archiveLinkBookSection'][0]) { - list($response) = $this->archiveLinkBookSectionWithHttpInfo($id); + list($response) = $this->archiveLinkBookSectionWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveLinkBookSection($id) * Archive link book section * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLinkBookSection'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\LinkBookSection|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveLinkBookSectionWithHttpInfo($id) + public function archiveLinkBookSectionWithHttpInfo($id, string $contentType = self::contentTypes['archiveLinkBookSection'][0]) { - $request = $this->archiveLinkBookSectionRequest($id); + $request = $this->archiveLinkBookSectionRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveLinkBookSectionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LinkBookSection' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveLinkBookSectionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveLinkBookSectionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveLinkBookSectionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveLinkBookSectionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveLinkBookSectionWithHttpInfo($id) * Archive link book section * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveLinkBookSectionAsync($id) + public function archiveLinkBookSectionAsync($id, string $contentType = self::contentTypes['archiveLinkBookSection'][0]) { - return $this->archiveLinkBookSectionAsyncWithHttpInfo($id) + return $this->archiveLinkBookSectionAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive link book section * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveLinkBookSectionAsyncWithHttpInfo($id) + public function archiveLinkBookSectionAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveLinkBookSection'][0]) { $returnType = '\OpenAPI\Client\Model\LinkBookSection'; - $request = $this->archiveLinkBookSectionRequest($id); + $request = $this->archiveLinkBookSectionRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveLinkBookSection' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveLinkBookSectionRequest($id) + public function archiveLinkBookSectionRequest($id, string $contentType = self::contentTypes['archiveLinkBookSection'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveLinkBookSectionRequest($id) ); } + $resourcePath = '/v2/linkBookSection/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveLinkBookSectionRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveLinkBookSectionRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveLinkBookSectionRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveLinkBookSectionRequest($id) * Create link book section * * @param \OpenAPI\Client\Model\WTLinkBookSectionCreateParams $wt_link_book_section_create_params wt_link_book_section_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLinkBookSection'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\LinkBookSection|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createLinkBookSection($wt_link_book_section_create_params) + public function createLinkBookSection($wt_link_book_section_create_params, string $contentType = self::contentTypes['createLinkBookSection'][0]) { - list($response) = $this->createLinkBookSectionWithHttpInfo($wt_link_book_section_create_params); + list($response) = $this->createLinkBookSectionWithHttpInfo($wt_link_book_section_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createLinkBookSection($wt_link_book_section_create_params) * Create link book section * * @param \OpenAPI\Client\Model\WTLinkBookSectionCreateParams $wt_link_book_section_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLinkBookSection'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\LinkBookSection|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createLinkBookSectionWithHttpInfo($wt_link_book_section_create_params) + public function createLinkBookSectionWithHttpInfo($wt_link_book_section_create_params, string $contentType = self::contentTypes['createLinkBookSection'][0]) { - $request = $this->createLinkBookSectionRequest($wt_link_book_section_create_params); + $request = $this->createLinkBookSectionRequest($wt_link_book_section_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createLinkBookSectionWithHttpInfo($wt_link_book_section_create_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LinkBookSection' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createLinkBookSectionWithHttpInfo($wt_link_book_section_create_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createLinkBookSectionWithHttpInfo($wt_link_book_section_create_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createLinkBookSectionWithHttpInfo($wt_link_book_section_create_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createLinkBookSectionWithHttpInfo($wt_link_book_section_create_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createLinkBookSectionWithHttpInfo($wt_link_book_section_create_p * Create link book section * * @param \OpenAPI\Client\Model\WTLinkBookSectionCreateParams $wt_link_book_section_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createLinkBookSectionAsync($wt_link_book_section_create_params) + public function createLinkBookSectionAsync($wt_link_book_section_create_params, string $contentType = self::contentTypes['createLinkBookSection'][0]) { - return $this->createLinkBookSectionAsyncWithHttpInfo($wt_link_book_section_create_params) + return $this->createLinkBookSectionAsyncWithHttpInfo($wt_link_book_section_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create link book section * * @param \OpenAPI\Client\Model\WTLinkBookSectionCreateParams $wt_link_book_section_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createLinkBookSectionAsyncWithHttpInfo($wt_link_book_section_create_params) + public function createLinkBookSectionAsyncWithHttpInfo($wt_link_book_section_create_params, string $contentType = self::contentTypes['createLinkBookSection'][0]) { $returnType = '\OpenAPI\Client\Model\LinkBookSection'; - $request = $this->createLinkBookSectionRequest($wt_link_book_section_create_params); + $request = $this->createLinkBookSectionRequest($wt_link_book_section_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createLinkBookSection' * * @param \OpenAPI\Client\Model\WTLinkBookSectionCreateParams $wt_link_book_section_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createLinkBookSectionRequest($wt_link_book_section_create_params) + public function createLinkBookSectionRequest($wt_link_book_section_create_params, string $contentType = self::contentTypes['createLinkBookSection'][0]) { + // verify the required parameter 'wt_link_book_section_create_params' is set if ($wt_link_book_section_create_params === null || (is_array($wt_link_book_section_create_params) && count($wt_link_book_section_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createLinkBookSectionRequest($wt_link_book_section_create_params ); } + $resourcePath = '/v2/linkBookSection'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createLinkBookSectionRequest($wt_link_book_section_create_params - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_link_book_section_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_link_book_section_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_link_book_section_create_params)); } else { $httpBody = $wt_link_book_section_create_params; } @@ -746,12 +927,12 @@ public function createLinkBookSectionRequest($wt_link_book_section_create_params // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createLinkBookSectionRequest($wt_link_book_section_create_params $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createLinkBookSectionRequest($wt_link_book_section_create_params * Fetch all link book sections * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLinkBookSections'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllLinkBookSections($is_archive_included = null) + public function fetchAllLinkBookSections($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLinkBookSections'][0]) { - list($response) = $this->fetchAllLinkBookSectionsWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllLinkBookSectionsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllLinkBookSections($is_archive_included = null) * Fetch all link book sections * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLinkBookSections'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllLinkBookSectionsWithHttpInfo($is_archive_included = null) + public function fetchAllLinkBookSectionsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLinkBookSections'][0]) { - $request = $this->fetchAllLinkBookSectionsRequest($is_archive_included); + $request = $this->fetchAllLinkBookSectionsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllLinkBookSectionsWithHttpInfo($is_archive_included = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllLinkBookSectionsWithHttpInfo($is_archive_included = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllLinkBookSectionsWithHttpInfo($is_archive_included = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllLinkBookSectionsWithHttpInfo($is_archive_included = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllLinkBookSectionsWithHttpInfo($is_archive_included = null $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllLinkBookSectionsWithHttpInfo($is_archive_included = null * Fetch all link book sections * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLinkBookSections'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllLinkBookSectionsAsync($is_archive_included = null) + public function fetchAllLinkBookSectionsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLinkBookSections'][0]) { - return $this->fetchAllLinkBookSectionsAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllLinkBookSectionsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all link book sections * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLinkBookSections'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllLinkBookSectionsAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllLinkBookSectionsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLinkBookSections'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllLinkBookSectionsRequest($is_archive_included); + $request = $this->fetchAllLinkBookSectionsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllLinkBookSections' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLinkBookSections'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllLinkBookSectionsRequest($is_archive_included = null) + public function fetchAllLinkBookSectionsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllLinkBookSections'][0]) { + + $resourcePath = '/v2/linkBookSection/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllLinkBookSectionsRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllLinkBookSectionsRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllLinkBookSectionsRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllLinkBookSectionsRequest($is_archive_included = null) * Restore link book section * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLinkBookSection'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\LinkBookSection|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreLinkBookSection($id) + public function restoreLinkBookSection($id, string $contentType = self::contentTypes['restoreLinkBookSection'][0]) { - list($response) = $this->restoreLinkBookSectionWithHttpInfo($id); + list($response) = $this->restoreLinkBookSectionWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restoreLinkBookSection($id) * Restore link book section * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLinkBookSection'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\LinkBookSection|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreLinkBookSectionWithHttpInfo($id) + public function restoreLinkBookSectionWithHttpInfo($id, string $contentType = self::contentTypes['restoreLinkBookSection'][0]) { - $request = $this->restoreLinkBookSectionRequest($id); + $request = $this->restoreLinkBookSectionRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restoreLinkBookSectionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LinkBookSection' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restoreLinkBookSectionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restoreLinkBookSectionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restoreLinkBookSectionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restoreLinkBookSectionWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restoreLinkBookSectionWithHttpInfo($id) * Restore link book section * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreLinkBookSectionAsync($id) + public function restoreLinkBookSectionAsync($id, string $contentType = self::contentTypes['restoreLinkBookSection'][0]) { - return $this->restoreLinkBookSectionAsyncWithHttpInfo($id) + return $this->restoreLinkBookSectionAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore link book section * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreLinkBookSectionAsyncWithHttpInfo($id) + public function restoreLinkBookSectionAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreLinkBookSection'][0]) { $returnType = '\OpenAPI\Client\Model\LinkBookSection'; - $request = $this->restoreLinkBookSectionRequest($id); + $request = $this->restoreLinkBookSectionRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restoreLinkBookSection' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreLinkBookSectionRequest($id) + public function restoreLinkBookSectionRequest($id, string $contentType = self::contentTypes['restoreLinkBookSection'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restoreLinkBookSectionRequest($id) ); } + $resourcePath = '/v2/linkBookSection/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restoreLinkBookSectionRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restoreLinkBookSectionRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restoreLinkBookSectionRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restoreLinkBookSectionRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTLinkBookSectionUpdateParams $wt_link_book_section_update_params wt_link_book_section_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLinkBookSection'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\LinkBookSection|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateLinkBookSection($id, $wt_link_book_section_update_params) + public function updateLinkBookSection($id, $wt_link_book_section_update_params, string $contentType = self::contentTypes['updateLinkBookSection'][0]) { - list($response) = $this->updateLinkBookSectionWithHttpInfo($id, $wt_link_book_section_update_params); + list($response) = $this->updateLinkBookSectionWithHttpInfo($id, $wt_link_book_section_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateLinkBookSection($id, $wt_link_book_section_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLinkBookSectionUpdateParams $wt_link_book_section_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLinkBookSection'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\LinkBookSection|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateLinkBookSectionWithHttpInfo($id, $wt_link_book_section_update_params) + public function updateLinkBookSectionWithHttpInfo($id, $wt_link_book_section_update_params, string $contentType = self::contentTypes['updateLinkBookSection'][0]) { - $request = $this->updateLinkBookSectionRequest($id, $wt_link_book_section_update_params); + $request = $this->updateLinkBookSectionRequest($id, $wt_link_book_section_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateLinkBookSectionWithHttpInfo($id, $wt_link_book_section_upd $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\LinkBookSection' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateLinkBookSectionWithHttpInfo($id, $wt_link_book_section_upd $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateLinkBookSectionWithHttpInfo($id, $wt_link_book_section_upd $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateLinkBookSectionWithHttpInfo($id, $wt_link_book_section_upd $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateLinkBookSectionWithHttpInfo($id, $wt_link_book_section_upd $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateLinkBookSectionWithHttpInfo($id, $wt_link_book_section_upd * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLinkBookSectionUpdateParams $wt_link_book_section_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLinkBookSectionAsync($id, $wt_link_book_section_update_params) + public function updateLinkBookSectionAsync($id, $wt_link_book_section_update_params, string $contentType = self::contentTypes['updateLinkBookSection'][0]) { - return $this->updateLinkBookSectionAsyncWithHttpInfo($id, $wt_link_book_section_update_params) + return $this->updateLinkBookSectionAsyncWithHttpInfo($id, $wt_link_book_section_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLinkBookSectionUpdateParams $wt_link_book_section_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLinkBookSectionAsyncWithHttpInfo($id, $wt_link_book_section_update_params) + public function updateLinkBookSectionAsyncWithHttpInfo($id, $wt_link_book_section_update_params, string $contentType = self::contentTypes['updateLinkBookSection'][0]) { $returnType = '\OpenAPI\Client\Model\LinkBookSection'; - $request = $this->updateLinkBookSectionRequest($id, $wt_link_book_section_update_params); + $request = $this->updateLinkBookSectionRequest($id, $wt_link_book_section_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTLinkBookSectionUpdateParams $wt_link_book_section_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateLinkBookSection'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateLinkBookSectionRequest($id, $wt_link_book_section_update_params) + public function updateLinkBookSectionRequest($id, $wt_link_book_section_update_params, string $contentType = self::contentTypes['updateLinkBookSection'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateLinkBookSection' ); } + // verify the required parameter 'wt_link_book_section_update_params' is set if ($wt_link_book_section_update_params === null || (is_array($wt_link_book_section_update_params) && count($wt_link_book_section_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateLinkBookSectionRequest($id, $wt_link_book_section_update_p ); } + $resourcePath = '/v2/linkBookSection/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateLinkBookSectionRequest($id, $wt_link_book_section_update_p } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_link_book_section_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_link_book_section_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_link_book_section_update_params)); } else { $httpBody = $wt_link_book_section_update_params; } @@ -1753,12 +2177,12 @@ public function updateLinkBookSectionRequest($id, $wt_link_book_section_update_p // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateLinkBookSectionRequest($id, $wt_link_book_section_update_p $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/RoomRatesApi.php b/lib/Api/RoomRatesApi.php index 6bba4b8..96adcfd 100644 --- a/lib/Api/RoomRatesApi.php +++ b/lib/Api/RoomRatesApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createRoomRate' => [ + 'application/json', + ], + 'fetchAllRoomRates' => [ + 'application/json', + ], + 'restoreRoomRate' => [ + 'application/json', + ], + 'updateRoomRate' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive room rate * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveRoomRate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\RoomRate|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveRoomRate($id) + public function archiveRoomRate($id, string $contentType = self::contentTypes['archiveRoomRate'][0]) { - list($response) = $this->archiveRoomRateWithHttpInfo($id); + list($response) = $this->archiveRoomRateWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveRoomRate($id) * Archive room rate * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveRoomRate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\RoomRate|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveRoomRateWithHttpInfo($id) + public function archiveRoomRateWithHttpInfo($id, string $contentType = self::contentTypes['archiveRoomRate'][0]) { - $request = $this->archiveRoomRateRequest($id); + $request = $this->archiveRoomRateRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveRoomRateWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\RoomRate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveRoomRateWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveRoomRateWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveRoomRateWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveRoomRateWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveRoomRateWithHttpInfo($id) * Archive room rate * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveRoomRateAsync($id) + public function archiveRoomRateAsync($id, string $contentType = self::contentTypes['archiveRoomRate'][0]) { - return $this->archiveRoomRateAsyncWithHttpInfo($id) + return $this->archiveRoomRateAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive room rate * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveRoomRateAsyncWithHttpInfo($id) + public function archiveRoomRateAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveRoomRate'][0]) { $returnType = '\OpenAPI\Client\Model\RoomRate'; - $request = $this->archiveRoomRateRequest($id); + $request = $this->archiveRoomRateRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveRoomRate' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveRoomRateRequest($id) + public function archiveRoomRateRequest($id, string $contentType = self::contentTypes['archiveRoomRate'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveRoomRateRequest($id) ); } + $resourcePath = '/v2/roomRates/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveRoomRateRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveRoomRateRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveRoomRateRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveRoomRateRequest($id) * Create room rate * * @param \OpenAPI\Client\Model\WTRoomRateCreateParams $wt_room_rate_create_params wt_room_rate_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRoomRate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\RoomRate|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createRoomRate($wt_room_rate_create_params) + public function createRoomRate($wt_room_rate_create_params, string $contentType = self::contentTypes['createRoomRate'][0]) { - list($response) = $this->createRoomRateWithHttpInfo($wt_room_rate_create_params); + list($response) = $this->createRoomRateWithHttpInfo($wt_room_rate_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createRoomRate($wt_room_rate_create_params) * Create room rate * * @param \OpenAPI\Client\Model\WTRoomRateCreateParams $wt_room_rate_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRoomRate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\RoomRate|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createRoomRateWithHttpInfo($wt_room_rate_create_params) + public function createRoomRateWithHttpInfo($wt_room_rate_create_params, string $contentType = self::contentTypes['createRoomRate'][0]) { - $request = $this->createRoomRateRequest($wt_room_rate_create_params); + $request = $this->createRoomRateRequest($wt_room_rate_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createRoomRateWithHttpInfo($wt_room_rate_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\RoomRate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createRoomRateWithHttpInfo($wt_room_rate_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createRoomRateWithHttpInfo($wt_room_rate_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createRoomRateWithHttpInfo($wt_room_rate_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createRoomRateWithHttpInfo($wt_room_rate_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createRoomRateWithHttpInfo($wt_room_rate_create_params) * Create room rate * * @param \OpenAPI\Client\Model\WTRoomRateCreateParams $wt_room_rate_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createRoomRateAsync($wt_room_rate_create_params) + public function createRoomRateAsync($wt_room_rate_create_params, string $contentType = self::contentTypes['createRoomRate'][0]) { - return $this->createRoomRateAsyncWithHttpInfo($wt_room_rate_create_params) + return $this->createRoomRateAsyncWithHttpInfo($wt_room_rate_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create room rate * * @param \OpenAPI\Client\Model\WTRoomRateCreateParams $wt_room_rate_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createRoomRateAsyncWithHttpInfo($wt_room_rate_create_params) + public function createRoomRateAsyncWithHttpInfo($wt_room_rate_create_params, string $contentType = self::contentTypes['createRoomRate'][0]) { $returnType = '\OpenAPI\Client\Model\RoomRate'; - $request = $this->createRoomRateRequest($wt_room_rate_create_params); + $request = $this->createRoomRateRequest($wt_room_rate_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createRoomRate' * * @param \OpenAPI\Client\Model\WTRoomRateCreateParams $wt_room_rate_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createRoomRateRequest($wt_room_rate_create_params) + public function createRoomRateRequest($wt_room_rate_create_params, string $contentType = self::contentTypes['createRoomRate'][0]) { + // verify the required parameter 'wt_room_rate_create_params' is set if ($wt_room_rate_create_params === null || (is_array($wt_room_rate_create_params) && count($wt_room_rate_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createRoomRateRequest($wt_room_rate_create_params) ); } + $resourcePath = '/v2/roomRates'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createRoomRateRequest($wt_room_rate_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_room_rate_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_room_rate_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_room_rate_create_params)); } else { $httpBody = $wt_room_rate_create_params; } @@ -746,12 +927,12 @@ public function createRoomRateRequest($wt_room_rate_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createRoomRateRequest($wt_room_rate_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createRoomRateRequest($wt_room_rate_create_params) * Fetch all room rates * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllRoomRates'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllRoomRates($is_archive_included = null) + public function fetchAllRoomRates($is_archive_included = null, string $contentType = self::contentTypes['fetchAllRoomRates'][0]) { - list($response) = $this->fetchAllRoomRatesWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllRoomRatesWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllRoomRates($is_archive_included = null) * Fetch all room rates * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllRoomRates'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllRoomRatesWithHttpInfo($is_archive_included = null) + public function fetchAllRoomRatesWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllRoomRates'][0]) { - $request = $this->fetchAllRoomRatesRequest($is_archive_included); + $request = $this->fetchAllRoomRatesRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllRoomRatesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllRoomRatesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllRoomRatesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllRoomRatesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllRoomRatesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllRoomRatesWithHttpInfo($is_archive_included = null) * Fetch all room rates * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllRoomRates'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllRoomRatesAsync($is_archive_included = null) + public function fetchAllRoomRatesAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllRoomRates'][0]) { - return $this->fetchAllRoomRatesAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllRoomRatesAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all room rates * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllRoomRates'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllRoomRatesAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllRoomRatesAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllRoomRates'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllRoomRatesRequest($is_archive_included); + $request = $this->fetchAllRoomRatesRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllRoomRates' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllRoomRates'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllRoomRatesRequest($is_archive_included = null) + public function fetchAllRoomRatesRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllRoomRates'][0]) { + + $resourcePath = '/v2/roomRates/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllRoomRatesRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllRoomRatesRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllRoomRatesRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllRoomRatesRequest($is_archive_included = null) * Restore room rate * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreRoomRate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\RoomRate|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreRoomRate($id) + public function restoreRoomRate($id, string $contentType = self::contentTypes['restoreRoomRate'][0]) { - list($response) = $this->restoreRoomRateWithHttpInfo($id); + list($response) = $this->restoreRoomRateWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restoreRoomRate($id) * Restore room rate * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreRoomRate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\RoomRate|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreRoomRateWithHttpInfo($id) + public function restoreRoomRateWithHttpInfo($id, string $contentType = self::contentTypes['restoreRoomRate'][0]) { - $request = $this->restoreRoomRateRequest($id); + $request = $this->restoreRoomRateRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restoreRoomRateWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\RoomRate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restoreRoomRateWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restoreRoomRateWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restoreRoomRateWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restoreRoomRateWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restoreRoomRateWithHttpInfo($id) * Restore room rate * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreRoomRateAsync($id) + public function restoreRoomRateAsync($id, string $contentType = self::contentTypes['restoreRoomRate'][0]) { - return $this->restoreRoomRateAsyncWithHttpInfo($id) + return $this->restoreRoomRateAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore room rate * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreRoomRateAsyncWithHttpInfo($id) + public function restoreRoomRateAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreRoomRate'][0]) { $returnType = '\OpenAPI\Client\Model\RoomRate'; - $request = $this->restoreRoomRateRequest($id); + $request = $this->restoreRoomRateRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restoreRoomRate' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreRoomRateRequest($id) + public function restoreRoomRateRequest($id, string $contentType = self::contentTypes['restoreRoomRate'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restoreRoomRateRequest($id) ); } + $resourcePath = '/v2/roomRates/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restoreRoomRateRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restoreRoomRateRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restoreRoomRateRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restoreRoomRateRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTRoomRateUpdateParams $wt_room_rate_update_params wt_room_rate_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRoomRate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\RoomRate|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateRoomRate($id, $wt_room_rate_update_params) + public function updateRoomRate($id, $wt_room_rate_update_params, string $contentType = self::contentTypes['updateRoomRate'][0]) { - list($response) = $this->updateRoomRateWithHttpInfo($id, $wt_room_rate_update_params); + list($response) = $this->updateRoomRateWithHttpInfo($id, $wt_room_rate_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateRoomRate($id, $wt_room_rate_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTRoomRateUpdateParams $wt_room_rate_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRoomRate'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\RoomRate|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateRoomRateWithHttpInfo($id, $wt_room_rate_update_params) + public function updateRoomRateWithHttpInfo($id, $wt_room_rate_update_params, string $contentType = self::contentTypes['updateRoomRate'][0]) { - $request = $this->updateRoomRateRequest($id, $wt_room_rate_update_params); + $request = $this->updateRoomRateRequest($id, $wt_room_rate_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateRoomRateWithHttpInfo($id, $wt_room_rate_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\RoomRate' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateRoomRateWithHttpInfo($id, $wt_room_rate_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateRoomRateWithHttpInfo($id, $wt_room_rate_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateRoomRateWithHttpInfo($id, $wt_room_rate_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateRoomRateWithHttpInfo($id, $wt_room_rate_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateRoomRateWithHttpInfo($id, $wt_room_rate_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTRoomRateUpdateParams $wt_room_rate_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateRoomRateAsync($id, $wt_room_rate_update_params) + public function updateRoomRateAsync($id, $wt_room_rate_update_params, string $contentType = self::contentTypes['updateRoomRate'][0]) { - return $this->updateRoomRateAsyncWithHttpInfo($id, $wt_room_rate_update_params) + return $this->updateRoomRateAsyncWithHttpInfo($id, $wt_room_rate_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTRoomRateUpdateParams $wt_room_rate_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateRoomRateAsyncWithHttpInfo($id, $wt_room_rate_update_params) + public function updateRoomRateAsyncWithHttpInfo($id, $wt_room_rate_update_params, string $contentType = self::contentTypes['updateRoomRate'][0]) { $returnType = '\OpenAPI\Client\Model\RoomRate'; - $request = $this->updateRoomRateRequest($id, $wt_room_rate_update_params); + $request = $this->updateRoomRateRequest($id, $wt_room_rate_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTRoomRateUpdateParams $wt_room_rate_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateRoomRate'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateRoomRateRequest($id, $wt_room_rate_update_params) + public function updateRoomRateRequest($id, $wt_room_rate_update_params, string $contentType = self::contentTypes['updateRoomRate'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateRoomRate' ); } + // verify the required parameter 'wt_room_rate_update_params' is set if ($wt_room_rate_update_params === null || (is_array($wt_room_rate_update_params) && count($wt_room_rate_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateRoomRateRequest($id, $wt_room_rate_update_params) ); } + $resourcePath = '/v2/roomRates/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateRoomRateRequest($id, $wt_room_rate_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_room_rate_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_room_rate_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_room_rate_update_params)); } else { $httpBody = $wt_room_rate_update_params; } @@ -1753,12 +2177,12 @@ public function updateRoomRateRequest($id, $wt_room_rate_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateRoomRateRequest($id, $wt_room_rate_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/SMSApi.php b/lib/Api/SMSApi.php index 066dfe4..3487a3f 100644 --- a/lib/Api/SMSApi.php +++ b/lib/Api/SMSApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'archivePhoneNumber' => [ + 'application/json', + ], + 'archiveRecipient' => [ + 'application/json', + ], + 'countImportedListRecipients' => [ + 'application/json', + ], + 'countOptInListSubscribers' => [ + 'application/json', + ], + 'countOptInSourceSubscribers' => [ + 'application/json', + ], + 'countOutboundSMS' => [ + 'application/json', + ], + 'createImportedList' => [ + 'application/json', + ], + 'createOptInList' => [ + 'application/json', + ], + 'createOptInListSource' => [ + 'application/json', + ], + 'createRecipientInImportedList' => [ + 'application/json', + ], + 'exportImportedListRecipients' => [ + 'application/json', + ], + 'exportOptInListSubscribers' => [ + 'application/json', + ], + 'fetchBlockedTCPAEntries' => [ + 'application/json', + ], + 'fetchImportedListRecipients' => [ + 'application/json', + ], + 'fetchImportedListRecipientsByPage' => [ + 'application/json', + ], + 'fetchOptInListSources' => [ + 'application/json', + ], + 'fetchOptInListSubscribers' => [ + 'application/json', + ], + 'fetchOptInListSubscribersByPage' => [ + 'application/json', + ], + 'fetchOptInListsAssociatedWithPhoneNumber' => [ + 'application/json', + ], + 'fetchOptInSourceSubscribers' => [ + 'application/json', + ], + 'fetchOptInSourcesAssociatedWithPhoneNumber' => [ + 'application/json', + ], + 'fetchOutboundSMS' => [ + 'application/json', + ], + 'fetchOutboundSMSByPage' => [ + 'application/json', + ], + 'fetchPaymentObjectBroadcasts' => [ + 'application/json', + ], + 'fetchSMSAgreement' => [ + 'application/json', + ], + 'importImportedListRecipients' => [ + 'application/json', + ], + 'importImportedListRecipientsFromMembershipTier' => [ + 'application/json', + ], + 'importOptInListSubscribers' => [ + 'application/json', + ], + 'restorePhoneNumber' => [ + 'application/json', + ], + 'restoreRecipient' => [ + 'application/json', + ], + 'retrieveSentAndMaxCountOfMessages' => [ + 'application/json', + ], + 'saveImportedList' => [ + 'application/json', + ], + 'saveOptInList' => [ + 'application/json', + ], + 'saveOptInListSource' => [ + 'application/json', + ], + 'sendPhoneNumberForVerification' => [ + 'application/json', + ], + 'updatePhoneNumber' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +237,15 @@ public function getConfig() * Acquire phone number * * @param \OpenAPI\Client\Model\WTSMSAcquirePhoneNumber $wtsms_acquire_phone_number wtsms_acquire_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acquirePhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PhoneNumber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function acquirePhoneNumber($wtsms_acquire_phone_number) + public function acquirePhoneNumber($wtsms_acquire_phone_number, string $contentType = self::contentTypes['acquirePhoneNumber'][0]) { - list($response) = $this->acquirePhoneNumberWithHttpInfo($wtsms_acquire_phone_number); + list($response) = $this->acquirePhoneNumberWithHttpInfo($wtsms_acquire_phone_number, $contentType); return $response; } @@ -139,14 +255,15 @@ public function acquirePhoneNumber($wtsms_acquire_phone_number) * Acquire phone number * * @param \OpenAPI\Client\Model\WTSMSAcquirePhoneNumber $wtsms_acquire_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acquirePhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PhoneNumber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function acquirePhoneNumberWithHttpInfo($wtsms_acquire_phone_number) + public function acquirePhoneNumberWithHttpInfo($wtsms_acquire_phone_number, string $contentType = self::contentTypes['acquirePhoneNumber'][0]) { - $request = $this->acquirePhoneNumberRequest($wtsms_acquire_phone_number); + $request = $this->acquirePhoneNumberRequest($wtsms_acquire_phone_number, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +306,21 @@ public function acquirePhoneNumberWithHttpInfo($wtsms_acquire_phone_number) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PhoneNumber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +333,21 @@ public function acquirePhoneNumberWithHttpInfo($wtsms_acquire_phone_number) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +360,21 @@ public function acquirePhoneNumberWithHttpInfo($wtsms_acquire_phone_number) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +387,21 @@ public function acquirePhoneNumberWithHttpInfo($wtsms_acquire_phone_number) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +416,21 @@ public function acquirePhoneNumberWithHttpInfo($wtsms_acquire_phone_number) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +484,14 @@ public function acquirePhoneNumberWithHttpInfo($wtsms_acquire_phone_number) * Acquire phone number * * @param \OpenAPI\Client\Model\WTSMSAcquirePhoneNumber $wtsms_acquire_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acquirePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function acquirePhoneNumberAsync($wtsms_acquire_phone_number) + public function acquirePhoneNumberAsync($wtsms_acquire_phone_number, string $contentType = self::contentTypes['acquirePhoneNumber'][0]) { - return $this->acquirePhoneNumberAsyncWithHttpInfo($wtsms_acquire_phone_number) + return $this->acquirePhoneNumberAsyncWithHttpInfo($wtsms_acquire_phone_number, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +505,15 @@ function ($response) { * Acquire phone number * * @param \OpenAPI\Client\Model\WTSMSAcquirePhoneNumber $wtsms_acquire_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acquirePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function acquirePhoneNumberAsyncWithHttpInfo($wtsms_acquire_phone_number) + public function acquirePhoneNumberAsyncWithHttpInfo($wtsms_acquire_phone_number, string $contentType = self::contentTypes['acquirePhoneNumber'][0]) { $returnType = '\OpenAPI\Client\Model\PhoneNumber'; - $request = $this->acquirePhoneNumberRequest($wtsms_acquire_phone_number); + $request = $this->acquirePhoneNumberRequest($wtsms_acquire_phone_number, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +523,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +555,14 @@ function ($exception) { * Create request for operation 'acquirePhoneNumber' * * @param \OpenAPI\Client\Model\WTSMSAcquirePhoneNumber $wtsms_acquire_phone_number (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['acquirePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function acquirePhoneNumberRequest($wtsms_acquire_phone_number) + public function acquirePhoneNumberRequest($wtsms_acquire_phone_number, string $contentType = self::contentTypes['acquirePhoneNumber'][0]) { + // verify the required parameter 'wtsms_acquire_phone_number' is set if ($wtsms_acquire_phone_number === null || (is_array($wtsms_acquire_phone_number) && count($wtsms_acquire_phone_number) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +570,7 @@ public function acquirePhoneNumberRequest($wtsms_acquire_phone_number) ); } + $resourcePath = '/v2/sms/phoneNumber/acquire'; $formParams = []; $queryParams = []; @@ -382,21 +582,17 @@ public function acquirePhoneNumberRequest($wtsms_acquire_phone_number) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wtsms_acquire_phone_number)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wtsms_acquire_phone_number)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wtsms_acquire_phone_number)); } else { $httpBody = $wtsms_acquire_phone_number; } @@ -415,12 +611,12 @@ public function acquirePhoneNumberRequest($wtsms_acquire_phone_number) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -436,10 +632,11 @@ public function acquirePhoneNumberRequest($wtsms_acquire_phone_number) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -451,14 +648,15 @@ public function acquirePhoneNumberRequest($wtsms_acquire_phone_number) * Archive phone number * * @param string $phone_number_id phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PhoneNumber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archivePhoneNumber($phone_number_id) + public function archivePhoneNumber($phone_number_id, string $contentType = self::contentTypes['archivePhoneNumber'][0]) { - list($response) = $this->archivePhoneNumberWithHttpInfo($phone_number_id); + list($response) = $this->archivePhoneNumberWithHttpInfo($phone_number_id, $contentType); return $response; } @@ -468,14 +666,15 @@ public function archivePhoneNumber($phone_number_id) * Archive phone number * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PhoneNumber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archivePhoneNumberWithHttpInfo($phone_number_id) + public function archivePhoneNumberWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['archivePhoneNumber'][0]) { - $request = $this->archivePhoneNumberRequest($phone_number_id); + $request = $this->archivePhoneNumberRequest($phone_number_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -518,6 +717,21 @@ public function archivePhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PhoneNumber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -530,6 +744,21 @@ public function archivePhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -542,6 +771,21 @@ public function archivePhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -554,6 +798,21 @@ public function archivePhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -568,6 +827,21 @@ public function archivePhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -621,13 +895,14 @@ public function archivePhoneNumberWithHttpInfo($phone_number_id) * Archive phone number * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePhoneNumberAsync($phone_number_id) + public function archivePhoneNumberAsync($phone_number_id, string $contentType = self::contentTypes['archivePhoneNumber'][0]) { - return $this->archivePhoneNumberAsyncWithHttpInfo($phone_number_id) + return $this->archivePhoneNumberAsyncWithHttpInfo($phone_number_id, $contentType) ->then( function ($response) { return $response[0]; @@ -641,14 +916,15 @@ function ($response) { * Archive phone number * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archivePhoneNumberAsyncWithHttpInfo($phone_number_id) + public function archivePhoneNumberAsyncWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['archivePhoneNumber'][0]) { $returnType = '\OpenAPI\Client\Model\PhoneNumber'; - $request = $this->archivePhoneNumberRequest($phone_number_id); + $request = $this->archivePhoneNumberRequest($phone_number_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -658,6 +934,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -687,12 +966,14 @@ function ($exception) { * Create request for operation 'archivePhoneNumber' * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archivePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archivePhoneNumberRequest($phone_number_id) + public function archivePhoneNumberRequest($phone_number_id, string $contentType = self::contentTypes['archivePhoneNumber'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -708,7 +989,7 @@ public function archivePhoneNumberRequest($phone_number_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling SMSApi.archivePhoneNumber, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/phoneNumber/{phoneNumberID}'; $formParams = []; @@ -729,16 +1010,11 @@ public function archivePhoneNumberRequest($phone_number_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -756,12 +1032,12 @@ public function archivePhoneNumberRequest($phone_number_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -777,10 +1053,11 @@ public function archivePhoneNumberRequest($phone_number_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -792,14 +1069,15 @@ public function archivePhoneNumberRequest($phone_number_id) * Archive recipient * * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveRecipient'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ImportedListRecipient|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveRecipient($id) + public function archiveRecipient($id, string $contentType = self::contentTypes['archiveRecipient'][0]) { - list($response) = $this->archiveRecipientWithHttpInfo($id); + list($response) = $this->archiveRecipientWithHttpInfo($id, $contentType); return $response; } @@ -809,14 +1087,15 @@ public function archiveRecipient($id) * Archive recipient * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveRecipient'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ImportedListRecipient|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveRecipientWithHttpInfo($id) + public function archiveRecipientWithHttpInfo($id, string $contentType = self::contentTypes['archiveRecipient'][0]) { - $request = $this->archiveRecipientRequest($id); + $request = $this->archiveRecipientRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -859,6 +1138,21 @@ public function archiveRecipientWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ImportedListRecipient' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -871,6 +1165,21 @@ public function archiveRecipientWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -883,6 +1192,21 @@ public function archiveRecipientWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -895,6 +1219,21 @@ public function archiveRecipientWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -909,6 +1248,21 @@ public function archiveRecipientWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -962,13 +1316,14 @@ public function archiveRecipientWithHttpInfo($id) * Archive recipient * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveRecipientAsync($id) + public function archiveRecipientAsync($id, string $contentType = self::contentTypes['archiveRecipient'][0]) { - return $this->archiveRecipientAsyncWithHttpInfo($id) + return $this->archiveRecipientAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -982,14 +1337,15 @@ function ($response) { * Archive recipient * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveRecipientAsyncWithHttpInfo($id) + public function archiveRecipientAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveRecipient'][0]) { $returnType = '\OpenAPI\Client\Model\ImportedListRecipient'; - $request = $this->archiveRecipientRequest($id); + $request = $this->archiveRecipientRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -999,6 +1355,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1028,12 +1387,14 @@ function ($exception) { * Create request for operation 'archiveRecipient' * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveRecipientRequest($id) + public function archiveRecipientRequest($id, string $contentType = self::contentTypes['archiveRecipient'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1049,7 +1410,7 @@ public function archiveRecipientRequest($id) if (!preg_match("/^[a-zA-Z0-9]+$/", $id)) { throw new \InvalidArgumentException("invalid value for \"id\" when calling SMSApi.archiveRecipient, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/importedList/recipients/{id}'; $formParams = []; @@ -1070,16 +1431,11 @@ public function archiveRecipientRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1097,12 +1453,12 @@ public function archiveRecipientRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1118,10 +1474,11 @@ public function archiveRecipientRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1136,14 +1493,15 @@ public function archiveRecipientRequest($id) * @param bool $is_archive_included is_archive_included (optional) * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countImportedListRecipients'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countImportedListRecipients($list_id, $is_archive_included = null, $start_date = null, $end_date = null) + public function countImportedListRecipients($list_id, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countImportedListRecipients'][0]) { - list($response) = $this->countImportedListRecipientsWithHttpInfo($list_id, $is_archive_included, $start_date, $end_date); + list($response) = $this->countImportedListRecipientsWithHttpInfo($list_id, $is_archive_included, $start_date, $end_date, $contentType); return $response; } @@ -1156,14 +1514,15 @@ public function countImportedListRecipients($list_id, $is_archive_included = nul * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countImportedListRecipients'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countImportedListRecipientsWithHttpInfo($list_id, $is_archive_included = null, $start_date = null, $end_date = null) + public function countImportedListRecipientsWithHttpInfo($list_id, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countImportedListRecipients'][0]) { - $request = $this->countImportedListRecipientsRequest($list_id, $is_archive_included, $start_date, $end_date); + $request = $this->countImportedListRecipientsRequest($list_id, $is_archive_included, $start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -1206,6 +1565,21 @@ public function countImportedListRecipientsWithHttpInfo($list_id, $is_archive_in $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1218,6 +1592,21 @@ public function countImportedListRecipientsWithHttpInfo($list_id, $is_archive_in $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1230,6 +1619,21 @@ public function countImportedListRecipientsWithHttpInfo($list_id, $is_archive_in $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1242,6 +1646,21 @@ public function countImportedListRecipientsWithHttpInfo($list_id, $is_archive_in $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1256,6 +1675,21 @@ public function countImportedListRecipientsWithHttpInfo($list_id, $is_archive_in $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1312,13 +1746,14 @@ public function countImportedListRecipientsWithHttpInfo($list_id, $is_archive_in * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countImportedListRecipientsAsync($list_id, $is_archive_included = null, $start_date = null, $end_date = null) + public function countImportedListRecipientsAsync($list_id, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countImportedListRecipients'][0]) { - return $this->countImportedListRecipientsAsyncWithHttpInfo($list_id, $is_archive_included, $start_date, $end_date) + return $this->countImportedListRecipientsAsyncWithHttpInfo($list_id, $is_archive_included, $start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -1335,14 +1770,15 @@ function ($response) { * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countImportedListRecipientsAsyncWithHttpInfo($list_id, $is_archive_included = null, $start_date = null, $end_date = null) + public function countImportedListRecipientsAsyncWithHttpInfo($list_id, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countImportedListRecipients'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countImportedListRecipientsRequest($list_id, $is_archive_included, $start_date, $end_date); + $request = $this->countImportedListRecipientsRequest($list_id, $is_archive_included, $start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1352,6 +1788,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1384,12 +1823,14 @@ function ($exception) { * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countImportedListRecipientsRequest($list_id, $is_archive_included = null, $start_date = null, $end_date = null) + public function countImportedListRecipientsRequest($list_id, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countImportedListRecipients'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -1405,6 +1846,9 @@ public function countImportedListRecipientsRequest($list_id, $is_archive_include if (!preg_match("/^[a-zA-Z0-9]+$/", $list_id)) { throw new \InvalidArgumentException("invalid value for \"list_id\" when calling SMSApi.countImportedListRecipients, must conform to the pattern /^[a-zA-Z0-9]+$/."); } + + + $resourcePath = '/v2/sms/importedList/recipients/count/{listID}'; @@ -1415,38 +1859,32 @@ public function countImportedListRecipientsRequest($list_id, $is_archive_include $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -1459,16 +1897,11 @@ public function countImportedListRecipientsRequest($list_id, $is_archive_include } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1486,12 +1919,12 @@ public function countImportedListRecipientsRequest($list_id, $is_archive_include // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1507,10 +1940,11 @@ public function countImportedListRecipientsRequest($list_id, $is_archive_include $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1527,14 +1961,15 @@ public function countImportedListRecipientsRequest($list_id, $is_archive_include * @param bool $is_archive_included is_archive_included (optional) * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInListSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countOptInListSubscribers($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countOptInListSubscribers($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countOptInListSubscribers'][0]) { - list($response) = $this->countOptInListSubscribersWithHttpInfo($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date); + list($response) = $this->countOptInListSubscribersWithHttpInfo($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType); return $response; } @@ -1549,14 +1984,15 @@ public function countOptInListSubscribers($list_id, $is_subscribed = null, $is_p * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInListSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countOptInListSubscribers'][0]) { - $request = $this->countOptInListSubscribersRequest($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date); + $request = $this->countOptInListSubscribersRequest($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -1599,6 +2035,21 @@ public function countOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1611,6 +2062,21 @@ public function countOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1623,6 +2089,21 @@ public function countOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1635,6 +2116,21 @@ public function countOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1649,6 +2145,21 @@ public function countOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1707,13 +2218,14 @@ public function countOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countOptInListSubscribersAsync($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countOptInListSubscribersAsync($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countOptInListSubscribers'][0]) { - return $this->countOptInListSubscribersAsyncWithHttpInfo($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date) + return $this->countOptInListSubscribersAsyncWithHttpInfo($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -1732,14 +2244,15 @@ function ($response) { * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countOptInListSubscribersAsyncWithHttpInfo($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countOptInListSubscribersAsyncWithHttpInfo($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countOptInListSubscribers'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countOptInListSubscribersRequest($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date); + $request = $this->countOptInListSubscribersRequest($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1749,6 +2262,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1783,12 +2299,14 @@ function ($exception) { * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countOptInListSubscribersRequest($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countOptInListSubscribersRequest($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countOptInListSubscribers'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -1804,6 +2322,11 @@ public function countOptInListSubscribersRequest($list_id, $is_subscribed = null if (!preg_match("/^[a-zA-Z0-9]+$/", $list_id)) { throw new \InvalidArgumentException("invalid value for \"list_id\" when calling SMSApi.countOptInListSubscribers, must conform to the pattern /^[a-zA-Z0-9]+$/."); } + + + + + $resourcePath = '/v2/sms/optInList/subscribers/count/{listID}'; @@ -1814,60 +2337,50 @@ public function countOptInListSubscribersRequest($list_id, $is_subscribed = null $multipart = false; // query params - if ($is_subscribed !== null) { - if('form' === 'form' && is_array($is_subscribed)) { - foreach($is_subscribed as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isSubscribed'] = $is_subscribed; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_subscribed, + 'isSubscribed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_pending_age21_verification !== null) { - if('form' === 'form' && is_array($is_pending_age21_verification)) { - foreach($is_pending_age21_verification as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isPendingAge21Verification'] = $is_pending_age21_verification; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_pending_age21_verification, + 'isPendingAge21Verification', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -1880,16 +2393,11 @@ public function countOptInListSubscribersRequest($list_id, $is_subscribed = null } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1907,12 +2415,12 @@ public function countOptInListSubscribersRequest($list_id, $is_subscribed = null // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1928,10 +2436,11 @@ public function countOptInListSubscribersRequest($list_id, $is_subscribed = null $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1948,14 +2457,15 @@ public function countOptInListSubscribersRequest($list_id, $is_subscribed = null * @param bool $is_archive_included is_archive_included (optional) * @param \DateTime $start_date start_date (optional) * @param \DateTime $end_date end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInSourceSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countOptInSourceSubscribers($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countOptInSourceSubscribers($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countOptInSourceSubscribers'][0]) { - list($response) = $this->countOptInSourceSubscribersWithHttpInfo($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date); + list($response) = $this->countOptInSourceSubscribersWithHttpInfo($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType); return $response; } @@ -1970,14 +2480,15 @@ public function countOptInSourceSubscribers($source_id, $is_subscribed = null, $ * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInSourceSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countOptInSourceSubscribersWithHttpInfo($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countOptInSourceSubscribersWithHttpInfo($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countOptInSourceSubscribers'][0]) { - $request = $this->countOptInSourceSubscribersRequest($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date); + $request = $this->countOptInSourceSubscribersRequest($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -2020,6 +2531,21 @@ public function countOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2032,6 +2558,21 @@ public function countOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2044,6 +2585,21 @@ public function countOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2056,6 +2612,21 @@ public function countOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2070,6 +2641,21 @@ public function countOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2128,13 +2714,14 @@ public function countOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInSourceSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countOptInSourceSubscribersAsync($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countOptInSourceSubscribersAsync($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countOptInSourceSubscribers'][0]) { - return $this->countOptInSourceSubscribersAsyncWithHttpInfo($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date) + return $this->countOptInSourceSubscribersAsyncWithHttpInfo($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType) ->then( function ($response) { return $response[0]; @@ -2153,14 +2740,15 @@ function ($response) { * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInSourceSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countOptInSourceSubscribersAsyncWithHttpInfo($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countOptInSourceSubscribersAsyncWithHttpInfo($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countOptInSourceSubscribers'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countOptInSourceSubscribersRequest($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date); + $request = $this->countOptInSourceSubscribersRequest($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $start_date, $end_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2170,6 +2758,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2204,12 +2795,14 @@ function ($exception) { * @param bool $is_archive_included (optional) * @param \DateTime $start_date (optional) * @param \DateTime $end_date (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOptInSourceSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countOptInSourceSubscribersRequest($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null) + public function countOptInSourceSubscribersRequest($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, $start_date = null, $end_date = null, string $contentType = self::contentTypes['countOptInSourceSubscribers'][0]) { + // verify the required parameter 'source_id' is set if ($source_id === null || (is_array($source_id) && count($source_id) === 0)) { throw new \InvalidArgumentException( @@ -2225,6 +2818,11 @@ public function countOptInSourceSubscribersRequest($source_id, $is_subscribed = if (!preg_match("/^[a-zA-Z0-9]+$/", $source_id)) { throw new \InvalidArgumentException("invalid value for \"source_id\" when calling SMSApi.countOptInSourceSubscribers, must conform to the pattern /^[a-zA-Z0-9]+$/."); } + + + + + $resourcePath = '/v2/sms/optInSource/subscribers/count/{sourceID}'; @@ -2235,60 +2833,50 @@ public function countOptInSourceSubscribersRequest($source_id, $is_subscribed = $multipart = false; // query params - if ($is_subscribed !== null) { - if('form' === 'form' && is_array($is_subscribed)) { - foreach($is_subscribed as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isSubscribed'] = $is_subscribed; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_subscribed, + 'isSubscribed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_pending_age21_verification !== null) { - if('form' === 'form' && is_array($is_pending_age21_verification)) { - foreach($is_pending_age21_verification as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isPendingAge21Verification'] = $is_pending_age21_verification; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_pending_age21_verification, + 'isPendingAge21Verification', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($start_date !== null) { - if('form' === 'form' && is_array($start_date)) { - foreach($start_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDate'] = $start_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date, + 'startDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($end_date !== null) { - if('form' === 'form' && is_array($end_date)) { - foreach($end_date as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDate'] = $end_date; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date, + 'endDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -2301,16 +2889,11 @@ public function countOptInSourceSubscribersRequest($source_id, $is_subscribed = } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2328,12 +2911,12 @@ public function countOptInSourceSubscribersRequest($source_id, $is_subscribed = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2349,10 +2932,11 @@ public function countOptInSourceSubscribersRequest($source_id, $is_subscribed = $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2367,14 +2951,15 @@ public function countOptInSourceSubscribersRequest($source_id, $is_subscribed = * @param string $to_phone_number to_phone_number (optional) * @param string $status status (optional) * @param string $payment_object_broadcast_id payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOutboundSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countOutboundSMS($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null) + public function countOutboundSMS($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['countOutboundSMS'][0]) { - list($response) = $this->countOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id); + list($response) = $this->countOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id, $contentType); return $response; } @@ -2387,14 +2972,15 @@ public function countOutboundSMS($phone_number_id, $to_phone_number = null, $sta * @param string $to_phone_number (optional) * @param string $status (optional) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOutboundSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null) + public function countOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['countOutboundSMS'][0]) { - $request = $this->countOutboundSMSRequest($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id); + $request = $this->countOutboundSMSRequest($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2437,6 +3023,21 @@ public function countOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2449,6 +3050,21 @@ public function countOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2461,6 +3077,21 @@ public function countOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2473,6 +3104,21 @@ public function countOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2487,6 +3133,21 @@ public function countOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2543,13 +3204,14 @@ public function countOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number * @param string $to_phone_number (optional) * @param string $status (optional) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOutboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countOutboundSMSAsync($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null) + public function countOutboundSMSAsync($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['countOutboundSMS'][0]) { - return $this->countOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id) + return $this->countOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2566,14 +3228,15 @@ function ($response) { * @param string $to_phone_number (optional) * @param string $status (optional) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOutboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null) + public function countOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['countOutboundSMS'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->countOutboundSMSRequest($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id); + $request = $this->countOutboundSMSRequest($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2583,6 +3246,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2615,12 +3281,14 @@ function ($exception) { * @param string $to_phone_number (optional) * @param string $status (optional) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countOutboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countOutboundSMSRequest($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null) + public function countOutboundSMSRequest($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['countOutboundSMS'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -2636,6 +3304,8 @@ public function countOutboundSMSRequest($phone_number_id, $to_phone_number = nul if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling SMSApi.countOutboundSMS, must conform to the pattern /^[a-zA-Z0-9]+$/."); } + + if ($payment_object_broadcast_id !== null && strlen($payment_object_broadcast_id) > 10) { throw new \InvalidArgumentException('invalid length for "$payment_object_broadcast_id" when calling SMSApi.countOutboundSMS, must be smaller than or equal to 10.'); @@ -2646,7 +3316,7 @@ public function countOutboundSMSRequest($phone_number_id, $to_phone_number = nul if ($payment_object_broadcast_id !== null && !preg_match("/^[a-zA-Z0-9]+$/", $payment_object_broadcast_id)) { throw new \InvalidArgumentException("invalid value for \"payment_object_broadcast_id\" when calling SMSApi.countOutboundSMS, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/outbound/count/{phoneNumberID}'; $formParams = []; @@ -2656,38 +3326,32 @@ public function countOutboundSMSRequest($phone_number_id, $to_phone_number = nul $multipart = false; // query params - if ($to_phone_number !== null) { - if('form' === 'form' && is_array($to_phone_number)) { - foreach($to_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['toPhoneNumber'] = $to_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_phone_number, + 'toPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($status !== null) { - if('form' === 'form' && is_array($status)) { - foreach($status as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['status'] = $status; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($payment_object_broadcast_id !== null) { - if('form' === 'form' && is_array($payment_object_broadcast_id)) { - foreach($payment_object_broadcast_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['paymentObjectBroadcastID'] = $payment_object_broadcast_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payment_object_broadcast_id, + 'paymentObjectBroadcastID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -2700,16 +3364,11 @@ public function countOutboundSMSRequest($phone_number_id, $to_phone_number = nul } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2727,12 +3386,12 @@ public function countOutboundSMSRequest($phone_number_id, $to_phone_number = nul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2748,10 +3407,11 @@ public function countOutboundSMSRequest($phone_number_id, $to_phone_number = nul $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2763,14 +3423,15 @@ public function countOutboundSMSRequest($phone_number_id, $to_phone_number = nul * Create imported list * * @param \OpenAPI\Client\Model\WTSMSImportedListCreate $wtsms_imported_list_create wtsms_imported_list_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createImportedList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ImportedList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createImportedList($wtsms_imported_list_create) + public function createImportedList($wtsms_imported_list_create, string $contentType = self::contentTypes['createImportedList'][0]) { - list($response) = $this->createImportedListWithHttpInfo($wtsms_imported_list_create); + list($response) = $this->createImportedListWithHttpInfo($wtsms_imported_list_create, $contentType); return $response; } @@ -2780,14 +3441,15 @@ public function createImportedList($wtsms_imported_list_create) * Create imported list * * @param \OpenAPI\Client\Model\WTSMSImportedListCreate $wtsms_imported_list_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createImportedList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ImportedList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createImportedListWithHttpInfo($wtsms_imported_list_create) + public function createImportedListWithHttpInfo($wtsms_imported_list_create, string $contentType = self::contentTypes['createImportedList'][0]) { - $request = $this->createImportedListRequest($wtsms_imported_list_create); + $request = $this->createImportedListRequest($wtsms_imported_list_create, $contentType); try { $options = $this->createHttpClientOption(); @@ -2830,6 +3492,21 @@ public function createImportedListWithHttpInfo($wtsms_imported_list_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ImportedList' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2842,6 +3519,21 @@ public function createImportedListWithHttpInfo($wtsms_imported_list_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2854,6 +3546,21 @@ public function createImportedListWithHttpInfo($wtsms_imported_list_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2866,6 +3573,21 @@ public function createImportedListWithHttpInfo($wtsms_imported_list_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2880,6 +3602,21 @@ public function createImportedListWithHttpInfo($wtsms_imported_list_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2933,13 +3670,14 @@ public function createImportedListWithHttpInfo($wtsms_imported_list_create) * Create imported list * * @param \OpenAPI\Client\Model\WTSMSImportedListCreate $wtsms_imported_list_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createImportedListAsync($wtsms_imported_list_create) + public function createImportedListAsync($wtsms_imported_list_create, string $contentType = self::contentTypes['createImportedList'][0]) { - return $this->createImportedListAsyncWithHttpInfo($wtsms_imported_list_create) + return $this->createImportedListAsyncWithHttpInfo($wtsms_imported_list_create, $contentType) ->then( function ($response) { return $response[0]; @@ -2953,14 +3691,15 @@ function ($response) { * Create imported list * * @param \OpenAPI\Client\Model\WTSMSImportedListCreate $wtsms_imported_list_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createImportedListAsyncWithHttpInfo($wtsms_imported_list_create) + public function createImportedListAsyncWithHttpInfo($wtsms_imported_list_create, string $contentType = self::contentTypes['createImportedList'][0]) { $returnType = '\OpenAPI\Client\Model\ImportedList'; - $request = $this->createImportedListRequest($wtsms_imported_list_create); + $request = $this->createImportedListRequest($wtsms_imported_list_create, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2970,6 +3709,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2999,12 +3741,14 @@ function ($exception) { * Create request for operation 'createImportedList' * * @param \OpenAPI\Client\Model\WTSMSImportedListCreate $wtsms_imported_list_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createImportedListRequest($wtsms_imported_list_create) + public function createImportedListRequest($wtsms_imported_list_create, string $contentType = self::contentTypes['createImportedList'][0]) { + // verify the required parameter 'wtsms_imported_list_create' is set if ($wtsms_imported_list_create === null || (is_array($wtsms_imported_list_create) && count($wtsms_imported_list_create) === 0)) { throw new \InvalidArgumentException( @@ -3012,6 +3756,7 @@ public function createImportedListRequest($wtsms_imported_list_create) ); } + $resourcePath = '/v2/sms/importedList'; $formParams = []; $queryParams = []; @@ -3023,21 +3768,17 @@ public function createImportedListRequest($wtsms_imported_list_create) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wtsms_imported_list_create)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wtsms_imported_list_create)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wtsms_imported_list_create)); } else { $httpBody = $wtsms_imported_list_create; } @@ -3056,12 +3797,12 @@ public function createImportedListRequest($wtsms_imported_list_create) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3077,10 +3818,11 @@ public function createImportedListRequest($wtsms_imported_list_create) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3092,14 +3834,15 @@ public function createImportedListRequest($wtsms_imported_list_create) * Create opt in list * * @param \OpenAPI\Client\Model\WTOptInListCreationParams $wt_opt_in_list_creation_params wt_opt_in_list_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOptInList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OptInList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createOptInList($wt_opt_in_list_creation_params) + public function createOptInList($wt_opt_in_list_creation_params, string $contentType = self::contentTypes['createOptInList'][0]) { - list($response) = $this->createOptInListWithHttpInfo($wt_opt_in_list_creation_params); + list($response) = $this->createOptInListWithHttpInfo($wt_opt_in_list_creation_params, $contentType); return $response; } @@ -3109,14 +3852,15 @@ public function createOptInList($wt_opt_in_list_creation_params) * Create opt in list * * @param \OpenAPI\Client\Model\WTOptInListCreationParams $wt_opt_in_list_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOptInList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OptInList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createOptInListWithHttpInfo($wt_opt_in_list_creation_params) + public function createOptInListWithHttpInfo($wt_opt_in_list_creation_params, string $contentType = self::contentTypes['createOptInList'][0]) { - $request = $this->createOptInListRequest($wt_opt_in_list_creation_params); + $request = $this->createOptInListRequest($wt_opt_in_list_creation_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -3159,6 +3903,21 @@ public function createOptInListWithHttpInfo($wt_opt_in_list_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptInList' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3171,6 +3930,21 @@ public function createOptInListWithHttpInfo($wt_opt_in_list_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3183,6 +3957,21 @@ public function createOptInListWithHttpInfo($wt_opt_in_list_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3195,6 +3984,21 @@ public function createOptInListWithHttpInfo($wt_opt_in_list_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3209,6 +4013,21 @@ public function createOptInListWithHttpInfo($wt_opt_in_list_creation_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3262,13 +4081,14 @@ public function createOptInListWithHttpInfo($wt_opt_in_list_creation_params) * Create opt in list * * @param \OpenAPI\Client\Model\WTOptInListCreationParams $wt_opt_in_list_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOptInList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createOptInListAsync($wt_opt_in_list_creation_params) + public function createOptInListAsync($wt_opt_in_list_creation_params, string $contentType = self::contentTypes['createOptInList'][0]) { - return $this->createOptInListAsyncWithHttpInfo($wt_opt_in_list_creation_params) + return $this->createOptInListAsyncWithHttpInfo($wt_opt_in_list_creation_params, $contentType) ->then( function ($response) { return $response[0]; @@ -3282,14 +4102,15 @@ function ($response) { * Create opt in list * * @param \OpenAPI\Client\Model\WTOptInListCreationParams $wt_opt_in_list_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOptInList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createOptInListAsyncWithHttpInfo($wt_opt_in_list_creation_params) + public function createOptInListAsyncWithHttpInfo($wt_opt_in_list_creation_params, string $contentType = self::contentTypes['createOptInList'][0]) { $returnType = '\OpenAPI\Client\Model\OptInList'; - $request = $this->createOptInListRequest($wt_opt_in_list_creation_params); + $request = $this->createOptInListRequest($wt_opt_in_list_creation_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3299,6 +4120,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3328,12 +4152,14 @@ function ($exception) { * Create request for operation 'createOptInList' * * @param \OpenAPI\Client\Model\WTOptInListCreationParams $wt_opt_in_list_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOptInList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createOptInListRequest($wt_opt_in_list_creation_params) + public function createOptInListRequest($wt_opt_in_list_creation_params, string $contentType = self::contentTypes['createOptInList'][0]) { + // verify the required parameter 'wt_opt_in_list_creation_params' is set if ($wt_opt_in_list_creation_params === null || (is_array($wt_opt_in_list_creation_params) && count($wt_opt_in_list_creation_params) === 0)) { throw new \InvalidArgumentException( @@ -3341,6 +4167,7 @@ public function createOptInListRequest($wt_opt_in_list_creation_params) ); } + $resourcePath = '/v2/sms/optInList'; $formParams = []; $queryParams = []; @@ -3352,21 +4179,17 @@ public function createOptInListRequest($wt_opt_in_list_creation_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_opt_in_list_creation_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_opt_in_list_creation_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_opt_in_list_creation_params)); } else { $httpBody = $wt_opt_in_list_creation_params; } @@ -3385,12 +4208,12 @@ public function createOptInListRequest($wt_opt_in_list_creation_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3406,10 +4229,11 @@ public function createOptInListRequest($wt_opt_in_list_creation_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3421,14 +4245,15 @@ public function createOptInListRequest($wt_opt_in_list_creation_params) * Send SMS to opt in list * * @param \OpenAPI\Client\Model\WTSMSOptInListSourceCreate $wtsms_opt_in_list_source_create wtsms_opt_in_list_source_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOptInListSource'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OptInListSource|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createOptInListSource($wtsms_opt_in_list_source_create) + public function createOptInListSource($wtsms_opt_in_list_source_create, string $contentType = self::contentTypes['createOptInListSource'][0]) { - list($response) = $this->createOptInListSourceWithHttpInfo($wtsms_opt_in_list_source_create); + list($response) = $this->createOptInListSourceWithHttpInfo($wtsms_opt_in_list_source_create, $contentType); return $response; } @@ -3438,14 +4263,15 @@ public function createOptInListSource($wtsms_opt_in_list_source_create) * Send SMS to opt in list * * @param \OpenAPI\Client\Model\WTSMSOptInListSourceCreate $wtsms_opt_in_list_source_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOptInListSource'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OptInListSource|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createOptInListSourceWithHttpInfo($wtsms_opt_in_list_source_create) + public function createOptInListSourceWithHttpInfo($wtsms_opt_in_list_source_create, string $contentType = self::contentTypes['createOptInListSource'][0]) { - $request = $this->createOptInListSourceRequest($wtsms_opt_in_list_source_create); + $request = $this->createOptInListSourceRequest($wtsms_opt_in_list_source_create, $contentType); try { $options = $this->createHttpClientOption(); @@ -3488,6 +4314,21 @@ public function createOptInListSourceWithHttpInfo($wtsms_opt_in_list_source_crea $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptInListSource' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3500,6 +4341,21 @@ public function createOptInListSourceWithHttpInfo($wtsms_opt_in_list_source_crea $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3512,6 +4368,21 @@ public function createOptInListSourceWithHttpInfo($wtsms_opt_in_list_source_crea $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3524,6 +4395,21 @@ public function createOptInListSourceWithHttpInfo($wtsms_opt_in_list_source_crea $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3538,6 +4424,21 @@ public function createOptInListSourceWithHttpInfo($wtsms_opt_in_list_source_crea $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3591,13 +4492,14 @@ public function createOptInListSourceWithHttpInfo($wtsms_opt_in_list_source_crea * Send SMS to opt in list * * @param \OpenAPI\Client\Model\WTSMSOptInListSourceCreate $wtsms_opt_in_list_source_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOptInListSource'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createOptInListSourceAsync($wtsms_opt_in_list_source_create) + public function createOptInListSourceAsync($wtsms_opt_in_list_source_create, string $contentType = self::contentTypes['createOptInListSource'][0]) { - return $this->createOptInListSourceAsyncWithHttpInfo($wtsms_opt_in_list_source_create) + return $this->createOptInListSourceAsyncWithHttpInfo($wtsms_opt_in_list_source_create, $contentType) ->then( function ($response) { return $response[0]; @@ -3611,14 +4513,15 @@ function ($response) { * Send SMS to opt in list * * @param \OpenAPI\Client\Model\WTSMSOptInListSourceCreate $wtsms_opt_in_list_source_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOptInListSource'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createOptInListSourceAsyncWithHttpInfo($wtsms_opt_in_list_source_create) + public function createOptInListSourceAsyncWithHttpInfo($wtsms_opt_in_list_source_create, string $contentType = self::contentTypes['createOptInListSource'][0]) { $returnType = '\OpenAPI\Client\Model\OptInListSource'; - $request = $this->createOptInListSourceRequest($wtsms_opt_in_list_source_create); + $request = $this->createOptInListSourceRequest($wtsms_opt_in_list_source_create, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3628,6 +4531,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3657,12 +4563,14 @@ function ($exception) { * Create request for operation 'createOptInListSource' * * @param \OpenAPI\Client\Model\WTSMSOptInListSourceCreate $wtsms_opt_in_list_source_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createOptInListSource'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createOptInListSourceRequest($wtsms_opt_in_list_source_create) + public function createOptInListSourceRequest($wtsms_opt_in_list_source_create, string $contentType = self::contentTypes['createOptInListSource'][0]) { + // verify the required parameter 'wtsms_opt_in_list_source_create' is set if ($wtsms_opt_in_list_source_create === null || (is_array($wtsms_opt_in_list_source_create) && count($wtsms_opt_in_list_source_create) === 0)) { throw new \InvalidArgumentException( @@ -3670,6 +4578,7 @@ public function createOptInListSourceRequest($wtsms_opt_in_list_source_create) ); } + $resourcePath = '/v2/sms/optInListSource'; $formParams = []; $queryParams = []; @@ -3681,21 +4590,17 @@ public function createOptInListSourceRequest($wtsms_opt_in_list_source_create) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wtsms_opt_in_list_source_create)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wtsms_opt_in_list_source_create)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wtsms_opt_in_list_source_create)); } else { $httpBody = $wtsms_opt_in_list_source_create; } @@ -3714,12 +4619,12 @@ public function createOptInListSourceRequest($wtsms_opt_in_list_source_create) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3735,10 +4640,11 @@ public function createOptInListSourceRequest($wtsms_opt_in_list_source_create) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3750,14 +4656,15 @@ public function createOptInListSourceRequest($wtsms_opt_in_list_source_create) * Add new recipient in an imported list * * @param \OpenAPI\Client\Model\SSImportedListRecipientCreateParams $ss_imported_list_recipient_create_params ss_imported_list_recipient_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRecipientInImportedList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ImportedListRecipient|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createRecipientInImportedList($ss_imported_list_recipient_create_params) + public function createRecipientInImportedList($ss_imported_list_recipient_create_params, string $contentType = self::contentTypes['createRecipientInImportedList'][0]) { - list($response) = $this->createRecipientInImportedListWithHttpInfo($ss_imported_list_recipient_create_params); + list($response) = $this->createRecipientInImportedListWithHttpInfo($ss_imported_list_recipient_create_params, $contentType); return $response; } @@ -3767,14 +4674,15 @@ public function createRecipientInImportedList($ss_imported_list_recipient_create * Add new recipient in an imported list * * @param \OpenAPI\Client\Model\SSImportedListRecipientCreateParams $ss_imported_list_recipient_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRecipientInImportedList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ImportedListRecipient|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createRecipientInImportedListWithHttpInfo($ss_imported_list_recipient_create_params) + public function createRecipientInImportedListWithHttpInfo($ss_imported_list_recipient_create_params, string $contentType = self::contentTypes['createRecipientInImportedList'][0]) { - $request = $this->createRecipientInImportedListRequest($ss_imported_list_recipient_create_params); + $request = $this->createRecipientInImportedListRequest($ss_imported_list_recipient_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -3817,6 +4725,21 @@ public function createRecipientInImportedListWithHttpInfo($ss_imported_list_reci $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ImportedListRecipient' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3829,6 +4752,21 @@ public function createRecipientInImportedListWithHttpInfo($ss_imported_list_reci $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3841,6 +4779,21 @@ public function createRecipientInImportedListWithHttpInfo($ss_imported_list_reci $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3853,6 +4806,21 @@ public function createRecipientInImportedListWithHttpInfo($ss_imported_list_reci $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3867,6 +4835,21 @@ public function createRecipientInImportedListWithHttpInfo($ss_imported_list_reci $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3920,13 +4903,14 @@ public function createRecipientInImportedListWithHttpInfo($ss_imported_list_reci * Add new recipient in an imported list * * @param \OpenAPI\Client\Model\SSImportedListRecipientCreateParams $ss_imported_list_recipient_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRecipientInImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createRecipientInImportedListAsync($ss_imported_list_recipient_create_params) + public function createRecipientInImportedListAsync($ss_imported_list_recipient_create_params, string $contentType = self::contentTypes['createRecipientInImportedList'][0]) { - return $this->createRecipientInImportedListAsyncWithHttpInfo($ss_imported_list_recipient_create_params) + return $this->createRecipientInImportedListAsyncWithHttpInfo($ss_imported_list_recipient_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -3940,14 +4924,15 @@ function ($response) { * Add new recipient in an imported list * * @param \OpenAPI\Client\Model\SSImportedListRecipientCreateParams $ss_imported_list_recipient_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRecipientInImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createRecipientInImportedListAsyncWithHttpInfo($ss_imported_list_recipient_create_params) + public function createRecipientInImportedListAsyncWithHttpInfo($ss_imported_list_recipient_create_params, string $contentType = self::contentTypes['createRecipientInImportedList'][0]) { $returnType = '\OpenAPI\Client\Model\ImportedListRecipient'; - $request = $this->createRecipientInImportedListRequest($ss_imported_list_recipient_create_params); + $request = $this->createRecipientInImportedListRequest($ss_imported_list_recipient_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3957,6 +4942,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3986,12 +4974,14 @@ function ($exception) { * Create request for operation 'createRecipientInImportedList' * * @param \OpenAPI\Client\Model\SSImportedListRecipientCreateParams $ss_imported_list_recipient_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRecipientInImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createRecipientInImportedListRequest($ss_imported_list_recipient_create_params) + public function createRecipientInImportedListRequest($ss_imported_list_recipient_create_params, string $contentType = self::contentTypes['createRecipientInImportedList'][0]) { + // verify the required parameter 'ss_imported_list_recipient_create_params' is set if ($ss_imported_list_recipient_create_params === null || (is_array($ss_imported_list_recipient_create_params) && count($ss_imported_list_recipient_create_params) === 0)) { throw new \InvalidArgumentException( @@ -3999,6 +4989,7 @@ public function createRecipientInImportedListRequest($ss_imported_list_recipient ); } + $resourcePath = '/v2/sms/importedList/recipients/create'; $formParams = []; $queryParams = []; @@ -4010,21 +5001,17 @@ public function createRecipientInImportedListRequest($ss_imported_list_recipient - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($ss_imported_list_recipient_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($ss_imported_list_recipient_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($ss_imported_list_recipient_create_params)); } else { $httpBody = $ss_imported_list_recipient_create_params; } @@ -4043,12 +5030,12 @@ public function createRecipientInImportedListRequest($ss_imported_list_recipient // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4064,10 +5051,11 @@ public function createRecipientInImportedListRequest($ss_imported_list_recipient $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4079,14 +5067,15 @@ public function createRecipientInImportedListRequest($ss_imported_list_recipient * Export imported list recipients * * @param string $imported_list_id imported_list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportImportedListRecipients'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function exportImportedListRecipients($imported_list_id) + public function exportImportedListRecipients($imported_list_id, string $contentType = self::contentTypes['exportImportedListRecipients'][0]) { - list($response) = $this->exportImportedListRecipientsWithHttpInfo($imported_list_id); + list($response) = $this->exportImportedListRecipientsWithHttpInfo($imported_list_id, $contentType); return $response; } @@ -4096,14 +5085,15 @@ public function exportImportedListRecipients($imported_list_id) * Export imported list recipients * * @param string $imported_list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportImportedListRecipients'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function exportImportedListRecipientsWithHttpInfo($imported_list_id) + public function exportImportedListRecipientsWithHttpInfo($imported_list_id, string $contentType = self::contentTypes['exportImportedListRecipients'][0]) { - $request = $this->exportImportedListRecipientsRequest($imported_list_id); + $request = $this->exportImportedListRecipientsRequest($imported_list_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -4146,6 +5136,21 @@ public function exportImportedListRecipientsWithHttpInfo($imported_list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4158,6 +5163,21 @@ public function exportImportedListRecipientsWithHttpInfo($imported_list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4170,6 +5190,21 @@ public function exportImportedListRecipientsWithHttpInfo($imported_list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4182,6 +5217,21 @@ public function exportImportedListRecipientsWithHttpInfo($imported_list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4196,6 +5246,21 @@ public function exportImportedListRecipientsWithHttpInfo($imported_list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4249,13 +5314,14 @@ public function exportImportedListRecipientsWithHttpInfo($imported_list_id) * Export imported list recipients * * @param string $imported_list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportImportedListRecipientsAsync($imported_list_id) + public function exportImportedListRecipientsAsync($imported_list_id, string $contentType = self::contentTypes['exportImportedListRecipients'][0]) { - return $this->exportImportedListRecipientsAsyncWithHttpInfo($imported_list_id) + return $this->exportImportedListRecipientsAsyncWithHttpInfo($imported_list_id, $contentType) ->then( function ($response) { return $response[0]; @@ -4269,14 +5335,15 @@ function ($response) { * Export imported list recipients * * @param string $imported_list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportImportedListRecipientsAsyncWithHttpInfo($imported_list_id) + public function exportImportedListRecipientsAsyncWithHttpInfo($imported_list_id, string $contentType = self::contentTypes['exportImportedListRecipients'][0]) { $returnType = 'string'; - $request = $this->exportImportedListRecipientsRequest($imported_list_id); + $request = $this->exportImportedListRecipientsRequest($imported_list_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4286,6 +5353,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4315,12 +5385,14 @@ function ($exception) { * Create request for operation 'exportImportedListRecipients' * * @param string $imported_list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function exportImportedListRecipientsRequest($imported_list_id) + public function exportImportedListRecipientsRequest($imported_list_id, string $contentType = self::contentTypes['exportImportedListRecipients'][0]) { + // verify the required parameter 'imported_list_id' is set if ($imported_list_id === null || (is_array($imported_list_id) && count($imported_list_id) === 0)) { throw new \InvalidArgumentException( @@ -4336,7 +5408,7 @@ public function exportImportedListRecipientsRequest($imported_list_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $imported_list_id)) { throw new \InvalidArgumentException("invalid value for \"imported_list_id\" when calling SMSApi.exportImportedListRecipients, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/importedList/recipients/export/{importedListID}'; $formParams = []; @@ -4357,16 +5429,11 @@ public function exportImportedListRecipientsRequest($imported_list_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4384,12 +5451,12 @@ public function exportImportedListRecipientsRequest($imported_list_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4405,10 +5472,11 @@ public function exportImportedListRecipientsRequest($imported_list_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4420,14 +5488,15 @@ public function exportImportedListRecipientsRequest($imported_list_id) * Export opt in list subscribers * * @param string $list_id list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportOptInListSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function exportOptInListSubscribers($list_id) + public function exportOptInListSubscribers($list_id, string $contentType = self::contentTypes['exportOptInListSubscribers'][0]) { - list($response) = $this->exportOptInListSubscribersWithHttpInfo($list_id); + list($response) = $this->exportOptInListSubscribersWithHttpInfo($list_id, $contentType); return $response; } @@ -4437,14 +5506,15 @@ public function exportOptInListSubscribers($list_id) * Export opt in list subscribers * * @param string $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportOptInListSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function exportOptInListSubscribersWithHttpInfo($list_id) + public function exportOptInListSubscribersWithHttpInfo($list_id, string $contentType = self::contentTypes['exportOptInListSubscribers'][0]) { - $request = $this->exportOptInListSubscribersRequest($list_id); + $request = $this->exportOptInListSubscribersRequest($list_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -4487,6 +5557,21 @@ public function exportOptInListSubscribersWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4499,6 +5584,21 @@ public function exportOptInListSubscribersWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4511,6 +5611,21 @@ public function exportOptInListSubscribersWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4523,6 +5638,21 @@ public function exportOptInListSubscribersWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4537,6 +5667,21 @@ public function exportOptInListSubscribersWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4590,13 +5735,14 @@ public function exportOptInListSubscribersWithHttpInfo($list_id) * Export opt in list subscribers * * @param string $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportOptInListSubscribersAsync($list_id) + public function exportOptInListSubscribersAsync($list_id, string $contentType = self::contentTypes['exportOptInListSubscribers'][0]) { - return $this->exportOptInListSubscribersAsyncWithHttpInfo($list_id) + return $this->exportOptInListSubscribersAsyncWithHttpInfo($list_id, $contentType) ->then( function ($response) { return $response[0]; @@ -4610,14 +5756,15 @@ function ($response) { * Export opt in list subscribers * * @param string $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportOptInListSubscribersAsyncWithHttpInfo($list_id) + public function exportOptInListSubscribersAsyncWithHttpInfo($list_id, string $contentType = self::contentTypes['exportOptInListSubscribers'][0]) { $returnType = 'string'; - $request = $this->exportOptInListSubscribersRequest($list_id); + $request = $this->exportOptInListSubscribersRequest($list_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4627,6 +5774,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4656,12 +5806,14 @@ function ($exception) { * Create request for operation 'exportOptInListSubscribers' * * @param string $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['exportOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function exportOptInListSubscribersRequest($list_id) + public function exportOptInListSubscribersRequest($list_id, string $contentType = self::contentTypes['exportOptInListSubscribers'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -4677,7 +5829,7 @@ public function exportOptInListSubscribersRequest($list_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $list_id)) { throw new \InvalidArgumentException("invalid value for \"list_id\" when calling SMSApi.exportOptInListSubscribers, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/optInList/subscribers/export/{listID}'; $formParams = []; @@ -4698,16 +5850,11 @@ public function exportOptInListSubscribersRequest($list_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4725,12 +5872,12 @@ public function exportOptInListSubscribersRequest($list_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4746,10 +5893,11 @@ public function exportOptInListSubscribersRequest($list_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4761,14 +5909,15 @@ public function exportOptInListSubscribersRequest($list_id) * Fetch blocked TCPA entries * * @param string $phone_number_id phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchBlockedTCPAEntries'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Tcpa[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchBlockedTCPAEntries($phone_number_id) + public function fetchBlockedTCPAEntries($phone_number_id, string $contentType = self::contentTypes['fetchBlockedTCPAEntries'][0]) { - list($response) = $this->fetchBlockedTCPAEntriesWithHttpInfo($phone_number_id); + list($response) = $this->fetchBlockedTCPAEntriesWithHttpInfo($phone_number_id, $contentType); return $response; } @@ -4778,14 +5927,15 @@ public function fetchBlockedTCPAEntries($phone_number_id) * Fetch blocked TCPA entries * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchBlockedTCPAEntries'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Tcpa[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchBlockedTCPAEntriesWithHttpInfo($phone_number_id) + public function fetchBlockedTCPAEntriesWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['fetchBlockedTCPAEntries'][0]) { - $request = $this->fetchBlockedTCPAEntriesRequest($phone_number_id); + $request = $this->fetchBlockedTCPAEntriesRequest($phone_number_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -4828,6 +5978,21 @@ public function fetchBlockedTCPAEntriesWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Tcpa[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4840,6 +6005,21 @@ public function fetchBlockedTCPAEntriesWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4852,6 +6032,21 @@ public function fetchBlockedTCPAEntriesWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4864,6 +6059,21 @@ public function fetchBlockedTCPAEntriesWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4878,6 +6088,21 @@ public function fetchBlockedTCPAEntriesWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4931,13 +6156,14 @@ public function fetchBlockedTCPAEntriesWithHttpInfo($phone_number_id) * Fetch blocked TCPA entries * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchBlockedTCPAEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchBlockedTCPAEntriesAsync($phone_number_id) + public function fetchBlockedTCPAEntriesAsync($phone_number_id, string $contentType = self::contentTypes['fetchBlockedTCPAEntries'][0]) { - return $this->fetchBlockedTCPAEntriesAsyncWithHttpInfo($phone_number_id) + return $this->fetchBlockedTCPAEntriesAsyncWithHttpInfo($phone_number_id, $contentType) ->then( function ($response) { return $response[0]; @@ -4951,14 +6177,15 @@ function ($response) { * Fetch blocked TCPA entries * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchBlockedTCPAEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchBlockedTCPAEntriesAsyncWithHttpInfo($phone_number_id) + public function fetchBlockedTCPAEntriesAsyncWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['fetchBlockedTCPAEntries'][0]) { $returnType = '\OpenAPI\Client\Model\Tcpa[]'; - $request = $this->fetchBlockedTCPAEntriesRequest($phone_number_id); + $request = $this->fetchBlockedTCPAEntriesRequest($phone_number_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4968,6 +6195,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4997,12 +6227,14 @@ function ($exception) { * Create request for operation 'fetchBlockedTCPAEntries' * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchBlockedTCPAEntries'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchBlockedTCPAEntriesRequest($phone_number_id) + public function fetchBlockedTCPAEntriesRequest($phone_number_id, string $contentType = self::contentTypes['fetchBlockedTCPAEntries'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -5018,7 +6250,7 @@ public function fetchBlockedTCPAEntriesRequest($phone_number_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling SMSApi.fetchBlockedTCPAEntries, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/phoneNumber/blocked/{phoneNumberID}'; $formParams = []; @@ -5039,16 +6271,11 @@ public function fetchBlockedTCPAEntriesRequest($phone_number_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5066,12 +6293,12 @@ public function fetchBlockedTCPAEntriesRequest($phone_number_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5087,10 +6314,11 @@ public function fetchBlockedTCPAEntriesRequest($phone_number_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5102,14 +6330,15 @@ public function fetchBlockedTCPAEntriesRequest($phone_number_id) * Fetch imported list recipients * * @param string $list_id list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedListRecipients'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ImportedListRecipient[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchImportedListRecipients($list_id) + public function fetchImportedListRecipients($list_id, string $contentType = self::contentTypes['fetchImportedListRecipients'][0]) { - list($response) = $this->fetchImportedListRecipientsWithHttpInfo($list_id); + list($response) = $this->fetchImportedListRecipientsWithHttpInfo($list_id, $contentType); return $response; } @@ -5119,14 +6348,15 @@ public function fetchImportedListRecipients($list_id) * Fetch imported list recipients * * @param string $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedListRecipients'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ImportedListRecipient[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchImportedListRecipientsWithHttpInfo($list_id) + public function fetchImportedListRecipientsWithHttpInfo($list_id, string $contentType = self::contentTypes['fetchImportedListRecipients'][0]) { - $request = $this->fetchImportedListRecipientsRequest($list_id); + $request = $this->fetchImportedListRecipientsRequest($list_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -5169,6 +6399,21 @@ public function fetchImportedListRecipientsWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ImportedListRecipient[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5181,6 +6426,21 @@ public function fetchImportedListRecipientsWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5193,6 +6453,21 @@ public function fetchImportedListRecipientsWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5205,6 +6480,21 @@ public function fetchImportedListRecipientsWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5219,6 +6509,21 @@ public function fetchImportedListRecipientsWithHttpInfo($list_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5272,13 +6577,14 @@ public function fetchImportedListRecipientsWithHttpInfo($list_id) * Fetch imported list recipients * * @param string $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchImportedListRecipientsAsync($list_id) + public function fetchImportedListRecipientsAsync($list_id, string $contentType = self::contentTypes['fetchImportedListRecipients'][0]) { - return $this->fetchImportedListRecipientsAsyncWithHttpInfo($list_id) + return $this->fetchImportedListRecipientsAsyncWithHttpInfo($list_id, $contentType) ->then( function ($response) { return $response[0]; @@ -5292,14 +6598,15 @@ function ($response) { * Fetch imported list recipients * * @param string $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchImportedListRecipientsAsyncWithHttpInfo($list_id) + public function fetchImportedListRecipientsAsyncWithHttpInfo($list_id, string $contentType = self::contentTypes['fetchImportedListRecipients'][0]) { $returnType = '\OpenAPI\Client\Model\ImportedListRecipient[]'; - $request = $this->fetchImportedListRecipientsRequest($list_id); + $request = $this->fetchImportedListRecipientsRequest($list_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5309,6 +6616,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5338,12 +6648,14 @@ function ($exception) { * Create request for operation 'fetchImportedListRecipients' * * @param string $list_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchImportedListRecipientsRequest($list_id) + public function fetchImportedListRecipientsRequest($list_id, string $contentType = self::contentTypes['fetchImportedListRecipients'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -5359,7 +6671,7 @@ public function fetchImportedListRecipientsRequest($list_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $list_id)) { throw new \InvalidArgumentException("invalid value for \"list_id\" when calling SMSApi.fetchImportedListRecipients, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/importedList/recipients/{listID}'; $formParams = []; @@ -5380,16 +6692,11 @@ public function fetchImportedListRecipientsRequest($list_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5407,12 +6714,12 @@ public function fetchImportedListRecipientsRequest($list_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5428,10 +6735,11 @@ public function fetchImportedListRecipientsRequest($list_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5443,17 +6751,18 @@ public function fetchImportedListRecipientsRequest($list_id) * Fetch imported list recipients by page * * @param string $list_id list_id (required) - * @param double $page_size page_size (optional) - * @param double $page_num page_num (optional) + * @param float $page_size page_size (optional) + * @param float $page_num page_num (optional) * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedListRecipientsByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2007|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchImportedListRecipientsByPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchImportedListRecipientsByPage($list_id, $page_size = null, $page_num = null, $is_archive_included = null) + public function fetchImportedListRecipientsByPage($list_id, $page_size = null, $page_num = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchImportedListRecipientsByPage'][0]) { - list($response) = $this->fetchImportedListRecipientsByPageWithHttpInfo($list_id, $page_size, $page_num, $is_archive_included); + list($response) = $this->fetchImportedListRecipientsByPageWithHttpInfo($list_id, $page_size, $page_num, $is_archive_included, $contentType); return $response; } @@ -5463,17 +6772,18 @@ public function fetchImportedListRecipientsByPage($list_id, $page_size = null, $ * Fetch imported list recipients by page * * @param string $list_id (required) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedListRecipientsByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2007|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchImportedListRecipientsByPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchImportedListRecipientsByPageWithHttpInfo($list_id, $page_size = null, $page_num = null, $is_archive_included = null) + public function fetchImportedListRecipientsByPageWithHttpInfo($list_id, $page_size = null, $page_num = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchImportedListRecipientsByPage'][0]) { - $request = $this->fetchImportedListRecipientsByPageRequest($list_id, $page_size, $page_num, $is_archive_included); + $request = $this->fetchImportedListRecipientsByPageRequest($list_id, $page_size, $page_num, $is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -5512,14 +6822,29 @@ public function fetchImportedListRecipientsByPageWithHttpInfo($list_id, $page_si switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2007' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchImportedListRecipientsByPage200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchImportedListRecipientsByPage200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2007', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchImportedListRecipientsByPage200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5528,6 +6853,21 @@ public function fetchImportedListRecipientsByPageWithHttpInfo($list_id, $page_si $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5540,6 +6880,21 @@ public function fetchImportedListRecipientsByPageWithHttpInfo($list_id, $page_si $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5552,6 +6907,21 @@ public function fetchImportedListRecipientsByPageWithHttpInfo($list_id, $page_si $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5561,11 +6931,26 @@ public function fetchImportedListRecipientsByPageWithHttpInfo($list_id, $page_si ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2007'; + $returnType = '\OpenAPI\Client\Model\FetchImportedListRecipientsByPage200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5579,7 +6964,7 @@ public function fetchImportedListRecipientsByPageWithHttpInfo($list_id, $page_si case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2007', + '\OpenAPI\Client\Model\FetchImportedListRecipientsByPage200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5619,16 +7004,17 @@ public function fetchImportedListRecipientsByPageWithHttpInfo($list_id, $page_si * Fetch imported list recipients by page * * @param string $list_id (required) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedListRecipientsByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchImportedListRecipientsByPageAsync($list_id, $page_size = null, $page_num = null, $is_archive_included = null) + public function fetchImportedListRecipientsByPageAsync($list_id, $page_size = null, $page_num = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchImportedListRecipientsByPage'][0]) { - return $this->fetchImportedListRecipientsByPageAsyncWithHttpInfo($list_id, $page_size, $page_num, $is_archive_included) + return $this->fetchImportedListRecipientsByPageAsyncWithHttpInfo($list_id, $page_size, $page_num, $is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -5642,17 +7028,18 @@ function ($response) { * Fetch imported list recipients by page * * @param string $list_id (required) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedListRecipientsByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchImportedListRecipientsByPageAsyncWithHttpInfo($list_id, $page_size = null, $page_num = null, $is_archive_included = null) + public function fetchImportedListRecipientsByPageAsyncWithHttpInfo($list_id, $page_size = null, $page_num = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchImportedListRecipientsByPage'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2007'; - $request = $this->fetchImportedListRecipientsByPageRequest($list_id, $page_size, $page_num, $is_archive_included); + $returnType = '\OpenAPI\Client\Model\FetchImportedListRecipientsByPage200Response'; + $request = $this->fetchImportedListRecipientsByPageRequest($list_id, $page_size, $page_num, $is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5662,6 +7049,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5691,15 +7081,17 @@ function ($exception) { * Create request for operation 'fetchImportedListRecipientsByPage' * * @param string $list_id (required) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchImportedListRecipientsByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchImportedListRecipientsByPageRequest($list_id, $page_size = null, $page_num = null, $is_archive_included = null) + public function fetchImportedListRecipientsByPageRequest($list_id, $page_size = null, $page_num = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchImportedListRecipientsByPage'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -5715,6 +7107,9 @@ public function fetchImportedListRecipientsByPageRequest($list_id, $page_size = if (!preg_match("/^[a-zA-Z0-9]+$/", $list_id)) { throw new \InvalidArgumentException("invalid value for \"list_id\" when calling SMSApi.fetchImportedListRecipientsByPage, must conform to the pattern /^[a-zA-Z0-9]+$/."); } + + + $resourcePath = '/v2/sms/importedList/recipients/page/{listID}'; @@ -5725,38 +7120,32 @@ public function fetchImportedListRecipientsByPageRequest($list_id, $page_size = $multipart = false; // query params - if ($page_size !== null) { - if('form' === 'form' && is_array($page_size)) { - foreach($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageSize'] = $page_size; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_num !== null) { - if('form' === 'form' && is_array($page_num)) { - foreach($page_num as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageNum'] = $page_num; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_num, + 'pageNum', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -5769,16 +7158,11 @@ public function fetchImportedListRecipientsByPageRequest($list_id, $page_size = } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5796,12 +7180,12 @@ public function fetchImportedListRecipientsByPageRequest($list_id, $page_size = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5817,10 +7201,11 @@ public function fetchImportedListRecipientsByPageRequest($list_id, $page_size = $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5832,14 +7217,15 @@ public function fetchImportedListRecipientsByPageRequest($list_id, $page_size = * Fetch all opt in list sources * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSources'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOptInListSources($is_archive_included = null) + public function fetchOptInListSources($is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSources'][0]) { - list($response) = $this->fetchOptInListSourcesWithHttpInfo($is_archive_included); + list($response) = $this->fetchOptInListSourcesWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -5849,14 +7235,15 @@ public function fetchOptInListSources($is_archive_included = null) * Fetch all opt in list sources * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSources'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOptInListSourcesWithHttpInfo($is_archive_included = null) + public function fetchOptInListSourcesWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSources'][0]) { - $request = $this->fetchOptInListSourcesRequest($is_archive_included); + $request = $this->fetchOptInListSourcesRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -5899,6 +7286,21 @@ public function fetchOptInListSourcesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5911,6 +7313,21 @@ public function fetchOptInListSourcesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5923,6 +7340,21 @@ public function fetchOptInListSourcesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5935,6 +7367,21 @@ public function fetchOptInListSourcesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5949,6 +7396,21 @@ public function fetchOptInListSourcesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6002,13 +7464,14 @@ public function fetchOptInListSourcesWithHttpInfo($is_archive_included = null) * Fetch all opt in list sources * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSources'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListSourcesAsync($is_archive_included = null) + public function fetchOptInListSourcesAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSources'][0]) { - return $this->fetchOptInListSourcesAsyncWithHttpInfo($is_archive_included) + return $this->fetchOptInListSourcesAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -6022,14 +7485,15 @@ function ($response) { * Fetch all opt in list sources * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSources'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListSourcesAsyncWithHttpInfo($is_archive_included = null) + public function fetchOptInListSourcesAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSources'][0]) { $returnType = 'mixed'; - $request = $this->fetchOptInListSourcesRequest($is_archive_included); + $request = $this->fetchOptInListSourcesRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6039,6 +7503,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6068,13 +7535,16 @@ function ($exception) { * Create request for operation 'fetchOptInListSources' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSources'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOptInListSourcesRequest($is_archive_included = null) + public function fetchOptInListSourcesRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSources'][0]) { + + $resourcePath = '/v2/sms/optInListSources/all'; $formParams = []; $queryParams = []; @@ -6083,30 +7553,23 @@ public function fetchOptInListSourcesRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6124,12 +7587,12 @@ public function fetchOptInListSourcesRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6145,10 +7608,11 @@ public function fetchOptInListSourcesRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6163,14 +7627,15 @@ public function fetchOptInListSourcesRequest($is_archive_included = null) * @param bool $is_subscribed is_subscribed (optional) * @param bool $is_pending_age21_verification is_pending_age21_verification (optional) * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OptInListSubscriber[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOptInListSubscribers($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInListSubscribers($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSubscribers'][0]) { - list($response) = $this->fetchOptInListSubscribersWithHttpInfo($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included); + list($response) = $this->fetchOptInListSubscribersWithHttpInfo($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType); return $response; } @@ -6183,14 +7648,15 @@ public function fetchOptInListSubscribers($list_id, $is_subscribed = null, $is_p * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OptInListSubscriber[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSubscribers'][0]) { - $request = $this->fetchOptInListSubscribersRequest($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included); + $request = $this->fetchOptInListSubscribersRequest($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -6233,6 +7699,21 @@ public function fetchOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptInListSubscriber[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6245,6 +7726,21 @@ public function fetchOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6257,6 +7753,21 @@ public function fetchOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6269,6 +7780,21 @@ public function fetchOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6283,6 +7809,21 @@ public function fetchOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6339,13 +7880,14 @@ public function fetchOptInListSubscribersWithHttpInfo($list_id, $is_subscribed = * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListSubscribersAsync($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInListSubscribersAsync($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSubscribers'][0]) { - return $this->fetchOptInListSubscribersAsyncWithHttpInfo($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included) + return $this->fetchOptInListSubscribersAsyncWithHttpInfo($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -6362,14 +7904,15 @@ function ($response) { * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListSubscribersAsyncWithHttpInfo($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInListSubscribersAsyncWithHttpInfo($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSubscribers'][0]) { $returnType = '\OpenAPI\Client\Model\OptInListSubscriber[]'; - $request = $this->fetchOptInListSubscribersRequest($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included); + $request = $this->fetchOptInListSubscribersRequest($list_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6379,6 +7922,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6411,12 +7957,14 @@ function ($exception) { * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOptInListSubscribersRequest($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInListSubscribersRequest($list_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSubscribers'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -6432,6 +7980,9 @@ public function fetchOptInListSubscribersRequest($list_id, $is_subscribed = null if (!preg_match("/^[a-zA-Z0-9]+$/", $list_id)) { throw new \InvalidArgumentException("invalid value for \"list_id\" when calling SMSApi.fetchOptInListSubscribers, must conform to the pattern /^[a-zA-Z0-9]+$/."); } + + + $resourcePath = '/v2/sms/optInList/subscribers/{listID}'; @@ -6442,38 +7993,32 @@ public function fetchOptInListSubscribersRequest($list_id, $is_subscribed = null $multipart = false; // query params - if ($is_subscribed !== null) { - if('form' === 'form' && is_array($is_subscribed)) { - foreach($is_subscribed as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isSubscribed'] = $is_subscribed; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_subscribed, + 'isSubscribed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_pending_age21_verification !== null) { - if('form' === 'form' && is_array($is_pending_age21_verification)) { - foreach($is_pending_age21_verification as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isPendingAge21Verification'] = $is_pending_age21_verification; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_pending_age21_verification, + 'isPendingAge21Verification', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -6486,16 +8031,11 @@ public function fetchOptInListSubscribersRequest($list_id, $is_subscribed = null } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6513,12 +8053,12 @@ public function fetchOptInListSubscribersRequest($list_id, $is_subscribed = null // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6534,10 +8074,11 @@ public function fetchOptInListSubscribersRequest($list_id, $is_subscribed = null $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6549,19 +8090,20 @@ public function fetchOptInListSubscribersRequest($list_id, $is_subscribed = null * Fetch opt in list subscribers by page * * @param string $list_id list_id (required) - * @param double $page_size page_size (optional) - * @param double $page_num page_num (optional) + * @param float $page_size page_size (optional) + * @param float $page_num page_num (optional) * @param bool $is_subscribed is_subscribed (optional) * @param bool $is_pending_age21_verification is_pending_age21_verification (optional) * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSubscribersByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2006|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchOptInListSubscribersByPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOptInListSubscribersByPage($list_id, $page_size = null, $page_num = null, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInListSubscribersByPage($list_id, $page_size = null, $page_num = null, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSubscribersByPage'][0]) { - list($response) = $this->fetchOptInListSubscribersByPageWithHttpInfo($list_id, $page_size, $page_num, $is_subscribed, $is_pending_age21_verification, $is_archive_included); + list($response) = $this->fetchOptInListSubscribersByPageWithHttpInfo($list_id, $page_size, $page_num, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType); return $response; } @@ -6571,19 +8113,20 @@ public function fetchOptInListSubscribersByPage($list_id, $page_size = null, $pa * Fetch opt in list subscribers by page * * @param string $list_id (required) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSubscribersByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2006|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchOptInListSubscribersByPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOptInListSubscribersByPageWithHttpInfo($list_id, $page_size = null, $page_num = null, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInListSubscribersByPageWithHttpInfo($list_id, $page_size = null, $page_num = null, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSubscribersByPage'][0]) { - $request = $this->fetchOptInListSubscribersByPageRequest($list_id, $page_size, $page_num, $is_subscribed, $is_pending_age21_verification, $is_archive_included); + $request = $this->fetchOptInListSubscribersByPageRequest($list_id, $page_size, $page_num, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -6622,14 +8165,29 @@ public function fetchOptInListSubscribersByPageWithHttpInfo($list_id, $page_size switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2006' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchOptInListSubscribersByPage200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchOptInListSubscribersByPage200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2006', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchOptInListSubscribersByPage200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -6638,6 +8196,21 @@ public function fetchOptInListSubscribersByPageWithHttpInfo($list_id, $page_size $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6650,6 +8223,21 @@ public function fetchOptInListSubscribersByPageWithHttpInfo($list_id, $page_size $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6662,6 +8250,21 @@ public function fetchOptInListSubscribersByPageWithHttpInfo($list_id, $page_size $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6671,11 +8274,26 @@ public function fetchOptInListSubscribersByPageWithHttpInfo($list_id, $page_size ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2006'; + $returnType = '\OpenAPI\Client\Model\FetchOptInListSubscribersByPage200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6689,7 +8307,7 @@ public function fetchOptInListSubscribersByPageWithHttpInfo($list_id, $page_size case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2006', + '\OpenAPI\Client\Model\FetchOptInListSubscribersByPage200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6729,18 +8347,19 @@ public function fetchOptInListSubscribersByPageWithHttpInfo($list_id, $page_size * Fetch opt in list subscribers by page * * @param string $list_id (required) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSubscribersByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListSubscribersByPageAsync($list_id, $page_size = null, $page_num = null, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInListSubscribersByPageAsync($list_id, $page_size = null, $page_num = null, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSubscribersByPage'][0]) { - return $this->fetchOptInListSubscribersByPageAsyncWithHttpInfo($list_id, $page_size, $page_num, $is_subscribed, $is_pending_age21_verification, $is_archive_included) + return $this->fetchOptInListSubscribersByPageAsyncWithHttpInfo($list_id, $page_size, $page_num, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -6754,19 +8373,20 @@ function ($response) { * Fetch opt in list subscribers by page * * @param string $list_id (required) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSubscribersByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListSubscribersByPageAsyncWithHttpInfo($list_id, $page_size = null, $page_num = null, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInListSubscribersByPageAsyncWithHttpInfo($list_id, $page_size = null, $page_num = null, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSubscribersByPage'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2006'; - $request = $this->fetchOptInListSubscribersByPageRequest($list_id, $page_size, $page_num, $is_subscribed, $is_pending_age21_verification, $is_archive_included); + $returnType = '\OpenAPI\Client\Model\FetchOptInListSubscribersByPage200Response'; + $request = $this->fetchOptInListSubscribersByPageRequest($list_id, $page_size, $page_num, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6776,6 +8396,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6805,17 +8428,19 @@ function ($exception) { * Create request for operation 'fetchOptInListSubscribersByPage' * * @param string $list_id (required) - * @param double $page_size (optional) - * @param double $page_num (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListSubscribersByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOptInListSubscribersByPageRequest($list_id, $page_size = null, $page_num = null, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInListSubscribersByPageRequest($list_id, $page_size = null, $page_num = null, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInListSubscribersByPage'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -6831,6 +8456,11 @@ public function fetchOptInListSubscribersByPageRequest($list_id, $page_size = nu if (!preg_match("/^[a-zA-Z0-9]+$/", $list_id)) { throw new \InvalidArgumentException("invalid value for \"list_id\" when calling SMSApi.fetchOptInListSubscribersByPage, must conform to the pattern /^[a-zA-Z0-9]+$/."); } + + + + + $resourcePath = '/v2/sms/optInList/subscribers/page/{listID}'; @@ -6838,63 +8468,53 @@ public function fetchOptInListSubscribersByPageRequest($list_id, $page_size = nu $queryParams = []; $headerParams = []; $httpBody = ''; - $multipart = false; - - // query params - if ($page_size !== null) { - if('form' === 'form' && is_array($page_size)) { - foreach($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageSize'] = $page_size; - } - } + $multipart = false; + // query params - if ($page_num !== null) { - if('form' === 'form' && is_array($page_num)) { - foreach($page_num as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageNum'] = $page_num; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_subscribed !== null) { - if('form' === 'form' && is_array($is_subscribed)) { - foreach($is_subscribed as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isSubscribed'] = $is_subscribed; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_num, + 'pageNum', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_pending_age21_verification !== null) { - if('form' === 'form' && is_array($is_pending_age21_verification)) { - foreach($is_pending_age21_verification as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isPendingAge21Verification'] = $is_pending_age21_verification; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_subscribed, + 'isSubscribed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_pending_age21_verification, + 'isPendingAge21Verification', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -6907,16 +8527,11 @@ public function fetchOptInListSubscribersByPageRequest($list_id, $page_size = nu } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6934,12 +8549,12 @@ public function fetchOptInListSubscribersByPageRequest($list_id, $page_size = nu // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6955,10 +8570,11 @@ public function fetchOptInListSubscribersByPageRequest($list_id, $page_size = nu $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6970,14 +8586,15 @@ public function fetchOptInListSubscribersByPageRequest($list_id, $page_size = nu * Fetch opt in lists * * @param string $phone_number_id phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListsAssociatedWithPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OptInList[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOptInListsAssociatedWithPhoneNumber($phone_number_id) + public function fetchOptInListsAssociatedWithPhoneNumber($phone_number_id, string $contentType = self::contentTypes['fetchOptInListsAssociatedWithPhoneNumber'][0]) { - list($response) = $this->fetchOptInListsAssociatedWithPhoneNumberWithHttpInfo($phone_number_id); + list($response) = $this->fetchOptInListsAssociatedWithPhoneNumberWithHttpInfo($phone_number_id, $contentType); return $response; } @@ -6987,14 +8604,15 @@ public function fetchOptInListsAssociatedWithPhoneNumber($phone_number_id) * Fetch opt in lists * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListsAssociatedWithPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OptInList[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOptInListsAssociatedWithPhoneNumberWithHttpInfo($phone_number_id) + public function fetchOptInListsAssociatedWithPhoneNumberWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['fetchOptInListsAssociatedWithPhoneNumber'][0]) { - $request = $this->fetchOptInListsAssociatedWithPhoneNumberRequest($phone_number_id); + $request = $this->fetchOptInListsAssociatedWithPhoneNumberRequest($phone_number_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -7037,6 +8655,21 @@ public function fetchOptInListsAssociatedWithPhoneNumberWithHttpInfo($phone_numb $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptInList[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7049,6 +8682,21 @@ public function fetchOptInListsAssociatedWithPhoneNumberWithHttpInfo($phone_numb $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7061,6 +8709,21 @@ public function fetchOptInListsAssociatedWithPhoneNumberWithHttpInfo($phone_numb $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7073,6 +8736,21 @@ public function fetchOptInListsAssociatedWithPhoneNumberWithHttpInfo($phone_numb $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7087,6 +8765,21 @@ public function fetchOptInListsAssociatedWithPhoneNumberWithHttpInfo($phone_numb $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7140,13 +8833,14 @@ public function fetchOptInListsAssociatedWithPhoneNumberWithHttpInfo($phone_numb * Fetch opt in lists * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListsAssociatedWithPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListsAssociatedWithPhoneNumberAsync($phone_number_id) + public function fetchOptInListsAssociatedWithPhoneNumberAsync($phone_number_id, string $contentType = self::contentTypes['fetchOptInListsAssociatedWithPhoneNumber'][0]) { - return $this->fetchOptInListsAssociatedWithPhoneNumberAsyncWithHttpInfo($phone_number_id) + return $this->fetchOptInListsAssociatedWithPhoneNumberAsyncWithHttpInfo($phone_number_id, $contentType) ->then( function ($response) { return $response[0]; @@ -7160,14 +8854,15 @@ function ($response) { * Fetch opt in lists * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListsAssociatedWithPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInListsAssociatedWithPhoneNumberAsyncWithHttpInfo($phone_number_id) + public function fetchOptInListsAssociatedWithPhoneNumberAsyncWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['fetchOptInListsAssociatedWithPhoneNumber'][0]) { $returnType = '\OpenAPI\Client\Model\OptInList[]'; - $request = $this->fetchOptInListsAssociatedWithPhoneNumberRequest($phone_number_id); + $request = $this->fetchOptInListsAssociatedWithPhoneNumberRequest($phone_number_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7177,6 +8872,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7206,12 +8904,14 @@ function ($exception) { * Create request for operation 'fetchOptInListsAssociatedWithPhoneNumber' * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInListsAssociatedWithPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOptInListsAssociatedWithPhoneNumberRequest($phone_number_id) + public function fetchOptInListsAssociatedWithPhoneNumberRequest($phone_number_id, string $contentType = self::contentTypes['fetchOptInListsAssociatedWithPhoneNumber'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -7227,7 +8927,7 @@ public function fetchOptInListsAssociatedWithPhoneNumberRequest($phone_number_id if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling SMSApi.fetchOptInListsAssociatedWithPhoneNumber, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/phoneNumber/lists/{phoneNumberID}'; $formParams = []; @@ -7248,16 +8948,11 @@ public function fetchOptInListsAssociatedWithPhoneNumberRequest($phone_number_id } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -7275,12 +8970,12 @@ public function fetchOptInListsAssociatedWithPhoneNumberRequest($phone_number_id // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7296,10 +8991,11 @@ public function fetchOptInListsAssociatedWithPhoneNumberRequest($phone_number_id $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7314,14 +9010,15 @@ public function fetchOptInListsAssociatedWithPhoneNumberRequest($phone_number_id * @param bool $is_subscribed is_subscribed (optional) * @param bool $is_pending_age21_verification is_pending_age21_verification (optional) * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInSourceSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OptInListSubscriber[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOptInSourceSubscribers($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInSourceSubscribers($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInSourceSubscribers'][0]) { - list($response) = $this->fetchOptInSourceSubscribersWithHttpInfo($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included); + list($response) = $this->fetchOptInSourceSubscribersWithHttpInfo($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType); return $response; } @@ -7334,14 +9031,15 @@ public function fetchOptInSourceSubscribers($source_id, $is_subscribed = null, $ * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInSourceSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OptInListSubscriber[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOptInSourceSubscribersWithHttpInfo($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInSourceSubscribersWithHttpInfo($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInSourceSubscribers'][0]) { - $request = $this->fetchOptInSourceSubscribersRequest($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included); + $request = $this->fetchOptInSourceSubscribersRequest($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -7384,6 +9082,21 @@ public function fetchOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptInListSubscriber[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7396,6 +9109,21 @@ public function fetchOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7408,6 +9136,21 @@ public function fetchOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7420,6 +9163,21 @@ public function fetchOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7434,6 +9192,21 @@ public function fetchOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7490,13 +9263,14 @@ public function fetchOptInSourceSubscribersWithHttpInfo($source_id, $is_subscrib * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInSourceSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInSourceSubscribersAsync($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInSourceSubscribersAsync($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInSourceSubscribers'][0]) { - return $this->fetchOptInSourceSubscribersAsyncWithHttpInfo($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included) + return $this->fetchOptInSourceSubscribersAsyncWithHttpInfo($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -7513,14 +9287,15 @@ function ($response) { * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInSourceSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInSourceSubscribersAsyncWithHttpInfo($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInSourceSubscribersAsyncWithHttpInfo($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInSourceSubscribers'][0]) { $returnType = '\OpenAPI\Client\Model\OptInListSubscriber[]'; - $request = $this->fetchOptInSourceSubscribersRequest($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included); + $request = $this->fetchOptInSourceSubscribersRequest($source_id, $is_subscribed, $is_pending_age21_verification, $is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7530,6 +9305,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7562,12 +9340,14 @@ function ($exception) { * @param bool $is_subscribed (optional) * @param bool $is_pending_age21_verification (optional) * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInSourceSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOptInSourceSubscribersRequest($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null) + public function fetchOptInSourceSubscribersRequest($source_id, $is_subscribed = null, $is_pending_age21_verification = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchOptInSourceSubscribers'][0]) { + // verify the required parameter 'source_id' is set if ($source_id === null || (is_array($source_id) && count($source_id) === 0)) { throw new \InvalidArgumentException( @@ -7583,6 +9363,9 @@ public function fetchOptInSourceSubscribersRequest($source_id, $is_subscribed = if (!preg_match("/^[a-zA-Z0-9]+$/", $source_id)) { throw new \InvalidArgumentException("invalid value for \"source_id\" when calling SMSApi.fetchOptInSourceSubscribers, must conform to the pattern /^[a-zA-Z0-9]+$/."); } + + + $resourcePath = '/v2/sms/optInSource/subscribers/{sourceID}'; @@ -7593,38 +9376,32 @@ public function fetchOptInSourceSubscribersRequest($source_id, $is_subscribed = $multipart = false; // query params - if ($is_subscribed !== null) { - if('form' === 'form' && is_array($is_subscribed)) { - foreach($is_subscribed as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isSubscribed'] = $is_subscribed; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_subscribed, + 'isSubscribed', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_pending_age21_verification !== null) { - if('form' === 'form' && is_array($is_pending_age21_verification)) { - foreach($is_pending_age21_verification as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isPendingAge21Verification'] = $is_pending_age21_verification; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_pending_age21_verification, + 'isPendingAge21Verification', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -7637,16 +9414,11 @@ public function fetchOptInSourceSubscribersRequest($source_id, $is_subscribed = } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -7664,12 +9436,12 @@ public function fetchOptInSourceSubscribersRequest($source_id, $is_subscribed = // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7685,10 +9457,11 @@ public function fetchOptInSourceSubscribersRequest($source_id, $is_subscribed = $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -7700,14 +9473,15 @@ public function fetchOptInSourceSubscribersRequest($source_id, $is_subscribed = * Fetch opt in sources * * @param string $phone_number_id phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInSourcesAssociatedWithPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OptInListSource[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOptInSourcesAssociatedWithPhoneNumber($phone_number_id) + public function fetchOptInSourcesAssociatedWithPhoneNumber($phone_number_id, string $contentType = self::contentTypes['fetchOptInSourcesAssociatedWithPhoneNumber'][0]) { - list($response) = $this->fetchOptInSourcesAssociatedWithPhoneNumberWithHttpInfo($phone_number_id); + list($response) = $this->fetchOptInSourcesAssociatedWithPhoneNumberWithHttpInfo($phone_number_id, $contentType); return $response; } @@ -7717,14 +9491,15 @@ public function fetchOptInSourcesAssociatedWithPhoneNumber($phone_number_id) * Fetch opt in sources * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInSourcesAssociatedWithPhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OptInListSource[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOptInSourcesAssociatedWithPhoneNumberWithHttpInfo($phone_number_id) + public function fetchOptInSourcesAssociatedWithPhoneNumberWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['fetchOptInSourcesAssociatedWithPhoneNumber'][0]) { - $request = $this->fetchOptInSourcesAssociatedWithPhoneNumberRequest($phone_number_id); + $request = $this->fetchOptInSourcesAssociatedWithPhoneNumberRequest($phone_number_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -7767,6 +9542,21 @@ public function fetchOptInSourcesAssociatedWithPhoneNumberWithHttpInfo($phone_nu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptInListSource[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7779,6 +9569,21 @@ public function fetchOptInSourcesAssociatedWithPhoneNumberWithHttpInfo($phone_nu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7791,6 +9596,21 @@ public function fetchOptInSourcesAssociatedWithPhoneNumberWithHttpInfo($phone_nu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7803,6 +9623,21 @@ public function fetchOptInSourcesAssociatedWithPhoneNumberWithHttpInfo($phone_nu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7817,6 +9652,21 @@ public function fetchOptInSourcesAssociatedWithPhoneNumberWithHttpInfo($phone_nu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7870,13 +9720,14 @@ public function fetchOptInSourcesAssociatedWithPhoneNumberWithHttpInfo($phone_nu * Fetch opt in sources * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInSourcesAssociatedWithPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInSourcesAssociatedWithPhoneNumberAsync($phone_number_id) + public function fetchOptInSourcesAssociatedWithPhoneNumberAsync($phone_number_id, string $contentType = self::contentTypes['fetchOptInSourcesAssociatedWithPhoneNumber'][0]) { - return $this->fetchOptInSourcesAssociatedWithPhoneNumberAsyncWithHttpInfo($phone_number_id) + return $this->fetchOptInSourcesAssociatedWithPhoneNumberAsyncWithHttpInfo($phone_number_id, $contentType) ->then( function ($response) { return $response[0]; @@ -7890,14 +9741,15 @@ function ($response) { * Fetch opt in sources * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInSourcesAssociatedWithPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOptInSourcesAssociatedWithPhoneNumberAsyncWithHttpInfo($phone_number_id) + public function fetchOptInSourcesAssociatedWithPhoneNumberAsyncWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['fetchOptInSourcesAssociatedWithPhoneNumber'][0]) { $returnType = '\OpenAPI\Client\Model\OptInListSource[]'; - $request = $this->fetchOptInSourcesAssociatedWithPhoneNumberRequest($phone_number_id); + $request = $this->fetchOptInSourcesAssociatedWithPhoneNumberRequest($phone_number_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7907,6 +9759,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7936,12 +9791,14 @@ function ($exception) { * Create request for operation 'fetchOptInSourcesAssociatedWithPhoneNumber' * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOptInSourcesAssociatedWithPhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOptInSourcesAssociatedWithPhoneNumberRequest($phone_number_id) + public function fetchOptInSourcesAssociatedWithPhoneNumberRequest($phone_number_id, string $contentType = self::contentTypes['fetchOptInSourcesAssociatedWithPhoneNumber'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -7957,7 +9814,7 @@ public function fetchOptInSourcesAssociatedWithPhoneNumberRequest($phone_number_ if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling SMSApi.fetchOptInSourcesAssociatedWithPhoneNumber, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/phoneNumber/sources/{phoneNumberID}'; $formParams = []; @@ -7978,16 +9835,11 @@ public function fetchOptInSourcesAssociatedWithPhoneNumberRequest($phone_number_ } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -8005,12 +9857,12 @@ public function fetchOptInSourcesAssociatedWithPhoneNumberRequest($phone_number_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8026,10 +9878,11 @@ public function fetchOptInSourcesAssociatedWithPhoneNumberRequest($phone_number_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8044,14 +9897,15 @@ public function fetchOptInSourcesAssociatedWithPhoneNumberRequest($phone_number_ * @param string $to_phone_number to_phone_number (optional) * @param string $status status (optional) * @param string $payment_object_broadcast_id payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOutboundSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OutboundSMS[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOutboundSMS($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null) + public function fetchOutboundSMS($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['fetchOutboundSMS'][0]) { - list($response) = $this->fetchOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id); + list($response) = $this->fetchOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id, $contentType); return $response; } @@ -8064,14 +9918,15 @@ public function fetchOutboundSMS($phone_number_id, $to_phone_number = null, $sta * @param string $to_phone_number (optional) * @param string $status (optional) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOutboundSMS'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OutboundSMS[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null) + public function fetchOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['fetchOutboundSMS'][0]) { - $request = $this->fetchOutboundSMSRequest($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id); + $request = $this->fetchOutboundSMSRequest($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -8114,6 +9969,21 @@ public function fetchOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OutboundSMS[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8126,6 +9996,21 @@ public function fetchOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8138,6 +10023,21 @@ public function fetchOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8150,6 +10050,21 @@ public function fetchOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8164,6 +10079,21 @@ public function fetchOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8220,13 +10150,14 @@ public function fetchOutboundSMSWithHttpInfo($phone_number_id, $to_phone_number * @param string $to_phone_number (optional) * @param string $status (optional) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOutboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOutboundSMSAsync($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null) + public function fetchOutboundSMSAsync($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['fetchOutboundSMS'][0]) { - return $this->fetchOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id) + return $this->fetchOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id, $contentType) ->then( function ($response) { return $response[0]; @@ -8243,14 +10174,15 @@ function ($response) { * @param string $to_phone_number (optional) * @param string $status (optional) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOutboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null) + public function fetchOutboundSMSAsyncWithHttpInfo($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['fetchOutboundSMS'][0]) { $returnType = '\OpenAPI\Client\Model\OutboundSMS[]'; - $request = $this->fetchOutboundSMSRequest($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id); + $request = $this->fetchOutboundSMSRequest($phone_number_id, $to_phone_number, $status, $payment_object_broadcast_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8260,6 +10192,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8292,12 +10227,14 @@ function ($exception) { * @param string $to_phone_number (optional) * @param string $status (optional) * @param string $payment_object_broadcast_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOutboundSMS'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOutboundSMSRequest($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null) + public function fetchOutboundSMSRequest($phone_number_id, $to_phone_number = null, $status = null, $payment_object_broadcast_id = null, string $contentType = self::contentTypes['fetchOutboundSMS'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -8313,6 +10250,8 @@ public function fetchOutboundSMSRequest($phone_number_id, $to_phone_number = nul if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling SMSApi.fetchOutboundSMS, must conform to the pattern /^[a-zA-Z0-9]+$/."); } + + if ($payment_object_broadcast_id !== null && strlen($payment_object_broadcast_id) > 10) { throw new \InvalidArgumentException('invalid length for "$payment_object_broadcast_id" when calling SMSApi.fetchOutboundSMS, must be smaller than or equal to 10.'); @@ -8323,7 +10262,7 @@ public function fetchOutboundSMSRequest($phone_number_id, $to_phone_number = nul if ($payment_object_broadcast_id !== null && !preg_match("/^[a-zA-Z0-9]+$/", $payment_object_broadcast_id)) { throw new \InvalidArgumentException("invalid value for \"payment_object_broadcast_id\" when calling SMSApi.fetchOutboundSMS, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/outbound/{phoneNumberID}'; $formParams = []; @@ -8333,38 +10272,32 @@ public function fetchOutboundSMSRequest($phone_number_id, $to_phone_number = nul $multipart = false; // query params - if ($to_phone_number !== null) { - if('form' === 'form' && is_array($to_phone_number)) { - foreach($to_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['toPhoneNumber'] = $to_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_phone_number, + 'toPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($status !== null) { - if('form' === 'form' && is_array($status)) { - foreach($status as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['status'] = $status; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($payment_object_broadcast_id !== null) { - if('form' === 'form' && is_array($payment_object_broadcast_id)) { - foreach($payment_object_broadcast_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['paymentObjectBroadcastID'] = $payment_object_broadcast_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payment_object_broadcast_id, + 'paymentObjectBroadcastID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -8377,16 +10310,11 @@ public function fetchOutboundSMSRequest($phone_number_id, $to_phone_number = nul } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -8404,12 +10332,12 @@ public function fetchOutboundSMSRequest($phone_number_id, $to_phone_number = nul // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8425,10 +10353,11 @@ public function fetchOutboundSMSRequest($phone_number_id, $to_phone_number = nul $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8442,17 +10371,18 @@ public function fetchOutboundSMSRequest($phone_number_id, $to_phone_number = nul * @param string $phone_number_id phone_number_id (required) * @param string $to_phone_number to_phone_number (optional) * @param string $payment_object_broadcast_id payment_object_broadcast_id (optional) - * @param double $page_size page_size (optional) - * @param double $page_num page_num (optional) - * @param \OpenAPI\Client\Model\SSOutboundStatuses $status status (optional) + * @param float $page_size page_size (optional) + * @param float $page_num page_num (optional) + * @param SSOutboundStatuses $status status (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOutboundSMSByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2005|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchOutboundSMSByPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchOutboundSMSByPage($phone_number_id, $to_phone_number = null, $payment_object_broadcast_id = null, $page_size = null, $page_num = null, $status = null) + public function fetchOutboundSMSByPage($phone_number_id, $to_phone_number = null, $payment_object_broadcast_id = null, $page_size = null, $page_num = null, $status = null, string $contentType = self::contentTypes['fetchOutboundSMSByPage'][0]) { - list($response) = $this->fetchOutboundSMSByPageWithHttpInfo($phone_number_id, $to_phone_number, $payment_object_broadcast_id, $page_size, $page_num, $status); + list($response) = $this->fetchOutboundSMSByPageWithHttpInfo($phone_number_id, $to_phone_number, $payment_object_broadcast_id, $page_size, $page_num, $status, $contentType); return $response; } @@ -8464,17 +10394,18 @@ public function fetchOutboundSMSByPage($phone_number_id, $to_phone_number = null * @param string $phone_number_id (required) * @param string $to_phone_number (optional) * @param string $payment_object_broadcast_id (optional) - * @param double $page_size (optional) - * @param double $page_num (optional) - * @param \OpenAPI\Client\Model\SSOutboundStatuses $status (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) + * @param SSOutboundStatuses $status (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOutboundSMSByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2005|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchOutboundSMSByPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchOutboundSMSByPageWithHttpInfo($phone_number_id, $to_phone_number = null, $payment_object_broadcast_id = null, $page_size = null, $page_num = null, $status = null) + public function fetchOutboundSMSByPageWithHttpInfo($phone_number_id, $to_phone_number = null, $payment_object_broadcast_id = null, $page_size = null, $page_num = null, $status = null, string $contentType = self::contentTypes['fetchOutboundSMSByPage'][0]) { - $request = $this->fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number, $payment_object_broadcast_id, $page_size, $page_num, $status); + $request = $this->fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number, $payment_object_broadcast_id, $page_size, $page_num, $status, $contentType); try { $options = $this->createHttpClientOption(); @@ -8513,14 +10444,29 @@ public function fetchOutboundSMSByPageWithHttpInfo($phone_number_id, $to_phone_n switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2005' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchOutboundSMSByPage200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchOutboundSMSByPage200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2005', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchOutboundSMSByPage200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -8529,6 +10475,21 @@ public function fetchOutboundSMSByPageWithHttpInfo($phone_number_id, $to_phone_n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8541,6 +10502,21 @@ public function fetchOutboundSMSByPageWithHttpInfo($phone_number_id, $to_phone_n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8553,6 +10529,21 @@ public function fetchOutboundSMSByPageWithHttpInfo($phone_number_id, $to_phone_n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8562,11 +10553,26 @@ public function fetchOutboundSMSByPageWithHttpInfo($phone_number_id, $to_phone_n ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2005'; + $returnType = '\OpenAPI\Client\Model\FetchOutboundSMSByPage200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8580,7 +10586,7 @@ public function fetchOutboundSMSByPageWithHttpInfo($phone_number_id, $to_phone_n case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2005', + '\OpenAPI\Client\Model\FetchOutboundSMSByPage200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8622,16 +10628,17 @@ public function fetchOutboundSMSByPageWithHttpInfo($phone_number_id, $to_phone_n * @param string $phone_number_id (required) * @param string $to_phone_number (optional) * @param string $payment_object_broadcast_id (optional) - * @param double $page_size (optional) - * @param double $page_num (optional) - * @param \OpenAPI\Client\Model\SSOutboundStatuses $status (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) + * @param SSOutboundStatuses $status (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOutboundSMSByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOutboundSMSByPageAsync($phone_number_id, $to_phone_number = null, $payment_object_broadcast_id = null, $page_size = null, $page_num = null, $status = null) + public function fetchOutboundSMSByPageAsync($phone_number_id, $to_phone_number = null, $payment_object_broadcast_id = null, $page_size = null, $page_num = null, $status = null, string $contentType = self::contentTypes['fetchOutboundSMSByPage'][0]) { - return $this->fetchOutboundSMSByPageAsyncWithHttpInfo($phone_number_id, $to_phone_number, $payment_object_broadcast_id, $page_size, $page_num, $status) + return $this->fetchOutboundSMSByPageAsyncWithHttpInfo($phone_number_id, $to_phone_number, $payment_object_broadcast_id, $page_size, $page_num, $status, $contentType) ->then( function ($response) { return $response[0]; @@ -8647,17 +10654,18 @@ function ($response) { * @param string $phone_number_id (required) * @param string $to_phone_number (optional) * @param string $payment_object_broadcast_id (optional) - * @param double $page_size (optional) - * @param double $page_num (optional) - * @param \OpenAPI\Client\Model\SSOutboundStatuses $status (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) + * @param SSOutboundStatuses $status (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOutboundSMSByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchOutboundSMSByPageAsyncWithHttpInfo($phone_number_id, $to_phone_number = null, $payment_object_broadcast_id = null, $page_size = null, $page_num = null, $status = null) + public function fetchOutboundSMSByPageAsyncWithHttpInfo($phone_number_id, $to_phone_number = null, $payment_object_broadcast_id = null, $page_size = null, $page_num = null, $status = null, string $contentType = self::contentTypes['fetchOutboundSMSByPage'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2005'; - $request = $this->fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number, $payment_object_broadcast_id, $page_size, $page_num, $status); + $returnType = '\OpenAPI\Client\Model\FetchOutboundSMSByPage200Response'; + $request = $this->fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number, $payment_object_broadcast_id, $page_size, $page_num, $status, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8667,6 +10675,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -8698,15 +10709,17 @@ function ($exception) { * @param string $phone_number_id (required) * @param string $to_phone_number (optional) * @param string $payment_object_broadcast_id (optional) - * @param double $page_size (optional) - * @param double $page_num (optional) - * @param \OpenAPI\Client\Model\SSOutboundStatuses $status (optional) + * @param float $page_size (optional) + * @param float $page_num (optional) + * @param SSOutboundStatuses $status (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchOutboundSMSByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number = null, $payment_object_broadcast_id = null, $page_size = null, $page_num = null, $status = null) + public function fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number = null, $payment_object_broadcast_id = null, $page_size = null, $page_num = null, $status = null, string $contentType = self::contentTypes['fetchOutboundSMSByPage'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -8722,6 +10735,7 @@ public function fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling SMSApi.fetchOutboundSMSByPage, must conform to the pattern /^[a-zA-Z0-9]+$/."); } + if ($payment_object_broadcast_id !== null && strlen($payment_object_broadcast_id) > 10) { throw new \InvalidArgumentException('invalid length for "$payment_object_broadcast_id" when calling SMSApi.fetchOutboundSMSByPage, must be smaller than or equal to 10.'); @@ -8732,6 +10746,9 @@ public function fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number if ($payment_object_broadcast_id !== null && !preg_match("/^[a-zA-Z0-9]+$/", $payment_object_broadcast_id)) { throw new \InvalidArgumentException("invalid value for \"payment_object_broadcast_id\" when calling SMSApi.fetchOutboundSMSByPage, must conform to the pattern /^[a-zA-Z0-9]+$/."); } + + + $resourcePath = '/v2/sms/outbound/page/{phoneNumberID}'; @@ -8742,60 +10759,50 @@ public function fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number $multipart = false; // query params - if ($to_phone_number !== null) { - if('form' === 'form' && is_array($to_phone_number)) { - foreach($to_phone_number as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['toPhoneNumber'] = $to_phone_number; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_phone_number, + 'toPhoneNumber', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($payment_object_broadcast_id !== null) { - if('form' === 'form' && is_array($payment_object_broadcast_id)) { - foreach($payment_object_broadcast_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['paymentObjectBroadcastID'] = $payment_object_broadcast_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $payment_object_broadcast_id, + 'paymentObjectBroadcastID', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_size !== null) { - if('form' === 'form' && is_array($page_size)) { - foreach($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageSize'] = $page_size; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($page_num !== null) { - if('form' === 'form' && is_array($page_num)) { - foreach($page_num as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageNum'] = $page_num; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_num, + 'pageNum', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($status !== null) { - if('form' === 'form' && is_array($status)) { - foreach($status as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['status'] = $status; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'AnyOfStringStringStringStringStringString', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -8808,16 +10815,11 @@ public function fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -8835,12 +10837,12 @@ public function fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -8856,10 +10858,11 @@ public function fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -8871,14 +10874,15 @@ public function fetchOutboundSMSByPageRequest($phone_number_id, $to_phone_number * Fetch payment object broadcasts * * @param string $phone_number_id phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPaymentObjectBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucherCampaignBroadcast[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchPaymentObjectBroadcasts($phone_number_id) + public function fetchPaymentObjectBroadcasts($phone_number_id, string $contentType = self::contentTypes['fetchPaymentObjectBroadcasts'][0]) { - list($response) = $this->fetchPaymentObjectBroadcastsWithHttpInfo($phone_number_id); + list($response) = $this->fetchPaymentObjectBroadcastsWithHttpInfo($phone_number_id, $contentType); return $response; } @@ -8888,14 +10892,15 @@ public function fetchPaymentObjectBroadcasts($phone_number_id) * Fetch payment object broadcasts * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPaymentObjectBroadcasts'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucherCampaignBroadcast[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchPaymentObjectBroadcastsWithHttpInfo($phone_number_id) + public function fetchPaymentObjectBroadcastsWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['fetchPaymentObjectBroadcasts'][0]) { - $request = $this->fetchPaymentObjectBroadcastsRequest($phone_number_id); + $request = $this->fetchPaymentObjectBroadcastsRequest($phone_number_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -8938,6 +10943,21 @@ public function fetchPaymentObjectBroadcastsWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucherCampaignBroadcast[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8950,6 +10970,21 @@ public function fetchPaymentObjectBroadcastsWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8962,6 +10997,21 @@ public function fetchPaymentObjectBroadcastsWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8974,6 +11024,21 @@ public function fetchPaymentObjectBroadcastsWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -8988,6 +11053,21 @@ public function fetchPaymentObjectBroadcastsWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9041,13 +11121,14 @@ public function fetchPaymentObjectBroadcastsWithHttpInfo($phone_number_id) * Fetch payment object broadcasts * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPaymentObjectBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPaymentObjectBroadcastsAsync($phone_number_id) + public function fetchPaymentObjectBroadcastsAsync($phone_number_id, string $contentType = self::contentTypes['fetchPaymentObjectBroadcasts'][0]) { - return $this->fetchPaymentObjectBroadcastsAsyncWithHttpInfo($phone_number_id) + return $this->fetchPaymentObjectBroadcastsAsyncWithHttpInfo($phone_number_id, $contentType) ->then( function ($response) { return $response[0]; @@ -9061,14 +11142,15 @@ function ($response) { * Fetch payment object broadcasts * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPaymentObjectBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPaymentObjectBroadcastsAsyncWithHttpInfo($phone_number_id) + public function fetchPaymentObjectBroadcastsAsyncWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['fetchPaymentObjectBroadcasts'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucherCampaignBroadcast[]'; - $request = $this->fetchPaymentObjectBroadcastsRequest($phone_number_id); + $request = $this->fetchPaymentObjectBroadcastsRequest($phone_number_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9078,6 +11160,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9107,12 +11192,14 @@ function ($exception) { * Create request for operation 'fetchPaymentObjectBroadcasts' * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPaymentObjectBroadcasts'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchPaymentObjectBroadcastsRequest($phone_number_id) + public function fetchPaymentObjectBroadcastsRequest($phone_number_id, string $contentType = self::contentTypes['fetchPaymentObjectBroadcasts'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -9128,7 +11215,7 @@ public function fetchPaymentObjectBroadcastsRequest($phone_number_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling SMSApi.fetchPaymentObjectBroadcasts, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/paymentObjectBroadcasts/{phoneNumberID}'; $formParams = []; @@ -9149,16 +11236,11 @@ public function fetchPaymentObjectBroadcastsRequest($phone_number_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -9176,12 +11258,12 @@ public function fetchPaymentObjectBroadcastsRequest($phone_number_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -9197,10 +11279,11 @@ public function fetchPaymentObjectBroadcastsRequest($phone_number_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9211,14 +11294,15 @@ public function fetchPaymentObjectBroadcastsRequest($phone_number_id) * * Accept SMS agreement (DEPRECATED) * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSMSAgreement'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchSMSAgreement() + public function fetchSMSAgreement(string $contentType = self::contentTypes['fetchSMSAgreement'][0]) { - list($response) = $this->fetchSMSAgreementWithHttpInfo(); + list($response) = $this->fetchSMSAgreementWithHttpInfo($contentType); return $response; } @@ -9227,14 +11311,15 @@ public function fetchSMSAgreement() * * Accept SMS agreement (DEPRECATED) * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSMSAgreement'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchSMSAgreementWithHttpInfo() + public function fetchSMSAgreementWithHttpInfo(string $contentType = self::contentTypes['fetchSMSAgreement'][0]) { - $request = $this->fetchSMSAgreementRequest(); + $request = $this->fetchSMSAgreementRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -9277,6 +11362,21 @@ public function fetchSMSAgreementWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9289,6 +11389,21 @@ public function fetchSMSAgreementWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9301,6 +11416,21 @@ public function fetchSMSAgreementWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9313,6 +11443,21 @@ public function fetchSMSAgreementWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9327,6 +11472,21 @@ public function fetchSMSAgreementWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9379,13 +11539,14 @@ public function fetchSMSAgreementWithHttpInfo() * * Accept SMS agreement (DEPRECATED) * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSMSAgreement'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchSMSAgreementAsync() + public function fetchSMSAgreementAsync(string $contentType = self::contentTypes['fetchSMSAgreement'][0]) { - return $this->fetchSMSAgreementAsyncWithHttpInfo() + return $this->fetchSMSAgreementAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -9398,14 +11559,15 @@ function ($response) { * * Accept SMS agreement (DEPRECATED) * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSMSAgreement'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchSMSAgreementAsyncWithHttpInfo() + public function fetchSMSAgreementAsyncWithHttpInfo(string $contentType = self::contentTypes['fetchSMSAgreement'][0]) { $returnType = 'mixed'; - $request = $this->fetchSMSAgreementRequest(); + $request = $this->fetchSMSAgreementRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9415,6 +11577,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9443,13 +11608,15 @@ function ($exception) { /** * Create request for operation 'fetchSMSAgreement' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchSMSAgreement'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchSMSAgreementRequest() + public function fetchSMSAgreementRequest(string $contentType = self::contentTypes['fetchSMSAgreement'][0]) { + $resourcePath = '/v2/sms/agreement'; $formParams = []; $queryParams = []; @@ -9461,16 +11628,11 @@ public function fetchSMSAgreementRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -9488,12 +11650,12 @@ public function fetchSMSAgreementRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -9509,10 +11671,11 @@ public function fetchSMSAgreementRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9525,14 +11688,15 @@ public function fetchSMSAgreementRequest() * * @param string $imported_list_id imported_list_id (required) * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importImportedListRecipients'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function importImportedListRecipients($imported_list_id, $wt_employee_import_records) + public function importImportedListRecipients($imported_list_id, $wt_employee_import_records, string $contentType = self::contentTypes['importImportedListRecipients'][0]) { - list($response) = $this->importImportedListRecipientsWithHttpInfo($imported_list_id, $wt_employee_import_records); + list($response) = $this->importImportedListRecipientsWithHttpInfo($imported_list_id, $wt_employee_import_records, $contentType); return $response; } @@ -9543,14 +11707,15 @@ public function importImportedListRecipients($imported_list_id, $wt_employee_imp * * @param string $imported_list_id (required) * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importImportedListRecipients'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function importImportedListRecipientsWithHttpInfo($imported_list_id, $wt_employee_import_records) + public function importImportedListRecipientsWithHttpInfo($imported_list_id, $wt_employee_import_records, string $contentType = self::contentTypes['importImportedListRecipients'][0]) { - $request = $this->importImportedListRecipientsRequest($imported_list_id, $wt_employee_import_records); + $request = $this->importImportedListRecipientsRequest($imported_list_id, $wt_employee_import_records, $contentType); try { $options = $this->createHttpClientOption(); @@ -9593,6 +11758,21 @@ public function importImportedListRecipientsWithHttpInfo($imported_list_id, $wt_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9605,6 +11785,21 @@ public function importImportedListRecipientsWithHttpInfo($imported_list_id, $wt_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9617,6 +11812,21 @@ public function importImportedListRecipientsWithHttpInfo($imported_list_id, $wt_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9629,6 +11839,21 @@ public function importImportedListRecipientsWithHttpInfo($imported_list_id, $wt_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9643,6 +11868,21 @@ public function importImportedListRecipientsWithHttpInfo($imported_list_id, $wt_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9697,13 +11937,14 @@ public function importImportedListRecipientsWithHttpInfo($imported_list_id, $wt_ * * @param string $imported_list_id (required) * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importImportedListRecipientsAsync($imported_list_id, $wt_employee_import_records) + public function importImportedListRecipientsAsync($imported_list_id, $wt_employee_import_records, string $contentType = self::contentTypes['importImportedListRecipients'][0]) { - return $this->importImportedListRecipientsAsyncWithHttpInfo($imported_list_id, $wt_employee_import_records) + return $this->importImportedListRecipientsAsyncWithHttpInfo($imported_list_id, $wt_employee_import_records, $contentType) ->then( function ($response) { return $response[0]; @@ -9718,14 +11959,15 @@ function ($response) { * * @param string $imported_list_id (required) * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importImportedListRecipientsAsyncWithHttpInfo($imported_list_id, $wt_employee_import_records) + public function importImportedListRecipientsAsyncWithHttpInfo($imported_list_id, $wt_employee_import_records, string $contentType = self::contentTypes['importImportedListRecipients'][0]) { $returnType = 'string'; - $request = $this->importImportedListRecipientsRequest($imported_list_id, $wt_employee_import_records); + $request = $this->importImportedListRecipientsRequest($imported_list_id, $wt_employee_import_records, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9735,6 +11977,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -9765,12 +12010,14 @@ function ($exception) { * * @param string $imported_list_id (required) * @param \OpenAPI\Client\Model\WTEmployeeImportRecords $wt_employee_import_records (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importImportedListRecipients'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function importImportedListRecipientsRequest($imported_list_id, $wt_employee_import_records) + public function importImportedListRecipientsRequest($imported_list_id, $wt_employee_import_records, string $contentType = self::contentTypes['importImportedListRecipients'][0]) { + // verify the required parameter 'imported_list_id' is set if ($imported_list_id === null || (is_array($imported_list_id) && count($imported_list_id) === 0)) { throw new \InvalidArgumentException( @@ -9786,7 +12033,7 @@ public function importImportedListRecipientsRequest($imported_list_id, $wt_emplo if (!preg_match("/^[a-zA-Z0-9]+$/", $imported_list_id)) { throw new \InvalidArgumentException("invalid value for \"imported_list_id\" when calling SMSApi.importImportedListRecipients, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'wt_employee_import_records' is set if ($wt_employee_import_records === null || (is_array($wt_employee_import_records) && count($wt_employee_import_records) === 0)) { throw new \InvalidArgumentException( @@ -9794,6 +12041,7 @@ public function importImportedListRecipientsRequest($imported_list_id, $wt_emplo ); } + $resourcePath = '/v2/sms/importedList/recipients/import/{importedListID}'; $formParams = []; $queryParams = []; @@ -9813,21 +12061,17 @@ public function importImportedListRecipientsRequest($imported_list_id, $wt_emplo } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_employee_import_records)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_employee_import_records)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_employee_import_records)); } else { $httpBody = $wt_employee_import_records; } @@ -9846,12 +12090,12 @@ public function importImportedListRecipientsRequest($imported_list_id, $wt_emplo // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -9867,10 +12111,11 @@ public function importImportedListRecipientsRequest($imported_list_id, $wt_emplo $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -9882,14 +12127,15 @@ public function importImportedListRecipientsRequest($imported_list_id, $wt_emplo * Import imported list recipients from a given membership tier * * @param \OpenAPI\Client\Model\WTImportedListRecipientFromMembershipTierImport $wt_imported_list_recipient_from_membership_tier_import wt_imported_list_recipient_from_membership_tier_import (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importImportedListRecipientsFromMembershipTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function importImportedListRecipientsFromMembershipTier($wt_imported_list_recipient_from_membership_tier_import) + public function importImportedListRecipientsFromMembershipTier($wt_imported_list_recipient_from_membership_tier_import, string $contentType = self::contentTypes['importImportedListRecipientsFromMembershipTier'][0]) { - list($response) = $this->importImportedListRecipientsFromMembershipTierWithHttpInfo($wt_imported_list_recipient_from_membership_tier_import); + list($response) = $this->importImportedListRecipientsFromMembershipTierWithHttpInfo($wt_imported_list_recipient_from_membership_tier_import, $contentType); return $response; } @@ -9899,14 +12145,15 @@ public function importImportedListRecipientsFromMembershipTier($wt_imported_list * Import imported list recipients from a given membership tier * * @param \OpenAPI\Client\Model\WTImportedListRecipientFromMembershipTierImport $wt_imported_list_recipient_from_membership_tier_import (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importImportedListRecipientsFromMembershipTier'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function importImportedListRecipientsFromMembershipTierWithHttpInfo($wt_imported_list_recipient_from_membership_tier_import) + public function importImportedListRecipientsFromMembershipTierWithHttpInfo($wt_imported_list_recipient_from_membership_tier_import, string $contentType = self::contentTypes['importImportedListRecipientsFromMembershipTier'][0]) { - $request = $this->importImportedListRecipientsFromMembershipTierRequest($wt_imported_list_recipient_from_membership_tier_import); + $request = $this->importImportedListRecipientsFromMembershipTierRequest($wt_imported_list_recipient_from_membership_tier_import, $contentType); try { $options = $this->createHttpClientOption(); @@ -9949,6 +12196,21 @@ public function importImportedListRecipientsFromMembershipTierWithHttpInfo($wt_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9961,6 +12223,21 @@ public function importImportedListRecipientsFromMembershipTierWithHttpInfo($wt_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9973,6 +12250,21 @@ public function importImportedListRecipientsFromMembershipTierWithHttpInfo($wt_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9985,6 +12277,21 @@ public function importImportedListRecipientsFromMembershipTierWithHttpInfo($wt_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -9999,6 +12306,21 @@ public function importImportedListRecipientsFromMembershipTierWithHttpInfo($wt_i $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10052,13 +12374,14 @@ public function importImportedListRecipientsFromMembershipTierWithHttpInfo($wt_i * Import imported list recipients from a given membership tier * * @param \OpenAPI\Client\Model\WTImportedListRecipientFromMembershipTierImport $wt_imported_list_recipient_from_membership_tier_import (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importImportedListRecipientsFromMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importImportedListRecipientsFromMembershipTierAsync($wt_imported_list_recipient_from_membership_tier_import) + public function importImportedListRecipientsFromMembershipTierAsync($wt_imported_list_recipient_from_membership_tier_import, string $contentType = self::contentTypes['importImportedListRecipientsFromMembershipTier'][0]) { - return $this->importImportedListRecipientsFromMembershipTierAsyncWithHttpInfo($wt_imported_list_recipient_from_membership_tier_import) + return $this->importImportedListRecipientsFromMembershipTierAsyncWithHttpInfo($wt_imported_list_recipient_from_membership_tier_import, $contentType) ->then( function ($response) { return $response[0]; @@ -10072,14 +12395,15 @@ function ($response) { * Import imported list recipients from a given membership tier * * @param \OpenAPI\Client\Model\WTImportedListRecipientFromMembershipTierImport $wt_imported_list_recipient_from_membership_tier_import (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importImportedListRecipientsFromMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importImportedListRecipientsFromMembershipTierAsyncWithHttpInfo($wt_imported_list_recipient_from_membership_tier_import) + public function importImportedListRecipientsFromMembershipTierAsyncWithHttpInfo($wt_imported_list_recipient_from_membership_tier_import, string $contentType = self::contentTypes['importImportedListRecipientsFromMembershipTier'][0]) { $returnType = 'string'; - $request = $this->importImportedListRecipientsFromMembershipTierRequest($wt_imported_list_recipient_from_membership_tier_import); + $request = $this->importImportedListRecipientsFromMembershipTierRequest($wt_imported_list_recipient_from_membership_tier_import, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10089,6 +12413,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10118,12 +12445,14 @@ function ($exception) { * Create request for operation 'importImportedListRecipientsFromMembershipTier' * * @param \OpenAPI\Client\Model\WTImportedListRecipientFromMembershipTierImport $wt_imported_list_recipient_from_membership_tier_import (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importImportedListRecipientsFromMembershipTier'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function importImportedListRecipientsFromMembershipTierRequest($wt_imported_list_recipient_from_membership_tier_import) + public function importImportedListRecipientsFromMembershipTierRequest($wt_imported_list_recipient_from_membership_tier_import, string $contentType = self::contentTypes['importImportedListRecipientsFromMembershipTier'][0]) { + // verify the required parameter 'wt_imported_list_recipient_from_membership_tier_import' is set if ($wt_imported_list_recipient_from_membership_tier_import === null || (is_array($wt_imported_list_recipient_from_membership_tier_import) && count($wt_imported_list_recipient_from_membership_tier_import) === 0)) { throw new \InvalidArgumentException( @@ -10131,6 +12460,7 @@ public function importImportedListRecipientsFromMembershipTierRequest($wt_import ); } + $resourcePath = '/v2/sms/importedList/recipients/import-from-tier'; $formParams = []; $queryParams = []; @@ -10142,21 +12472,17 @@ public function importImportedListRecipientsFromMembershipTierRequest($wt_import - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_imported_list_recipient_from_membership_tier_import)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_imported_list_recipient_from_membership_tier_import)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_imported_list_recipient_from_membership_tier_import)); } else { $httpBody = $wt_imported_list_recipient_from_membership_tier_import; } @@ -10175,12 +12501,12 @@ public function importImportedListRecipientsFromMembershipTierRequest($wt_import // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -10196,10 +12522,11 @@ public function importImportedListRecipientsFromMembershipTierRequest($wt_import $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -10212,14 +12539,15 @@ public function importImportedListRecipientsFromMembershipTierRequest($wt_import * * @param string $list_id list_id (required) * @param \OpenAPI\Client\Model\WTSMSImportOptInListSubscribers $wtsms_import_opt_in_list_subscribers wtsms_import_opt_in_list_subscribers (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importOptInListSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function importOptInListSubscribers($list_id, $wtsms_import_opt_in_list_subscribers) + public function importOptInListSubscribers($list_id, $wtsms_import_opt_in_list_subscribers, string $contentType = self::contentTypes['importOptInListSubscribers'][0]) { - list($response) = $this->importOptInListSubscribersWithHttpInfo($list_id, $wtsms_import_opt_in_list_subscribers); + list($response) = $this->importOptInListSubscribersWithHttpInfo($list_id, $wtsms_import_opt_in_list_subscribers, $contentType); return $response; } @@ -10230,14 +12558,15 @@ public function importOptInListSubscribers($list_id, $wtsms_import_opt_in_list_s * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTSMSImportOptInListSubscribers $wtsms_import_opt_in_list_subscribers (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importOptInListSubscribers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function importOptInListSubscribersWithHttpInfo($list_id, $wtsms_import_opt_in_list_subscribers) + public function importOptInListSubscribersWithHttpInfo($list_id, $wtsms_import_opt_in_list_subscribers, string $contentType = self::contentTypes['importOptInListSubscribers'][0]) { - $request = $this->importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in_list_subscribers); + $request = $this->importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in_list_subscribers, $contentType); try { $options = $this->createHttpClientOption(); @@ -10280,6 +12609,21 @@ public function importOptInListSubscribersWithHttpInfo($list_id, $wtsms_import_o $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10292,6 +12636,21 @@ public function importOptInListSubscribersWithHttpInfo($list_id, $wtsms_import_o $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10304,6 +12663,21 @@ public function importOptInListSubscribersWithHttpInfo($list_id, $wtsms_import_o $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10316,6 +12690,21 @@ public function importOptInListSubscribersWithHttpInfo($list_id, $wtsms_import_o $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10330,6 +12719,21 @@ public function importOptInListSubscribersWithHttpInfo($list_id, $wtsms_import_o $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10384,13 +12788,14 @@ public function importOptInListSubscribersWithHttpInfo($list_id, $wtsms_import_o * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTSMSImportOptInListSubscribers $wtsms_import_opt_in_list_subscribers (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importOptInListSubscribersAsync($list_id, $wtsms_import_opt_in_list_subscribers) + public function importOptInListSubscribersAsync($list_id, $wtsms_import_opt_in_list_subscribers, string $contentType = self::contentTypes['importOptInListSubscribers'][0]) { - return $this->importOptInListSubscribersAsyncWithHttpInfo($list_id, $wtsms_import_opt_in_list_subscribers) + return $this->importOptInListSubscribersAsyncWithHttpInfo($list_id, $wtsms_import_opt_in_list_subscribers, $contentType) ->then( function ($response) { return $response[0]; @@ -10405,14 +12810,15 @@ function ($response) { * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTSMSImportOptInListSubscribers $wtsms_import_opt_in_list_subscribers (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function importOptInListSubscribersAsyncWithHttpInfo($list_id, $wtsms_import_opt_in_list_subscribers) + public function importOptInListSubscribersAsyncWithHttpInfo($list_id, $wtsms_import_opt_in_list_subscribers, string $contentType = self::contentTypes['importOptInListSubscribers'][0]) { $returnType = 'string'; - $request = $this->importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in_list_subscribers); + $request = $this->importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in_list_subscribers, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10422,6 +12828,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10452,12 +12861,14 @@ function ($exception) { * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTSMSImportOptInListSubscribers $wtsms_import_opt_in_list_subscribers (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['importOptInListSubscribers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in_list_subscribers) + public function importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in_list_subscribers, string $contentType = self::contentTypes['importOptInListSubscribers'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -10473,7 +12884,7 @@ public function importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in if (!preg_match("/^[a-zA-Z0-9]+$/", $list_id)) { throw new \InvalidArgumentException("invalid value for \"list_id\" when calling SMSApi.importOptInListSubscribers, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'wtsms_import_opt_in_list_subscribers' is set if ($wtsms_import_opt_in_list_subscribers === null || (is_array($wtsms_import_opt_in_list_subscribers) && count($wtsms_import_opt_in_list_subscribers) === 0)) { throw new \InvalidArgumentException( @@ -10481,6 +12892,7 @@ public function importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in ); } + $resourcePath = '/v2/sms/optInList/subscribers/import/{listID}'; $formParams = []; $queryParams = []; @@ -10500,21 +12912,17 @@ public function importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wtsms_import_opt_in_list_subscribers)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wtsms_import_opt_in_list_subscribers)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wtsms_import_opt_in_list_subscribers)); } else { $httpBody = $wtsms_import_opt_in_list_subscribers; } @@ -10533,12 +12941,12 @@ public function importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -10554,10 +12962,11 @@ public function importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -10569,14 +12978,15 @@ public function importOptInListSubscribersRequest($list_id, $wtsms_import_opt_in * Restore phone number * * @param string $phone_number_id phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PhoneNumber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restorePhoneNumber($phone_number_id) + public function restorePhoneNumber($phone_number_id, string $contentType = self::contentTypes['restorePhoneNumber'][0]) { - list($response) = $this->restorePhoneNumberWithHttpInfo($phone_number_id); + list($response) = $this->restorePhoneNumberWithHttpInfo($phone_number_id, $contentType); return $response; } @@ -10586,14 +12996,15 @@ public function restorePhoneNumber($phone_number_id) * Restore phone number * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PhoneNumber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restorePhoneNumberWithHttpInfo($phone_number_id) + public function restorePhoneNumberWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['restorePhoneNumber'][0]) { - $request = $this->restorePhoneNumberRequest($phone_number_id); + $request = $this->restorePhoneNumberRequest($phone_number_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -10636,6 +13047,21 @@ public function restorePhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PhoneNumber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10648,6 +13074,21 @@ public function restorePhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10660,6 +13101,21 @@ public function restorePhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10672,6 +13128,21 @@ public function restorePhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10686,6 +13157,21 @@ public function restorePhoneNumberWithHttpInfo($phone_number_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10739,13 +13225,14 @@ public function restorePhoneNumberWithHttpInfo($phone_number_id) * Restore phone number * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restorePhoneNumberAsync($phone_number_id) + public function restorePhoneNumberAsync($phone_number_id, string $contentType = self::contentTypes['restorePhoneNumber'][0]) { - return $this->restorePhoneNumberAsyncWithHttpInfo($phone_number_id) + return $this->restorePhoneNumberAsyncWithHttpInfo($phone_number_id, $contentType) ->then( function ($response) { return $response[0]; @@ -10759,14 +13246,15 @@ function ($response) { * Restore phone number * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restorePhoneNumberAsyncWithHttpInfo($phone_number_id) + public function restorePhoneNumberAsyncWithHttpInfo($phone_number_id, string $contentType = self::contentTypes['restorePhoneNumber'][0]) { $returnType = '\OpenAPI\Client\Model\PhoneNumber'; - $request = $this->restorePhoneNumberRequest($phone_number_id); + $request = $this->restorePhoneNumberRequest($phone_number_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10776,6 +13264,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -10805,12 +13296,14 @@ function ($exception) { * Create request for operation 'restorePhoneNumber' * * @param string $phone_number_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restorePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restorePhoneNumberRequest($phone_number_id) + public function restorePhoneNumberRequest($phone_number_id, string $contentType = self::contentTypes['restorePhoneNumber'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -10826,7 +13319,7 @@ public function restorePhoneNumberRequest($phone_number_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling SMSApi.restorePhoneNumber, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/phoneNumber/{phoneNumberID}'; $formParams = []; @@ -10847,16 +13340,11 @@ public function restorePhoneNumberRequest($phone_number_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -10874,12 +13362,12 @@ public function restorePhoneNumberRequest($phone_number_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -10895,10 +13383,11 @@ public function restorePhoneNumberRequest($phone_number_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -10910,14 +13399,15 @@ public function restorePhoneNumberRequest($phone_number_id) * Restore recipient * * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreRecipient'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ImportedListRecipient|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreRecipient($id) + public function restoreRecipient($id, string $contentType = self::contentTypes['restoreRecipient'][0]) { - list($response) = $this->restoreRecipientWithHttpInfo($id); + list($response) = $this->restoreRecipientWithHttpInfo($id, $contentType); return $response; } @@ -10927,14 +13417,15 @@ public function restoreRecipient($id) * Restore recipient * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreRecipient'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ImportedListRecipient|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreRecipientWithHttpInfo($id) + public function restoreRecipientWithHttpInfo($id, string $contentType = self::contentTypes['restoreRecipient'][0]) { - $request = $this->restoreRecipientRequest($id); + $request = $this->restoreRecipientRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -10977,6 +13468,21 @@ public function restoreRecipientWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ImportedListRecipient' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -10989,6 +13495,21 @@ public function restoreRecipientWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11001,6 +13522,21 @@ public function restoreRecipientWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11013,6 +13549,21 @@ public function restoreRecipientWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11027,6 +13578,21 @@ public function restoreRecipientWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11080,13 +13646,14 @@ public function restoreRecipientWithHttpInfo($id) * Restore recipient * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreRecipientAsync($id) + public function restoreRecipientAsync($id, string $contentType = self::contentTypes['restoreRecipient'][0]) { - return $this->restoreRecipientAsyncWithHttpInfo($id) + return $this->restoreRecipientAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -11100,14 +13667,15 @@ function ($response) { * Restore recipient * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreRecipientAsyncWithHttpInfo($id) + public function restoreRecipientAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreRecipient'][0]) { $returnType = '\OpenAPI\Client\Model\ImportedListRecipient'; - $request = $this->restoreRecipientRequest($id); + $request = $this->restoreRecipientRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11117,6 +13685,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -11146,12 +13717,14 @@ function ($exception) { * Create request for operation 'restoreRecipient' * * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreRecipient'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreRecipientRequest($id) + public function restoreRecipientRequest($id, string $contentType = self::contentTypes['restoreRecipient'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -11167,7 +13740,7 @@ public function restoreRecipientRequest($id) if (!preg_match("/^[a-zA-Z0-9]+$/", $id)) { throw new \InvalidArgumentException("invalid value for \"id\" when calling SMSApi.restoreRecipient, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/sms/importedList/recipients/{id}'; $formParams = []; @@ -11188,16 +13761,11 @@ public function restoreRecipientRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -11215,12 +13783,12 @@ public function restoreRecipientRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -11236,10 +13804,11 @@ public function restoreRecipientRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -11250,14 +13819,15 @@ public function restoreRecipientRequest($id) * * Retrieve the number of messages sent by the merchant within the current billing cycle * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['retrieveSentAndMaxCountOfMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function retrieveSentAndMaxCountOfMessages() + public function retrieveSentAndMaxCountOfMessages(string $contentType = self::contentTypes['retrieveSentAndMaxCountOfMessages'][0]) { - list($response) = $this->retrieveSentAndMaxCountOfMessagesWithHttpInfo(); + list($response) = $this->retrieveSentAndMaxCountOfMessagesWithHttpInfo($contentType); return $response; } @@ -11266,14 +13836,15 @@ public function retrieveSentAndMaxCountOfMessages() * * Retrieve the number of messages sent by the merchant within the current billing cycle * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['retrieveSentAndMaxCountOfMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function retrieveSentAndMaxCountOfMessagesWithHttpInfo() + public function retrieveSentAndMaxCountOfMessagesWithHttpInfo(string $contentType = self::contentTypes['retrieveSentAndMaxCountOfMessages'][0]) { - $request = $this->retrieveSentAndMaxCountOfMessagesRequest(); + $request = $this->retrieveSentAndMaxCountOfMessagesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -11316,6 +13887,21 @@ public function retrieveSentAndMaxCountOfMessagesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11328,6 +13914,21 @@ public function retrieveSentAndMaxCountOfMessagesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11340,6 +13941,21 @@ public function retrieveSentAndMaxCountOfMessagesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11352,6 +13968,21 @@ public function retrieveSentAndMaxCountOfMessagesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11366,6 +13997,21 @@ public function retrieveSentAndMaxCountOfMessagesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11418,13 +14064,14 @@ public function retrieveSentAndMaxCountOfMessagesWithHttpInfo() * * Retrieve the number of messages sent by the merchant within the current billing cycle * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['retrieveSentAndMaxCountOfMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function retrieveSentAndMaxCountOfMessagesAsync() + public function retrieveSentAndMaxCountOfMessagesAsync(string $contentType = self::contentTypes['retrieveSentAndMaxCountOfMessages'][0]) { - return $this->retrieveSentAndMaxCountOfMessagesAsyncWithHttpInfo() + return $this->retrieveSentAndMaxCountOfMessagesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -11437,14 +14084,15 @@ function ($response) { * * Retrieve the number of messages sent by the merchant within the current billing cycle * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['retrieveSentAndMaxCountOfMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function retrieveSentAndMaxCountOfMessagesAsyncWithHttpInfo() + public function retrieveSentAndMaxCountOfMessagesAsyncWithHttpInfo(string $contentType = self::contentTypes['retrieveSentAndMaxCountOfMessages'][0]) { $returnType = 'mixed'; - $request = $this->retrieveSentAndMaxCountOfMessagesRequest(); + $request = $this->retrieveSentAndMaxCountOfMessagesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11454,6 +14102,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -11482,13 +14133,15 @@ function ($exception) { /** * Create request for operation 'retrieveSentAndMaxCountOfMessages' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['retrieveSentAndMaxCountOfMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function retrieveSentAndMaxCountOfMessagesRequest() + public function retrieveSentAndMaxCountOfMessagesRequest(string $contentType = self::contentTypes['retrieveSentAndMaxCountOfMessages'][0]) { + $resourcePath = '/v2/sms/sent'; $formParams = []; $queryParams = []; @@ -11500,16 +14153,11 @@ public function retrieveSentAndMaxCountOfMessagesRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -11527,12 +14175,12 @@ public function retrieveSentAndMaxCountOfMessagesRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -11548,10 +14196,11 @@ public function retrieveSentAndMaxCountOfMessagesRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -11564,14 +14213,15 @@ public function retrieveSentAndMaxCountOfMessagesRequest() * * @param string $list_id list_id (required) * @param \OpenAPI\Client\Model\WTSMSImportedListCreate $wtsms_imported_list_create wtsms_imported_list_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveImportedList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ImportedList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function saveImportedList($list_id, $wtsms_imported_list_create) + public function saveImportedList($list_id, $wtsms_imported_list_create, string $contentType = self::contentTypes['saveImportedList'][0]) { - list($response) = $this->saveImportedListWithHttpInfo($list_id, $wtsms_imported_list_create); + list($response) = $this->saveImportedListWithHttpInfo($list_id, $wtsms_imported_list_create, $contentType); return $response; } @@ -11582,14 +14232,15 @@ public function saveImportedList($list_id, $wtsms_imported_list_create) * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTSMSImportedListCreate $wtsms_imported_list_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveImportedList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ImportedList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function saveImportedListWithHttpInfo($list_id, $wtsms_imported_list_create) + public function saveImportedListWithHttpInfo($list_id, $wtsms_imported_list_create, string $contentType = self::contentTypes['saveImportedList'][0]) { - $request = $this->saveImportedListRequest($list_id, $wtsms_imported_list_create); + $request = $this->saveImportedListRequest($list_id, $wtsms_imported_list_create, $contentType); try { $options = $this->createHttpClientOption(); @@ -11632,6 +14283,21 @@ public function saveImportedListWithHttpInfo($list_id, $wtsms_imported_list_crea $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ImportedList' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11644,6 +14310,21 @@ public function saveImportedListWithHttpInfo($list_id, $wtsms_imported_list_crea $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11656,6 +14337,21 @@ public function saveImportedListWithHttpInfo($list_id, $wtsms_imported_list_crea $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11668,6 +14364,21 @@ public function saveImportedListWithHttpInfo($list_id, $wtsms_imported_list_crea $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11682,6 +14393,21 @@ public function saveImportedListWithHttpInfo($list_id, $wtsms_imported_list_crea $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -11736,13 +14462,14 @@ public function saveImportedListWithHttpInfo($list_id, $wtsms_imported_list_crea * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTSMSImportedListCreate $wtsms_imported_list_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveImportedListAsync($list_id, $wtsms_imported_list_create) + public function saveImportedListAsync($list_id, $wtsms_imported_list_create, string $contentType = self::contentTypes['saveImportedList'][0]) { - return $this->saveImportedListAsyncWithHttpInfo($list_id, $wtsms_imported_list_create) + return $this->saveImportedListAsyncWithHttpInfo($list_id, $wtsms_imported_list_create, $contentType) ->then( function ($response) { return $response[0]; @@ -11757,14 +14484,15 @@ function ($response) { * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTSMSImportedListCreate $wtsms_imported_list_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveImportedListAsyncWithHttpInfo($list_id, $wtsms_imported_list_create) + public function saveImportedListAsyncWithHttpInfo($list_id, $wtsms_imported_list_create, string $contentType = self::contentTypes['saveImportedList'][0]) { $returnType = '\OpenAPI\Client\Model\ImportedList'; - $request = $this->saveImportedListRequest($list_id, $wtsms_imported_list_create); + $request = $this->saveImportedListRequest($list_id, $wtsms_imported_list_create, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11774,6 +14502,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -11804,12 +14535,14 @@ function ($exception) { * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTSMSImportedListCreate $wtsms_imported_list_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveImportedList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function saveImportedListRequest($list_id, $wtsms_imported_list_create) + public function saveImportedListRequest($list_id, $wtsms_imported_list_create, string $contentType = self::contentTypes['saveImportedList'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -11825,7 +14558,7 @@ public function saveImportedListRequest($list_id, $wtsms_imported_list_create) if (!preg_match("/^[a-zA-Z0-9]+$/", $list_id)) { throw new \InvalidArgumentException("invalid value for \"list_id\" when calling SMSApi.saveImportedList, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'wtsms_imported_list_create' is set if ($wtsms_imported_list_create === null || (is_array($wtsms_imported_list_create) && count($wtsms_imported_list_create) === 0)) { throw new \InvalidArgumentException( @@ -11833,6 +14566,7 @@ public function saveImportedListRequest($list_id, $wtsms_imported_list_create) ); } + $resourcePath = '/v2/sms/importedList/{listID}'; $formParams = []; $queryParams = []; @@ -11852,21 +14586,17 @@ public function saveImportedListRequest($list_id, $wtsms_imported_list_create) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wtsms_imported_list_create)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wtsms_imported_list_create)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wtsms_imported_list_create)); } else { $httpBody = $wtsms_imported_list_create; } @@ -11885,12 +14615,12 @@ public function saveImportedListRequest($list_id, $wtsms_imported_list_create) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -11906,10 +14636,11 @@ public function saveImportedListRequest($list_id, $wtsms_imported_list_create) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -11922,14 +14653,15 @@ public function saveImportedListRequest($list_id, $wtsms_imported_list_create) * * @param string $list_id list_id (required) * @param \OpenAPI\Client\Model\WTOptInListCreationParams $wt_opt_in_list_creation_params wt_opt_in_list_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveOptInList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OptInList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function saveOptInList($list_id, $wt_opt_in_list_creation_params) + public function saveOptInList($list_id, $wt_opt_in_list_creation_params, string $contentType = self::contentTypes['saveOptInList'][0]) { - list($response) = $this->saveOptInListWithHttpInfo($list_id, $wt_opt_in_list_creation_params); + list($response) = $this->saveOptInListWithHttpInfo($list_id, $wt_opt_in_list_creation_params, $contentType); return $response; } @@ -11940,14 +14672,15 @@ public function saveOptInList($list_id, $wt_opt_in_list_creation_params) * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTOptInListCreationParams $wt_opt_in_list_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveOptInList'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OptInList|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function saveOptInListWithHttpInfo($list_id, $wt_opt_in_list_creation_params) + public function saveOptInListWithHttpInfo($list_id, $wt_opt_in_list_creation_params, string $contentType = self::contentTypes['saveOptInList'][0]) { - $request = $this->saveOptInListRequest($list_id, $wt_opt_in_list_creation_params); + $request = $this->saveOptInListRequest($list_id, $wt_opt_in_list_creation_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -11990,6 +14723,21 @@ public function saveOptInListWithHttpInfo($list_id, $wt_opt_in_list_creation_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptInList' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12002,6 +14750,21 @@ public function saveOptInListWithHttpInfo($list_id, $wt_opt_in_list_creation_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12014,6 +14777,21 @@ public function saveOptInListWithHttpInfo($list_id, $wt_opt_in_list_creation_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12026,6 +14804,21 @@ public function saveOptInListWithHttpInfo($list_id, $wt_opt_in_list_creation_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12040,6 +14833,21 @@ public function saveOptInListWithHttpInfo($list_id, $wt_opt_in_list_creation_par $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12094,13 +14902,14 @@ public function saveOptInListWithHttpInfo($list_id, $wt_opt_in_list_creation_par * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTOptInListCreationParams $wt_opt_in_list_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveOptInList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveOptInListAsync($list_id, $wt_opt_in_list_creation_params) + public function saveOptInListAsync($list_id, $wt_opt_in_list_creation_params, string $contentType = self::contentTypes['saveOptInList'][0]) { - return $this->saveOptInListAsyncWithHttpInfo($list_id, $wt_opt_in_list_creation_params) + return $this->saveOptInListAsyncWithHttpInfo($list_id, $wt_opt_in_list_creation_params, $contentType) ->then( function ($response) { return $response[0]; @@ -12115,14 +14924,15 @@ function ($response) { * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTOptInListCreationParams $wt_opt_in_list_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveOptInList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveOptInListAsyncWithHttpInfo($list_id, $wt_opt_in_list_creation_params) + public function saveOptInListAsyncWithHttpInfo($list_id, $wt_opt_in_list_creation_params, string $contentType = self::contentTypes['saveOptInList'][0]) { $returnType = '\OpenAPI\Client\Model\OptInList'; - $request = $this->saveOptInListRequest($list_id, $wt_opt_in_list_creation_params); + $request = $this->saveOptInListRequest($list_id, $wt_opt_in_list_creation_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12132,6 +14942,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -12162,12 +14975,14 @@ function ($exception) { * * @param string $list_id (required) * @param \OpenAPI\Client\Model\WTOptInListCreationParams $wt_opt_in_list_creation_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveOptInList'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function saveOptInListRequest($list_id, $wt_opt_in_list_creation_params) + public function saveOptInListRequest($list_id, $wt_opt_in_list_creation_params, string $contentType = self::contentTypes['saveOptInList'][0]) { + // verify the required parameter 'list_id' is set if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( @@ -12183,7 +14998,7 @@ public function saveOptInListRequest($list_id, $wt_opt_in_list_creation_params) if (!preg_match("/^[a-zA-Z0-9]+$/", $list_id)) { throw new \InvalidArgumentException("invalid value for \"list_id\" when calling SMSApi.saveOptInList, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'wt_opt_in_list_creation_params' is set if ($wt_opt_in_list_creation_params === null || (is_array($wt_opt_in_list_creation_params) && count($wt_opt_in_list_creation_params) === 0)) { throw new \InvalidArgumentException( @@ -12191,6 +15006,7 @@ public function saveOptInListRequest($list_id, $wt_opt_in_list_creation_params) ); } + $resourcePath = '/v2/sms/optInList/{listID}'; $formParams = []; $queryParams = []; @@ -12210,21 +15026,17 @@ public function saveOptInListRequest($list_id, $wt_opt_in_list_creation_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_opt_in_list_creation_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_opt_in_list_creation_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_opt_in_list_creation_params)); } else { $httpBody = $wt_opt_in_list_creation_params; } @@ -12243,12 +15055,12 @@ public function saveOptInListRequest($list_id, $wt_opt_in_list_creation_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -12264,10 +15076,11 @@ public function saveOptInListRequest($list_id, $wt_opt_in_list_creation_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -12280,14 +15093,15 @@ public function saveOptInListRequest($list_id, $wt_opt_in_list_creation_params) * * @param string $source_id source_id (required) * @param \OpenAPI\Client\Model\WTSMSOptInListSourceCreate $wtsms_opt_in_list_source_create wtsms_opt_in_list_source_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveOptInListSource'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\OptInListSource|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function saveOptInListSource($source_id, $wtsms_opt_in_list_source_create) + public function saveOptInListSource($source_id, $wtsms_opt_in_list_source_create, string $contentType = self::contentTypes['saveOptInListSource'][0]) { - list($response) = $this->saveOptInListSourceWithHttpInfo($source_id, $wtsms_opt_in_list_source_create); + list($response) = $this->saveOptInListSourceWithHttpInfo($source_id, $wtsms_opt_in_list_source_create, $contentType); return $response; } @@ -12298,14 +15112,15 @@ public function saveOptInListSource($source_id, $wtsms_opt_in_list_source_create * * @param string $source_id (required) * @param \OpenAPI\Client\Model\WTSMSOptInListSourceCreate $wtsms_opt_in_list_source_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveOptInListSource'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OptInListSource|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function saveOptInListSourceWithHttpInfo($source_id, $wtsms_opt_in_list_source_create) + public function saveOptInListSourceWithHttpInfo($source_id, $wtsms_opt_in_list_source_create, string $contentType = self::contentTypes['saveOptInListSource'][0]) { - $request = $this->saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source_create); + $request = $this->saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source_create, $contentType); try { $options = $this->createHttpClientOption(); @@ -12348,6 +15163,21 @@ public function saveOptInListSourceWithHttpInfo($source_id, $wtsms_opt_in_list_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\OptInListSource' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12360,6 +15190,21 @@ public function saveOptInListSourceWithHttpInfo($source_id, $wtsms_opt_in_list_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12372,6 +15217,21 @@ public function saveOptInListSourceWithHttpInfo($source_id, $wtsms_opt_in_list_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12384,6 +15244,21 @@ public function saveOptInListSourceWithHttpInfo($source_id, $wtsms_opt_in_list_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12398,6 +15273,21 @@ public function saveOptInListSourceWithHttpInfo($source_id, $wtsms_opt_in_list_s $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12452,13 +15342,14 @@ public function saveOptInListSourceWithHttpInfo($source_id, $wtsms_opt_in_list_s * * @param string $source_id (required) * @param \OpenAPI\Client\Model\WTSMSOptInListSourceCreate $wtsms_opt_in_list_source_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveOptInListSource'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveOptInListSourceAsync($source_id, $wtsms_opt_in_list_source_create) + public function saveOptInListSourceAsync($source_id, $wtsms_opt_in_list_source_create, string $contentType = self::contentTypes['saveOptInListSource'][0]) { - return $this->saveOptInListSourceAsyncWithHttpInfo($source_id, $wtsms_opt_in_list_source_create) + return $this->saveOptInListSourceAsyncWithHttpInfo($source_id, $wtsms_opt_in_list_source_create, $contentType) ->then( function ($response) { return $response[0]; @@ -12473,14 +15364,15 @@ function ($response) { * * @param string $source_id (required) * @param \OpenAPI\Client\Model\WTSMSOptInListSourceCreate $wtsms_opt_in_list_source_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveOptInListSource'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveOptInListSourceAsyncWithHttpInfo($source_id, $wtsms_opt_in_list_source_create) + public function saveOptInListSourceAsyncWithHttpInfo($source_id, $wtsms_opt_in_list_source_create, string $contentType = self::contentTypes['saveOptInListSource'][0]) { $returnType = '\OpenAPI\Client\Model\OptInListSource'; - $request = $this->saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source_create); + $request = $this->saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source_create, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12490,6 +15382,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -12520,12 +15415,14 @@ function ($exception) { * * @param string $source_id (required) * @param \OpenAPI\Client\Model\WTSMSOptInListSourceCreate $wtsms_opt_in_list_source_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveOptInListSource'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source_create) + public function saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source_create, string $contentType = self::contentTypes['saveOptInListSource'][0]) { + // verify the required parameter 'source_id' is set if ($source_id === null || (is_array($source_id) && count($source_id) === 0)) { throw new \InvalidArgumentException( @@ -12541,7 +15438,7 @@ public function saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source if (!preg_match("/^[a-zA-Z0-9]+$/", $source_id)) { throw new \InvalidArgumentException("invalid value for \"source_id\" when calling SMSApi.saveOptInListSource, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'wtsms_opt_in_list_source_create' is set if ($wtsms_opt_in_list_source_create === null || (is_array($wtsms_opt_in_list_source_create) && count($wtsms_opt_in_list_source_create) === 0)) { throw new \InvalidArgumentException( @@ -12549,6 +15446,7 @@ public function saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source ); } + $resourcePath = '/v2/sms/optInListSource/{sourceID}'; $formParams = []; $queryParams = []; @@ -12568,21 +15466,17 @@ public function saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wtsms_opt_in_list_source_create)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wtsms_opt_in_list_source_create)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wtsms_opt_in_list_source_create)); } else { $httpBody = $wtsms_opt_in_list_source_create; } @@ -12601,12 +15495,12 @@ public function saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -12622,10 +15516,11 @@ public function saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -12638,14 +15533,15 @@ public function saveOptInListSourceRequest($source_id, $wtsms_opt_in_list_source * * @param string $phone_number_id phone_number_id (required) * @param \OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig $wtsms_update_phone_number_config wtsms_update_phone_number_config (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendPhoneNumberForVerification'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function sendPhoneNumberForVerification($phone_number_id, $wtsms_update_phone_number_config) + public function sendPhoneNumberForVerification($phone_number_id, $wtsms_update_phone_number_config, string $contentType = self::contentTypes['sendPhoneNumberForVerification'][0]) { - list($response) = $this->sendPhoneNumberForVerificationWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config); + list($response) = $this->sendPhoneNumberForVerificationWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config, $contentType); return $response; } @@ -12656,14 +15552,15 @@ public function sendPhoneNumberForVerification($phone_number_id, $wtsms_update_p * * @param string $phone_number_id (required) * @param \OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig $wtsms_update_phone_number_config (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendPhoneNumberForVerification'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of string|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function sendPhoneNumberForVerificationWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config) + public function sendPhoneNumberForVerificationWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config, string $contentType = self::contentTypes['sendPhoneNumberForVerification'][0]) { - $request = $this->sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_update_phone_number_config); + $request = $this->sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_update_phone_number_config, $contentType); try { $options = $this->createHttpClientOption(); @@ -12706,6 +15603,21 @@ public function sendPhoneNumberForVerificationWithHttpInfo($phone_number_id, $wt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12718,6 +15630,21 @@ public function sendPhoneNumberForVerificationWithHttpInfo($phone_number_id, $wt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12730,6 +15657,21 @@ public function sendPhoneNumberForVerificationWithHttpInfo($phone_number_id, $wt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12742,6 +15684,21 @@ public function sendPhoneNumberForVerificationWithHttpInfo($phone_number_id, $wt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12756,6 +15713,21 @@ public function sendPhoneNumberForVerificationWithHttpInfo($phone_number_id, $wt $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -12810,13 +15782,14 @@ public function sendPhoneNumberForVerificationWithHttpInfo($phone_number_id, $wt * * @param string $phone_number_id (required) * @param \OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig $wtsms_update_phone_number_config (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendPhoneNumberForVerification'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendPhoneNumberForVerificationAsync($phone_number_id, $wtsms_update_phone_number_config) + public function sendPhoneNumberForVerificationAsync($phone_number_id, $wtsms_update_phone_number_config, string $contentType = self::contentTypes['sendPhoneNumberForVerification'][0]) { - return $this->sendPhoneNumberForVerificationAsyncWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config) + return $this->sendPhoneNumberForVerificationAsyncWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config, $contentType) ->then( function ($response) { return $response[0]; @@ -12831,14 +15804,15 @@ function ($response) { * * @param string $phone_number_id (required) * @param \OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig $wtsms_update_phone_number_config (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendPhoneNumberForVerification'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function sendPhoneNumberForVerificationAsyncWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config) + public function sendPhoneNumberForVerificationAsyncWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config, string $contentType = self::contentTypes['sendPhoneNumberForVerification'][0]) { $returnType = 'string'; - $request = $this->sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_update_phone_number_config); + $request = $this->sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_update_phone_number_config, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12848,6 +15822,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -12878,12 +15855,14 @@ function ($exception) { * * @param string $phone_number_id (required) * @param \OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig $wtsms_update_phone_number_config (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['sendPhoneNumberForVerification'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_update_phone_number_config) + public function sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_update_phone_number_config, string $contentType = self::contentTypes['sendPhoneNumberForVerification'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -12899,7 +15878,7 @@ public function sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_u if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling SMSApi.sendPhoneNumberForVerification, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'wtsms_update_phone_number_config' is set if ($wtsms_update_phone_number_config === null || (is_array($wtsms_update_phone_number_config) && count($wtsms_update_phone_number_config) === 0)) { throw new \InvalidArgumentException( @@ -12907,6 +15886,7 @@ public function sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_u ); } + $resourcePath = '/v2/sms/phoneNumber/verification/{phoneNumberID}'; $formParams = []; $queryParams = []; @@ -12926,21 +15906,17 @@ public function sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_u } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wtsms_update_phone_number_config)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wtsms_update_phone_number_config)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wtsms_update_phone_number_config)); } else { $httpBody = $wtsms_update_phone_number_config; } @@ -12959,12 +15935,12 @@ public function sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_u // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -12980,10 +15956,11 @@ public function sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_u $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -12996,14 +15973,15 @@ public function sendPhoneNumberForVerificationRequest($phone_number_id, $wtsms_u * * @param string $phone_number_id phone_number_id (required) * @param \OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig $wtsms_update_phone_number_config wtsms_update_phone_number_config (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\PhoneNumber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updatePhoneNumber($phone_number_id, $wtsms_update_phone_number_config) + public function updatePhoneNumber($phone_number_id, $wtsms_update_phone_number_config, string $contentType = self::contentTypes['updatePhoneNumber'][0]) { - list($response) = $this->updatePhoneNumberWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config); + list($response) = $this->updatePhoneNumberWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config, $contentType); return $response; } @@ -13014,14 +15992,15 @@ public function updatePhoneNumber($phone_number_id, $wtsms_update_phone_number_c * * @param string $phone_number_id (required) * @param \OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig $wtsms_update_phone_number_config (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhoneNumber'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\PhoneNumber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updatePhoneNumberWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config) + public function updatePhoneNumberWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config, string $contentType = self::contentTypes['updatePhoneNumber'][0]) { - $request = $this->updatePhoneNumberRequest($phone_number_id, $wtsms_update_phone_number_config); + $request = $this->updatePhoneNumberRequest($phone_number_id, $wtsms_update_phone_number_config, $contentType); try { $options = $this->createHttpClientOption(); @@ -13064,6 +16043,21 @@ public function updatePhoneNumberWithHttpInfo($phone_number_id, $wtsms_update_ph $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\PhoneNumber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13076,6 +16070,21 @@ public function updatePhoneNumberWithHttpInfo($phone_number_id, $wtsms_update_ph $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13088,6 +16097,21 @@ public function updatePhoneNumberWithHttpInfo($phone_number_id, $wtsms_update_ph $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13100,6 +16124,21 @@ public function updatePhoneNumberWithHttpInfo($phone_number_id, $wtsms_update_ph $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13114,6 +16153,21 @@ public function updatePhoneNumberWithHttpInfo($phone_number_id, $wtsms_update_ph $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -13168,13 +16222,14 @@ public function updatePhoneNumberWithHttpInfo($phone_number_id, $wtsms_update_ph * * @param string $phone_number_id (required) * @param \OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig $wtsms_update_phone_number_config (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePhoneNumberAsync($phone_number_id, $wtsms_update_phone_number_config) + public function updatePhoneNumberAsync($phone_number_id, $wtsms_update_phone_number_config, string $contentType = self::contentTypes['updatePhoneNumber'][0]) { - return $this->updatePhoneNumberAsyncWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config) + return $this->updatePhoneNumberAsyncWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config, $contentType) ->then( function ($response) { return $response[0]; @@ -13189,14 +16244,15 @@ function ($response) { * * @param string $phone_number_id (required) * @param \OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig $wtsms_update_phone_number_config (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePhoneNumberAsyncWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config) + public function updatePhoneNumberAsyncWithHttpInfo($phone_number_id, $wtsms_update_phone_number_config, string $contentType = self::contentTypes['updatePhoneNumber'][0]) { $returnType = '\OpenAPI\Client\Model\PhoneNumber'; - $request = $this->updatePhoneNumberRequest($phone_number_id, $wtsms_update_phone_number_config); + $request = $this->updatePhoneNumberRequest($phone_number_id, $wtsms_update_phone_number_config, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13206,6 +16262,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -13236,12 +16295,14 @@ function ($exception) { * * @param string $phone_number_id (required) * @param \OpenAPI\Client\Model\WTSMSUpdatePhoneNumberConfig $wtsms_update_phone_number_config (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updatePhoneNumber'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updatePhoneNumberRequest($phone_number_id, $wtsms_update_phone_number_config) + public function updatePhoneNumberRequest($phone_number_id, $wtsms_update_phone_number_config, string $contentType = self::contentTypes['updatePhoneNumber'][0]) { + // verify the required parameter 'phone_number_id' is set if ($phone_number_id === null || (is_array($phone_number_id) && count($phone_number_id) === 0)) { throw new \InvalidArgumentException( @@ -13257,7 +16318,7 @@ public function updatePhoneNumberRequest($phone_number_id, $wtsms_update_phone_n if (!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id)) { throw new \InvalidArgumentException("invalid value for \"phone_number_id\" when calling SMSApi.updatePhoneNumber, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'wtsms_update_phone_number_config' is set if ($wtsms_update_phone_number_config === null || (is_array($wtsms_update_phone_number_config) && count($wtsms_update_phone_number_config) === 0)) { throw new \InvalidArgumentException( @@ -13265,6 +16326,7 @@ public function updatePhoneNumberRequest($phone_number_id, $wtsms_update_phone_n ); } + $resourcePath = '/v2/sms/phoneNumber/{phoneNumberID}'; $formParams = []; $queryParams = []; @@ -13284,21 +16346,17 @@ public function updatePhoneNumberRequest($phone_number_id, $wtsms_update_phone_n } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wtsms_update_phone_number_config)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wtsms_update_phone_number_config)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wtsms_update_phone_number_config)); } else { $httpBody = $wtsms_update_phone_number_config; } @@ -13317,12 +16375,12 @@ public function updatePhoneNumberRequest($phone_number_id, $wtsms_update_phone_n // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -13338,10 +16396,11 @@ public function updatePhoneNumberRequest($phone_number_id, $wtsms_update_phone_n $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/ServicesApi.php b/lib/Api/ServicesApi.php index 96da224..476e708 100644 --- a/lib/Api/ServicesApi.php +++ b/lib/Api/ServicesApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createService' => [ + 'application/json', + ], + 'fetchAllServices' => [ + 'application/json', + ], + 'restoreService' => [ + 'application/json', + ], + 'updateService' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive service * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveService'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Service|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveService($id) + public function archiveService($id, string $contentType = self::contentTypes['archiveService'][0]) { - list($response) = $this->archiveServiceWithHttpInfo($id); + list($response) = $this->archiveServiceWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveService($id) * Archive service * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveService'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Service|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveServiceWithHttpInfo($id) + public function archiveServiceWithHttpInfo($id, string $contentType = self::contentTypes['archiveService'][0]) { - $request = $this->archiveServiceRequest($id); + $request = $this->archiveServiceRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveServiceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Service' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveServiceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveServiceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveServiceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveServiceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveServiceWithHttpInfo($id) * Archive service * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveServiceAsync($id) + public function archiveServiceAsync($id, string $contentType = self::contentTypes['archiveService'][0]) { - return $this->archiveServiceAsyncWithHttpInfo($id) + return $this->archiveServiceAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive service * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveServiceAsyncWithHttpInfo($id) + public function archiveServiceAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveService'][0]) { $returnType = '\OpenAPI\Client\Model\Service'; - $request = $this->archiveServiceRequest($id); + $request = $this->archiveServiceRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveService' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveServiceRequest($id) + public function archiveServiceRequest($id, string $contentType = self::contentTypes['archiveService'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveServiceRequest($id) ); } + $resourcePath = '/v2/services/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveServiceRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveServiceRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveServiceRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveServiceRequest($id) * Create service * * @param \OpenAPI\Client\Model\WTServiceCreateParams $wt_service_create_params wt_service_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createService'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Service|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createService($wt_service_create_params) + public function createService($wt_service_create_params, string $contentType = self::contentTypes['createService'][0]) { - list($response) = $this->createServiceWithHttpInfo($wt_service_create_params); + list($response) = $this->createServiceWithHttpInfo($wt_service_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createService($wt_service_create_params) * Create service * * @param \OpenAPI\Client\Model\WTServiceCreateParams $wt_service_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createService'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Service|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createServiceWithHttpInfo($wt_service_create_params) + public function createServiceWithHttpInfo($wt_service_create_params, string $contentType = self::contentTypes['createService'][0]) { - $request = $this->createServiceRequest($wt_service_create_params); + $request = $this->createServiceRequest($wt_service_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createServiceWithHttpInfo($wt_service_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Service' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createServiceWithHttpInfo($wt_service_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createServiceWithHttpInfo($wt_service_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createServiceWithHttpInfo($wt_service_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createServiceWithHttpInfo($wt_service_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createServiceWithHttpInfo($wt_service_create_params) * Create service * * @param \OpenAPI\Client\Model\WTServiceCreateParams $wt_service_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createServiceAsync($wt_service_create_params) + public function createServiceAsync($wt_service_create_params, string $contentType = self::contentTypes['createService'][0]) { - return $this->createServiceAsyncWithHttpInfo($wt_service_create_params) + return $this->createServiceAsyncWithHttpInfo($wt_service_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create service * * @param \OpenAPI\Client\Model\WTServiceCreateParams $wt_service_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createServiceAsyncWithHttpInfo($wt_service_create_params) + public function createServiceAsyncWithHttpInfo($wt_service_create_params, string $contentType = self::contentTypes['createService'][0]) { $returnType = '\OpenAPI\Client\Model\Service'; - $request = $this->createServiceRequest($wt_service_create_params); + $request = $this->createServiceRequest($wt_service_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createService' * * @param \OpenAPI\Client\Model\WTServiceCreateParams $wt_service_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createServiceRequest($wt_service_create_params) + public function createServiceRequest($wt_service_create_params, string $contentType = self::contentTypes['createService'][0]) { + // verify the required parameter 'wt_service_create_params' is set if ($wt_service_create_params === null || (is_array($wt_service_create_params) && count($wt_service_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createServiceRequest($wt_service_create_params) ); } + $resourcePath = '/v2/services'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createServiceRequest($wt_service_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_service_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_service_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_service_create_params)); } else { $httpBody = $wt_service_create_params; } @@ -746,12 +927,12 @@ public function createServiceRequest($wt_service_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createServiceRequest($wt_service_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createServiceRequest($wt_service_create_params) * Fetch all services * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllServices'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllServices($is_archive_included = null) + public function fetchAllServices($is_archive_included = null, string $contentType = self::contentTypes['fetchAllServices'][0]) { - list($response) = $this->fetchAllServicesWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllServicesWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllServices($is_archive_included = null) * Fetch all services * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllServices'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllServicesWithHttpInfo($is_archive_included = null) + public function fetchAllServicesWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllServices'][0]) { - $request = $this->fetchAllServicesRequest($is_archive_included); + $request = $this->fetchAllServicesRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllServicesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllServicesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllServicesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllServicesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllServicesWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllServicesWithHttpInfo($is_archive_included = null) * Fetch all services * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllServicesAsync($is_archive_included = null) + public function fetchAllServicesAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllServices'][0]) { - return $this->fetchAllServicesAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllServicesAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all services * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllServicesAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllServicesAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllServices'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllServicesRequest($is_archive_included); + $request = $this->fetchAllServicesRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllServices' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllServices'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllServicesRequest($is_archive_included = null) + public function fetchAllServicesRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllServices'][0]) { + + $resourcePath = '/v2/services/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllServicesRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllServicesRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllServicesRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllServicesRequest($is_archive_included = null) * Restore service * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreService'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Service|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreService($id) + public function restoreService($id, string $contentType = self::contentTypes['restoreService'][0]) { - list($response) = $this->restoreServiceWithHttpInfo($id); + list($response) = $this->restoreServiceWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restoreService($id) * Restore service * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreService'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Service|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreServiceWithHttpInfo($id) + public function restoreServiceWithHttpInfo($id, string $contentType = self::contentTypes['restoreService'][0]) { - $request = $this->restoreServiceRequest($id); + $request = $this->restoreServiceRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restoreServiceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Service' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restoreServiceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restoreServiceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restoreServiceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restoreServiceWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restoreServiceWithHttpInfo($id) * Restore service * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreServiceAsync($id) + public function restoreServiceAsync($id, string $contentType = self::contentTypes['restoreService'][0]) { - return $this->restoreServiceAsyncWithHttpInfo($id) + return $this->restoreServiceAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore service * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreServiceAsyncWithHttpInfo($id) + public function restoreServiceAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreService'][0]) { $returnType = '\OpenAPI\Client\Model\Service'; - $request = $this->restoreServiceRequest($id); + $request = $this->restoreServiceRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restoreService' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreServiceRequest($id) + public function restoreServiceRequest($id, string $contentType = self::contentTypes['restoreService'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restoreServiceRequest($id) ); } + $resourcePath = '/v2/services/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restoreServiceRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restoreServiceRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restoreServiceRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restoreServiceRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTServiceUpdateParams $wt_service_update_params wt_service_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateService'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Service|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateService($id, $wt_service_update_params) + public function updateService($id, $wt_service_update_params, string $contentType = self::contentTypes['updateService'][0]) { - list($response) = $this->updateServiceWithHttpInfo($id, $wt_service_update_params); + list($response) = $this->updateServiceWithHttpInfo($id, $wt_service_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateService($id, $wt_service_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTServiceUpdateParams $wt_service_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateService'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Service|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateServiceWithHttpInfo($id, $wt_service_update_params) + public function updateServiceWithHttpInfo($id, $wt_service_update_params, string $contentType = self::contentTypes['updateService'][0]) { - $request = $this->updateServiceRequest($id, $wt_service_update_params); + $request = $this->updateServiceRequest($id, $wt_service_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateServiceWithHttpInfo($id, $wt_service_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Service' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateServiceWithHttpInfo($id, $wt_service_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateServiceWithHttpInfo($id, $wt_service_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateServiceWithHttpInfo($id, $wt_service_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateServiceWithHttpInfo($id, $wt_service_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateServiceWithHttpInfo($id, $wt_service_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTServiceUpdateParams $wt_service_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateServiceAsync($id, $wt_service_update_params) + public function updateServiceAsync($id, $wt_service_update_params, string $contentType = self::contentTypes['updateService'][0]) { - return $this->updateServiceAsyncWithHttpInfo($id, $wt_service_update_params) + return $this->updateServiceAsyncWithHttpInfo($id, $wt_service_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTServiceUpdateParams $wt_service_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateServiceAsyncWithHttpInfo($id, $wt_service_update_params) + public function updateServiceAsyncWithHttpInfo($id, $wt_service_update_params, string $contentType = self::contentTypes['updateService'][0]) { $returnType = '\OpenAPI\Client\Model\Service'; - $request = $this->updateServiceRequest($id, $wt_service_update_params); + $request = $this->updateServiceRequest($id, $wt_service_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTServiceUpdateParams $wt_service_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateService'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateServiceRequest($id, $wt_service_update_params) + public function updateServiceRequest($id, $wt_service_update_params, string $contentType = self::contentTypes['updateService'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateService' ); } + // verify the required parameter 'wt_service_update_params' is set if ($wt_service_update_params === null || (is_array($wt_service_update_params) && count($wt_service_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateServiceRequest($id, $wt_service_update_params) ); } + $resourcePath = '/v2/services/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateServiceRequest($id, $wt_service_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_service_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_service_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_service_update_params)); } else { $httpBody = $wt_service_update_params; } @@ -1753,12 +2177,12 @@ public function updateServiceRequest($id, $wt_service_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateServiceRequest($id, $wt_service_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/SettingsApi.php b/lib/Api/SettingsApi.php index a61fed2..fc403ef 100644 --- a/lib/Api/SettingsApi.php +++ b/lib/Api/SettingsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'getVouchersCount' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -121,14 +131,15 @@ public function getConfig() * * Get active campaigns * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getActiveCampaigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucherCampaign[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function getActiveCampaigns() + public function getActiveCampaigns(string $contentType = self::contentTypes['getActiveCampaigns'][0]) { - list($response) = $this->getActiveCampaignsWithHttpInfo(); + list($response) = $this->getActiveCampaignsWithHttpInfo($contentType); return $response; } @@ -137,14 +148,15 @@ public function getActiveCampaigns() * * Get active campaigns * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getActiveCampaigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucherCampaign[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function getActiveCampaignsWithHttpInfo() + public function getActiveCampaignsWithHttpInfo(string $contentType = self::contentTypes['getActiveCampaigns'][0]) { - $request = $this->getActiveCampaignsRequest(); + $request = $this->getActiveCampaignsRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -187,6 +199,21 @@ public function getActiveCampaignsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucherCampaign[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -199,6 +226,21 @@ public function getActiveCampaignsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -211,6 +253,21 @@ public function getActiveCampaignsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -223,6 +280,21 @@ public function getActiveCampaignsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -237,6 +309,21 @@ public function getActiveCampaignsWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -289,13 +376,14 @@ public function getActiveCampaignsWithHttpInfo() * * Get active campaigns * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getActiveCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getActiveCampaignsAsync() + public function getActiveCampaignsAsync(string $contentType = self::contentTypes['getActiveCampaigns'][0]) { - return $this->getActiveCampaignsAsyncWithHttpInfo() + return $this->getActiveCampaignsAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -308,14 +396,15 @@ function ($response) { * * Get active campaigns * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getActiveCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getActiveCampaignsAsyncWithHttpInfo() + public function getActiveCampaignsAsyncWithHttpInfo(string $contentType = self::contentTypes['getActiveCampaigns'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucherCampaign[]'; - $request = $this->getActiveCampaignsRequest(); + $request = $this->getActiveCampaignsRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -325,6 +414,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -353,13 +445,15 @@ function ($exception) { /** * Create request for operation 'getActiveCampaigns' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getActiveCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getActiveCampaignsRequest() + public function getActiveCampaignsRequest(string $contentType = self::contentTypes['getActiveCampaigns'][0]) { + $resourcePath = '/v2/settings/campaigns/active'; $formParams = []; $queryParams = []; @@ -371,16 +465,11 @@ public function getActiveCampaignsRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -398,12 +487,12 @@ public function getActiveCampaignsRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -419,10 +508,11 @@ public function getActiveCampaignsRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -433,14 +523,15 @@ public function getActiveCampaignsRequest() * * Get vouchers count * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVouchersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function getVouchersCount() + public function getVouchersCount(string $contentType = self::contentTypes['getVouchersCount'][0]) { - list($response) = $this->getVouchersCountWithHttpInfo(); + list($response) = $this->getVouchersCountWithHttpInfo($contentType); return $response; } @@ -449,14 +540,15 @@ public function getVouchersCount() * * Get vouchers count * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVouchersCount'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTCountResult|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function getVouchersCountWithHttpInfo() + public function getVouchersCountWithHttpInfo(string $contentType = self::contentTypes['getVouchersCount'][0]) { - $request = $this->getVouchersCountRequest(); + $request = $this->getVouchersCountRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -499,6 +591,21 @@ public function getVouchersCountWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTCountResult' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -511,6 +618,21 @@ public function getVouchersCountWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -523,6 +645,21 @@ public function getVouchersCountWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -535,6 +672,21 @@ public function getVouchersCountWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -549,6 +701,21 @@ public function getVouchersCountWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -601,13 +768,14 @@ public function getVouchersCountWithHttpInfo() * * Get vouchers count * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVouchersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getVouchersCountAsync() + public function getVouchersCountAsync(string $contentType = self::contentTypes['getVouchersCount'][0]) { - return $this->getVouchersCountAsyncWithHttpInfo() + return $this->getVouchersCountAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -620,14 +788,15 @@ function ($response) { * * Get vouchers count * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVouchersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getVouchersCountAsyncWithHttpInfo() + public function getVouchersCountAsyncWithHttpInfo(string $contentType = self::contentTypes['getVouchersCount'][0]) { $returnType = '\OpenAPI\Client\Model\WTCountResult'; - $request = $this->getVouchersCountRequest(); + $request = $this->getVouchersCountRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -637,6 +806,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -665,13 +837,15 @@ function ($exception) { /** * Create request for operation 'getVouchersCount' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVouchersCount'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getVouchersCountRequest() + public function getVouchersCountRequest(string $contentType = self::contentTypes['getVouchersCount'][0]) { + $resourcePath = '/v2/settings/vouchers/count'; $formParams = []; $queryParams = []; @@ -683,16 +857,11 @@ public function getVouchersCountRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -710,12 +879,12 @@ public function getVouchersCountRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -731,10 +900,11 @@ public function getVouchersCountRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/ShopifyTerminalApi.php b/lib/Api/ShopifyTerminalApi.php index 01e75e6..eaa8b6f 100644 --- a/lib/Api/ShopifyTerminalApi.php +++ b/lib/Api/ShopifyTerminalApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'redeemWalletItemFromShopifyTerminal' => [ + 'application/json', + ], + 'refundWalletItemFromShopifyTerminal' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +135,15 @@ public function getConfig() * Fetch item * * @param string $item_id item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromShopifyTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchWalletItemFromShopifyTerminal($item_id) + public function fetchWalletItemFromShopifyTerminal($item_id, string $contentType = self::contentTypes['fetchWalletItemFromShopifyTerminal'][0]) { - list($response) = $this->fetchWalletItemFromShopifyTerminalWithHttpInfo($item_id); + list($response) = $this->fetchWalletItemFromShopifyTerminalWithHttpInfo($item_id, $contentType); return $response; } @@ -139,14 +153,15 @@ public function fetchWalletItemFromShopifyTerminal($item_id) * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromShopifyTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchWalletItemFromShopifyTerminalWithHttpInfo($item_id) + public function fetchWalletItemFromShopifyTerminalWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchWalletItemFromShopifyTerminal'][0]) { - $request = $this->fetchWalletItemFromShopifyTerminalRequest($item_id); + $request = $this->fetchWalletItemFromShopifyTerminalRequest($item_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +204,21 @@ public function fetchWalletItemFromShopifyTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +231,21 @@ public function fetchWalletItemFromShopifyTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +258,21 @@ public function fetchWalletItemFromShopifyTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +285,21 @@ public function fetchWalletItemFromShopifyTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +314,21 @@ public function fetchWalletItemFromShopifyTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +382,14 @@ public function fetchWalletItemFromShopifyTerminalWithHttpInfo($item_id) * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromShopifyTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletItemFromShopifyTerminalAsync($item_id) + public function fetchWalletItemFromShopifyTerminalAsync($item_id, string $contentType = self::contentTypes['fetchWalletItemFromShopifyTerminal'][0]) { - return $this->fetchWalletItemFromShopifyTerminalAsyncWithHttpInfo($item_id) + return $this->fetchWalletItemFromShopifyTerminalAsyncWithHttpInfo($item_id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +403,15 @@ function ($response) { * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromShopifyTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletItemFromShopifyTerminalAsyncWithHttpInfo($item_id) + public function fetchWalletItemFromShopifyTerminalAsyncWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchWalletItemFromShopifyTerminal'][0]) { $returnType = 'mixed'; - $request = $this->fetchWalletItemFromShopifyTerminalRequest($item_id); + $request = $this->fetchWalletItemFromShopifyTerminalRequest($item_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +421,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +453,14 @@ function ($exception) { * Create request for operation 'fetchWalletItemFromShopifyTerminal' * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromShopifyTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchWalletItemFromShopifyTerminalRequest($item_id) + public function fetchWalletItemFromShopifyTerminalRequest($item_id, string $contentType = self::contentTypes['fetchWalletItemFromShopifyTerminal'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +468,7 @@ public function fetchWalletItemFromShopifyTerminalRequest($item_id) ); } + $resourcePath = '/v2/pos/shopify/item/{itemID}'; $formParams = []; $queryParams = []; @@ -390,16 +488,11 @@ public function fetchWalletItemFromShopifyTerminalRequest($item_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +510,12 @@ public function fetchWalletItemFromShopifyTerminalRequest($item_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +531,11 @@ public function fetchWalletItemFromShopifyTerminalRequest($item_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -454,14 +548,15 @@ public function fetchWalletItemFromShopifyTerminalRequest($item_id) * * @param string $item_id item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromShopifyTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function redeemWalletItemFromShopifyTerminal($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromShopifyTerminal($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromShopifyTerminal'][0]) { - list($response) = $this->redeemWalletItemFromShopifyTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption); + list($response) = $this->redeemWalletItemFromShopifyTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption, $contentType); return $response; } @@ -472,14 +567,15 @@ public function redeemWalletItemFromShopifyTerminal($item_id, $wt_wallet_item_re * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromShopifyTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function redeemWalletItemFromShopifyTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromShopifyTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromShopifyTerminal'][0]) { - $request = $this->redeemWalletItemFromShopifyTerminalRequest($item_id, $wt_wallet_item_redemption); + $request = $this->redeemWalletItemFromShopifyTerminalRequest($item_id, $wt_wallet_item_redemption, $contentType); try { $options = $this->createHttpClientOption(); @@ -522,6 +618,21 @@ public function redeemWalletItemFromShopifyTerminalWithHttpInfo($item_id, $wt_wa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -534,6 +645,21 @@ public function redeemWalletItemFromShopifyTerminalWithHttpInfo($item_id, $wt_wa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -546,6 +672,21 @@ public function redeemWalletItemFromShopifyTerminalWithHttpInfo($item_id, $wt_wa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -558,6 +699,21 @@ public function redeemWalletItemFromShopifyTerminalWithHttpInfo($item_id, $wt_wa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -572,6 +728,21 @@ public function redeemWalletItemFromShopifyTerminalWithHttpInfo($item_id, $wt_wa $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -626,13 +797,14 @@ public function redeemWalletItemFromShopifyTerminalWithHttpInfo($item_id, $wt_wa * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromShopifyTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function redeemWalletItemFromShopifyTerminalAsync($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromShopifyTerminalAsync($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromShopifyTerminal'][0]) { - return $this->redeemWalletItemFromShopifyTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption) + return $this->redeemWalletItemFromShopifyTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption, $contentType) ->then( function ($response) { return $response[0]; @@ -647,14 +819,15 @@ function ($response) { * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromShopifyTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function redeemWalletItemFromShopifyTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromShopifyTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromShopifyTerminal'][0]) { $returnType = 'mixed'; - $request = $this->redeemWalletItemFromShopifyTerminalRequest($item_id, $wt_wallet_item_redemption); + $request = $this->redeemWalletItemFromShopifyTerminalRequest($item_id, $wt_wallet_item_redemption, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -664,6 +837,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -694,18 +870,21 @@ function ($exception) { * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromShopifyTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function redeemWalletItemFromShopifyTerminalRequest($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromShopifyTerminalRequest($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromShopifyTerminal'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $item_id when calling redeemWalletItemFromShopifyTerminal' ); } + // verify the required parameter 'wt_wallet_item_redemption' is set if ($wt_wallet_item_redemption === null || (is_array($wt_wallet_item_redemption) && count($wt_wallet_item_redemption) === 0)) { throw new \InvalidArgumentException( @@ -713,6 +892,7 @@ public function redeemWalletItemFromShopifyTerminalRequest($item_id, $wt_wallet_ ); } + $resourcePath = '/v2/pos/shopify/item/redeem/{itemID}'; $formParams = []; $queryParams = []; @@ -732,21 +912,17 @@ public function redeemWalletItemFromShopifyTerminalRequest($item_id, $wt_wallet_ } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_wallet_item_redemption)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_wallet_item_redemption)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_wallet_item_redemption)); } else { $httpBody = $wt_wallet_item_redemption; } @@ -765,12 +941,12 @@ public function redeemWalletItemFromShopifyTerminalRequest($item_id, $wt_wallet_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -786,10 +962,11 @@ public function redeemWalletItemFromShopifyTerminalRequest($item_id, $wt_wallet_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -801,14 +978,15 @@ public function redeemWalletItemFromShopifyTerminalRequest($item_id, $wt_wallet_ * Refund transaction * * @param string $ledger_entry_id ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromShopifyTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function refundWalletItemFromShopifyTerminal($ledger_entry_id) + public function refundWalletItemFromShopifyTerminal($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromShopifyTerminal'][0]) { - list($response) = $this->refundWalletItemFromShopifyTerminalWithHttpInfo($ledger_entry_id); + list($response) = $this->refundWalletItemFromShopifyTerminalWithHttpInfo($ledger_entry_id, $contentType); return $response; } @@ -818,14 +996,15 @@ public function refundWalletItemFromShopifyTerminal($ledger_entry_id) * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromShopifyTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function refundWalletItemFromShopifyTerminalWithHttpInfo($ledger_entry_id) + public function refundWalletItemFromShopifyTerminalWithHttpInfo($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromShopifyTerminal'][0]) { - $request = $this->refundWalletItemFromShopifyTerminalRequest($ledger_entry_id); + $request = $this->refundWalletItemFromShopifyTerminalRequest($ledger_entry_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -868,6 +1047,21 @@ public function refundWalletItemFromShopifyTerminalWithHttpInfo($ledger_entry_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -880,6 +1074,21 @@ public function refundWalletItemFromShopifyTerminalWithHttpInfo($ledger_entry_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -892,6 +1101,21 @@ public function refundWalletItemFromShopifyTerminalWithHttpInfo($ledger_entry_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -904,6 +1128,21 @@ public function refundWalletItemFromShopifyTerminalWithHttpInfo($ledger_entry_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -918,6 +1157,21 @@ public function refundWalletItemFromShopifyTerminalWithHttpInfo($ledger_entry_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -971,13 +1225,14 @@ public function refundWalletItemFromShopifyTerminalWithHttpInfo($ledger_entry_id * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromShopifyTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function refundWalletItemFromShopifyTerminalAsync($ledger_entry_id) + public function refundWalletItemFromShopifyTerminalAsync($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromShopifyTerminal'][0]) { - return $this->refundWalletItemFromShopifyTerminalAsyncWithHttpInfo($ledger_entry_id) + return $this->refundWalletItemFromShopifyTerminalAsyncWithHttpInfo($ledger_entry_id, $contentType) ->then( function ($response) { return $response[0]; @@ -991,14 +1246,15 @@ function ($response) { * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromShopifyTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function refundWalletItemFromShopifyTerminalAsyncWithHttpInfo($ledger_entry_id) + public function refundWalletItemFromShopifyTerminalAsyncWithHttpInfo($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromShopifyTerminal'][0]) { $returnType = 'mixed'; - $request = $this->refundWalletItemFromShopifyTerminalRequest($ledger_entry_id); + $request = $this->refundWalletItemFromShopifyTerminalRequest($ledger_entry_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1008,6 +1264,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1037,12 +1296,14 @@ function ($exception) { * Create request for operation 'refundWalletItemFromShopifyTerminal' * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromShopifyTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function refundWalletItemFromShopifyTerminalRequest($ledger_entry_id) + public function refundWalletItemFromShopifyTerminalRequest($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromShopifyTerminal'][0]) { + // verify the required parameter 'ledger_entry_id' is set if ($ledger_entry_id === null || (is_array($ledger_entry_id) && count($ledger_entry_id) === 0)) { throw new \InvalidArgumentException( @@ -1058,7 +1319,7 @@ public function refundWalletItemFromShopifyTerminalRequest($ledger_entry_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $ledger_entry_id)) { throw new \InvalidArgumentException("invalid value for \"ledger_entry_id\" when calling ShopifyTerminalApi.refundWalletItemFromShopifyTerminal, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/pos/shopify/item/refund/{ledgerEntryID}'; $formParams = []; @@ -1079,16 +1340,11 @@ public function refundWalletItemFromShopifyTerminalRequest($ledger_entry_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1106,12 +1362,12 @@ public function refundWalletItemFromShopifyTerminalRequest($ledger_entry_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1127,10 +1383,11 @@ public function refundWalletItemFromShopifyTerminalRequest($ledger_entry_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/SmsSubscriberApi.php b/lib/Api/SmsSubscriberApi.php new file mode 100644 index 0000000..f593b63 --- /dev/null +++ b/lib/Api/SmsSubscriberApi.php @@ -0,0 +1,2259 @@ + [ + 'application/json', + ], + 'createSmsSubscriber' => [ + 'application/json', + ], + 'fetchAllSmsSubscribers' => [ + 'application/json', + ], + 'restoreSmsSubscriber' => [ + 'application/json', + ], + 'updateSmsSubscriber' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation archiveSmsSubscriber + * + * Archive email subscriber + * + * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveSmsSubscriber'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\SmsSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + */ + public function archiveSmsSubscriber($id, string $contentType = self::contentTypes['archiveSmsSubscriber'][0]) + { + list($response) = $this->archiveSmsSubscriberWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation archiveSmsSubscriberWithHttpInfo + * + * Archive email subscriber + * + * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveSmsSubscriber'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\SmsSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + */ + public function archiveSmsSubscriberWithHttpInfo($id, string $contentType = self::contentTypes['archiveSmsSubscriber'][0]) + { + $request = $this->archiveSmsSubscriberRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\SmsSubscriber' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\SmsSubscriber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SmsSubscriber', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\OpenAPI\Client\Model\AuthError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\AuthError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\OpenAPI\Client\Model\FalsumError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FalsumError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\OpenAPI\Client\Model\InternalServerError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InternalServerError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\SmsSubscriber'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\SmsSubscriber', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\AuthError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\FalsumError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\InternalServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation archiveSmsSubscriberAsync + * + * Archive email subscriber + * + * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function archiveSmsSubscriberAsync($id, string $contentType = self::contentTypes['archiveSmsSubscriber'][0]) + { + return $this->archiveSmsSubscriberAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation archiveSmsSubscriberAsyncWithHttpInfo + * + * Archive email subscriber + * + * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function archiveSmsSubscriberAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveSmsSubscriber'][0]) + { + $returnType = '\OpenAPI\Client\Model\SmsSubscriber'; + $request = $this->archiveSmsSubscriberRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'archiveSmsSubscriber' + * + * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function archiveSmsSubscriberRequest($id, string $contentType = self::contentTypes['archiveSmsSubscriber'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling archiveSmsSubscriber' + ); + } + + + $resourcePath = '/v2/SmsSubscriber/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation createSmsSubscriber + * + * Create email subscriber + * + * @param \OpenAPI\Client\Model\WTSmsSubscriberCreateParams $wt_sms_subscriber_create_params wt_sms_subscriber_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmsSubscriber'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\SmsSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + */ + public function createSmsSubscriber($wt_sms_subscriber_create_params, string $contentType = self::contentTypes['createSmsSubscriber'][0]) + { + list($response) = $this->createSmsSubscriberWithHttpInfo($wt_sms_subscriber_create_params, $contentType); + return $response; + } + + /** + * Operation createSmsSubscriberWithHttpInfo + * + * Create email subscriber + * + * @param \OpenAPI\Client\Model\WTSmsSubscriberCreateParams $wt_sms_subscriber_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmsSubscriber'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\SmsSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + */ + public function createSmsSubscriberWithHttpInfo($wt_sms_subscriber_create_params, string $contentType = self::contentTypes['createSmsSubscriber'][0]) + { + $request = $this->createSmsSubscriberRequest($wt_sms_subscriber_create_params, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\SmsSubscriber' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\SmsSubscriber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SmsSubscriber', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\OpenAPI\Client\Model\AuthError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\AuthError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\OpenAPI\Client\Model\FalsumError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FalsumError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\OpenAPI\Client\Model\InternalServerError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InternalServerError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\SmsSubscriber'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\SmsSubscriber', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\AuthError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\FalsumError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\InternalServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createSmsSubscriberAsync + * + * Create email subscriber + * + * @param \OpenAPI\Client\Model\WTSmsSubscriberCreateParams $wt_sms_subscriber_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSmsSubscriberAsync($wt_sms_subscriber_create_params, string $contentType = self::contentTypes['createSmsSubscriber'][0]) + { + return $this->createSmsSubscriberAsyncWithHttpInfo($wt_sms_subscriber_create_params, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createSmsSubscriberAsyncWithHttpInfo + * + * Create email subscriber + * + * @param \OpenAPI\Client\Model\WTSmsSubscriberCreateParams $wt_sms_subscriber_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createSmsSubscriberAsyncWithHttpInfo($wt_sms_subscriber_create_params, string $contentType = self::contentTypes['createSmsSubscriber'][0]) + { + $returnType = '\OpenAPI\Client\Model\SmsSubscriber'; + $request = $this->createSmsSubscriberRequest($wt_sms_subscriber_create_params, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createSmsSubscriber' + * + * @param \OpenAPI\Client\Model\WTSmsSubscriberCreateParams $wt_sms_subscriber_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function createSmsSubscriberRequest($wt_sms_subscriber_create_params, string $contentType = self::contentTypes['createSmsSubscriber'][0]) + { + + // verify the required parameter 'wt_sms_subscriber_create_params' is set + if ($wt_sms_subscriber_create_params === null || (is_array($wt_sms_subscriber_create_params) && count($wt_sms_subscriber_create_params) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $wt_sms_subscriber_create_params when calling createSmsSubscriber' + ); + } + + + $resourcePath = '/v2/SmsSubscriber'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($wt_sms_subscriber_create_params)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_sms_subscriber_create_params)); + } else { + $httpBody = $wt_sms_subscriber_create_params; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation fetchAllSmsSubscribers + * + * Fetch all email subscribers + * + * @param \DateTime $start_date_time start_date_time (optional) + * @param \DateTime $end_date_time end_date_time (optional) + * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllSmsSubscribers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + */ + public function fetchAllSmsSubscribers($start_date_time = null, $end_date_time = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllSmsSubscribers'][0]) + { + list($response) = $this->fetchAllSmsSubscribersWithHttpInfo($start_date_time, $end_date_time, $is_archive_included, $contentType); + return $response; + } + + /** + * Operation fetchAllSmsSubscribersWithHttpInfo + * + * Fetch all email subscribers + * + * @param \DateTime $start_date_time (optional) + * @param \DateTime $end_date_time (optional) + * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllSmsSubscribers'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + */ + public function fetchAllSmsSubscribersWithHttpInfo($start_date_time = null, $end_date_time = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllSmsSubscribers'][0]) + { + $request = $this->fetchAllSmsSubscribersRequest($start_date_time, $end_date_time, $is_archive_included, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('mixed' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'mixed', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\OpenAPI\Client\Model\AuthError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\AuthError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\OpenAPI\Client\Model\FalsumError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FalsumError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\OpenAPI\Client\Model\InternalServerError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InternalServerError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = 'mixed'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'mixed', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\AuthError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\FalsumError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\InternalServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation fetchAllSmsSubscribersAsync + * + * Fetch all email subscribers + * + * @param \DateTime $start_date_time (optional) + * @param \DateTime $end_date_time (optional) + * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllSmsSubscribers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fetchAllSmsSubscribersAsync($start_date_time = null, $end_date_time = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllSmsSubscribers'][0]) + { + return $this->fetchAllSmsSubscribersAsyncWithHttpInfo($start_date_time, $end_date_time, $is_archive_included, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation fetchAllSmsSubscribersAsyncWithHttpInfo + * + * Fetch all email subscribers + * + * @param \DateTime $start_date_time (optional) + * @param \DateTime $end_date_time (optional) + * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllSmsSubscribers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fetchAllSmsSubscribersAsyncWithHttpInfo($start_date_time = null, $end_date_time = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllSmsSubscribers'][0]) + { + $returnType = 'mixed'; + $request = $this->fetchAllSmsSubscribersRequest($start_date_time, $end_date_time, $is_archive_included, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'fetchAllSmsSubscribers' + * + * @param \DateTime $start_date_time (optional) + * @param \DateTime $end_date_time (optional) + * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllSmsSubscribers'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function fetchAllSmsSubscribersRequest($start_date_time = null, $end_date_time = null, $is_archive_included = null, string $contentType = self::contentTypes['fetchAllSmsSubscribers'][0]) + { + + + + + + $resourcePath = '/v2/SmsSubscriber/all'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation restoreSmsSubscriber + * + * Restore email subscriber + * + * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreSmsSubscriber'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\SmsSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + */ + public function restoreSmsSubscriber($id, string $contentType = self::contentTypes['restoreSmsSubscriber'][0]) + { + list($response) = $this->restoreSmsSubscriberWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation restoreSmsSubscriberWithHttpInfo + * + * Restore email subscriber + * + * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreSmsSubscriber'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\SmsSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + */ + public function restoreSmsSubscriberWithHttpInfo($id, string $contentType = self::contentTypes['restoreSmsSubscriber'][0]) + { + $request = $this->restoreSmsSubscriberRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\SmsSubscriber' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\SmsSubscriber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SmsSubscriber', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\OpenAPI\Client\Model\AuthError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\AuthError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\OpenAPI\Client\Model\FalsumError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FalsumError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\OpenAPI\Client\Model\InternalServerError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InternalServerError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\SmsSubscriber'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\SmsSubscriber', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\AuthError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\FalsumError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\InternalServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation restoreSmsSubscriberAsync + * + * Restore email subscriber + * + * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function restoreSmsSubscriberAsync($id, string $contentType = self::contentTypes['restoreSmsSubscriber'][0]) + { + return $this->restoreSmsSubscriberAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation restoreSmsSubscriberAsyncWithHttpInfo + * + * Restore email subscriber + * + * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function restoreSmsSubscriberAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreSmsSubscriber'][0]) + { + $returnType = '\OpenAPI\Client\Model\SmsSubscriber'; + $request = $this->restoreSmsSubscriberRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'restoreSmsSubscriber' + * + * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function restoreSmsSubscriberRequest($id, string $contentType = self::contentTypes['restoreSmsSubscriber'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling restoreSmsSubscriber' + ); + } + + + $resourcePath = '/v2/SmsSubscriber/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PATCH', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation updateSmsSubscriber + * + * Update email subscriber + * + * @param mixed $id id (required) + * @param \OpenAPI\Client\Model\WTSmsSubscriberUpdateParams $wt_sms_subscriber_update_params wt_sms_subscriber_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsSubscriber'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OpenAPI\Client\Model\SmsSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + */ + public function updateSmsSubscriber($id, $wt_sms_subscriber_update_params, string $contentType = self::contentTypes['updateSmsSubscriber'][0]) + { + list($response) = $this->updateSmsSubscriberWithHttpInfo($id, $wt_sms_subscriber_update_params, $contentType); + return $response; + } + + /** + * Operation updateSmsSubscriberWithHttpInfo + * + * Update email subscriber + * + * @param mixed $id (required) + * @param \OpenAPI\Client\Model\WTSmsSubscriberUpdateParams $wt_sms_subscriber_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsSubscriber'] to see the possible values for this operation + * + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OpenAPI\Client\Model\SmsSubscriber|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + */ + public function updateSmsSubscriberWithHttpInfo($id, $wt_sms_subscriber_update_params, string $contentType = self::contentTypes['updateSmsSubscriber'][0]) + { + $request = $this->updateSmsSubscriberRequest($id, $wt_sms_subscriber_update_params, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\OpenAPI\Client\Model\SmsSubscriber' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\SmsSubscriber' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\SmsSubscriber', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\OpenAPI\Client\Model\AuthError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\AuthError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 422: + if ('\OpenAPI\Client\Model\FalsumError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FalsumError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\OpenAPI\Client\Model\InternalServerError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InternalServerError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\OpenAPI\Client\Model\SmsSubscriber'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\SmsSubscriber', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\AuthError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\FalsumError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OpenAPI\Client\Model\InternalServerError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation updateSmsSubscriberAsync + * + * Update email subscriber + * + * @param mixed $id (required) + * @param \OpenAPI\Client\Model\WTSmsSubscriberUpdateParams $wt_sms_subscriber_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSmsSubscriberAsync($id, $wt_sms_subscriber_update_params, string $contentType = self::contentTypes['updateSmsSubscriber'][0]) + { + return $this->updateSmsSubscriberAsyncWithHttpInfo($id, $wt_sms_subscriber_update_params, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation updateSmsSubscriberAsyncWithHttpInfo + * + * Update email subscriber + * + * @param mixed $id (required) + * @param \OpenAPI\Client\Model\WTSmsSubscriberUpdateParams $wt_sms_subscriber_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function updateSmsSubscriberAsyncWithHttpInfo($id, $wt_sms_subscriber_update_params, string $contentType = self::contentTypes['updateSmsSubscriber'][0]) + { + $returnType = '\OpenAPI\Client\Model\SmsSubscriber'; + $request = $this->updateSmsSubscriberRequest($id, $wt_sms_subscriber_update_params, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'updateSmsSubscriber' + * + * @param mixed $id (required) + * @param \OpenAPI\Client\Model\WTSmsSubscriberUpdateParams $wt_sms_subscriber_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateSmsSubscriber'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function updateSmsSubscriberRequest($id, $wt_sms_subscriber_update_params, string $contentType = self::contentTypes['updateSmsSubscriber'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling updateSmsSubscriber' + ); + } + + // verify the required parameter 'wt_sms_subscriber_update_params' is set + if ($wt_sms_subscriber_update_params === null || (is_array($wt_sms_subscriber_update_params) && count($wt_sms_subscriber_update_params) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $wt_sms_subscriber_update_params when calling updateSmsSubscriber' + ); + } + + + $resourcePath = '/v2/SmsSubscriber/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($wt_sms_subscriber_update_params)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_sms_subscriber_update_params)); + } else { + $httpBody = $wt_sms_subscriber_update_params; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/StaticVoucherCampaignGroupsApi.php b/lib/Api/StaticVoucherCampaignGroupsApi.php index 5757296..d2468be 100644 --- a/lib/Api/StaticVoucherCampaignGroupsApi.php +++ b/lib/Api/StaticVoucherCampaignGroupsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +129,15 @@ public function getConfig() * Fetch all campaigns * * @param mixed $campaigns_group_id campaigns_group_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignGroups'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return object|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function fetchStaticVoucherCampaignGroups($campaigns_group_id) + public function fetchStaticVoucherCampaignGroups($campaigns_group_id, string $contentType = self::contentTypes['fetchStaticVoucherCampaignGroups'][0]) { - list($response) = $this->fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id); + list($response) = $this->fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id, $contentType); return $response; } @@ -139,14 +147,15 @@ public function fetchStaticVoucherCampaignGroups($campaigns_group_id) * Fetch all campaigns * * @param mixed $campaigns_group_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignGroups'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of object|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id) + public function fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id, string $contentType = self::contentTypes['fetchStaticVoucherCampaignGroups'][0]) { - $request = $this->fetchStaticVoucherCampaignGroupsRequest($campaigns_group_id); + $request = $this->fetchStaticVoucherCampaignGroupsRequest($campaigns_group_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +198,21 @@ public function fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('object' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +225,21 @@ public function fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +252,21 @@ public function fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +279,21 @@ public function fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -237,6 +306,21 @@ public function fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -249,6 +333,21 @@ public function fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -263,6 +362,21 @@ public function fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -332,13 +446,14 @@ public function fetchStaticVoucherCampaignGroupsWithHttpInfo($campaigns_group_id * Fetch all campaigns * * @param mixed $campaigns_group_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignGroups'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherCampaignGroupsAsync($campaigns_group_id) + public function fetchStaticVoucherCampaignGroupsAsync($campaigns_group_id, string $contentType = self::contentTypes['fetchStaticVoucherCampaignGroups'][0]) { - return $this->fetchStaticVoucherCampaignGroupsAsyncWithHttpInfo($campaigns_group_id) + return $this->fetchStaticVoucherCampaignGroupsAsyncWithHttpInfo($campaigns_group_id, $contentType) ->then( function ($response) { return $response[0]; @@ -352,14 +467,15 @@ function ($response) { * Fetch all campaigns * * @param mixed $campaigns_group_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignGroups'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherCampaignGroupsAsyncWithHttpInfo($campaigns_group_id) + public function fetchStaticVoucherCampaignGroupsAsyncWithHttpInfo($campaigns_group_id, string $contentType = self::contentTypes['fetchStaticVoucherCampaignGroups'][0]) { $returnType = 'object'; - $request = $this->fetchStaticVoucherCampaignGroupsRequest($campaigns_group_id); + $request = $this->fetchStaticVoucherCampaignGroupsRequest($campaigns_group_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -369,6 +485,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -398,12 +517,14 @@ function ($exception) { * Create request for operation 'fetchStaticVoucherCampaignGroups' * * @param mixed $campaigns_group_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignGroups'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchStaticVoucherCampaignGroupsRequest($campaigns_group_id) + public function fetchStaticVoucherCampaignGroupsRequest($campaigns_group_id, string $contentType = self::contentTypes['fetchStaticVoucherCampaignGroups'][0]) { + // verify the required parameter 'campaigns_group_id' is set if ($campaigns_group_id === null || (is_array($campaigns_group_id) && count($campaigns_group_id) === 0)) { throw new \InvalidArgumentException( @@ -411,6 +532,7 @@ public function fetchStaticVoucherCampaignGroupsRequest($campaigns_group_id) ); } + $resourcePath = '/v2/payment/staticVoucherCampaignGroups/campaigns/{campaignsGroupID}'; $formParams = []; $queryParams = []; @@ -430,16 +552,11 @@ public function fetchStaticVoucherCampaignGroupsRequest($campaigns_group_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -457,12 +574,12 @@ public function fetchStaticVoucherCampaignGroupsRequest($campaigns_group_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -478,10 +595,11 @@ public function fetchStaticVoucherCampaignGroupsRequest($campaigns_group_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/StaticVoucherCampaignsApi.php b/lib/Api/StaticVoucherCampaignsApi.php index 11645e6..8352f54 100644 --- a/lib/Api/StaticVoucherCampaignsApi.php +++ b/lib/Api/StaticVoucherCampaignsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'countVouchersLoaded' => [ + 'application/json', + ], + 'countVouchersRedeemed' => [ + 'application/json', + ], + 'createStaticVoucherCampaign' => [ + 'application/json', + ], + 'createStaticVoucherCampaignFromCSV' => [ + 'application/json', + ], + 'createStaticVoucherCampaignWithVoucher' => [ + 'application/json', + ], + 'duplicateStaticVoucherCampaignById' => [ + 'application/json', + ], + 'fetchPerformanceOverview' => [ + 'application/json', + ], + 'fetchReachStatsOfAllStaticVoucherCampaigns' => [ + 'application/json', + ], + 'fetchReachStatsOfIndividualStaticVoucherCampaign' => [ + 'application/json', + ], + 'fetchStaticVoucherCampaignById' => [ + 'application/json', + ], + 'fetchStaticVoucherCampaigns' => [ + 'application/json', + ], + 'fetchStaticVouchers' => [ + 'application/json', + ], + 'fetchStaticVouchersPage' => [ + 'application/json', + ], + 'fetchViews' => [ + 'application/json', + ], + 'fetchVouchersRedeemed' => [ + 'application/json', + ], + 'previewMessages' => [ + 'application/json', + ], + 'previewMessagesByPage' => [ + 'application/json', + ], + 'restoreStaticVoucherCampaign' => [ + 'application/json', + ], + 'updateStaticVoucherCampaign' => [ + 'application/json', + ], + 'updateStaticVoucherCampaignWithVoucher' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +189,15 @@ public function getConfig() * Archive static voucher campaign * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveStaticVoucherCampaign($campaign_id) + public function archiveStaticVoucherCampaign($campaign_id, string $contentType = self::contentTypes['archiveStaticVoucherCampaign'][0]) { - list($response) = $this->archiveStaticVoucherCampaignWithHttpInfo($campaign_id); + list($response) = $this->archiveStaticVoucherCampaignWithHttpInfo($campaign_id, $contentType); return $response; } @@ -139,14 +207,15 @@ public function archiveStaticVoucherCampaign($campaign_id) * Archive static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveStaticVoucherCampaignWithHttpInfo($campaign_id) + public function archiveStaticVoucherCampaignWithHttpInfo($campaign_id, string $contentType = self::contentTypes['archiveStaticVoucherCampaign'][0]) { - $request = $this->archiveStaticVoucherCampaignRequest($campaign_id); + $request = $this->archiveStaticVoucherCampaignRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +258,21 @@ public function archiveStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucherCampaign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +285,21 @@ public function archiveStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +312,21 @@ public function archiveStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +339,21 @@ public function archiveStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +368,21 @@ public function archiveStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +436,14 @@ public function archiveStaticVoucherCampaignWithHttpInfo($campaign_id) * Archive static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveStaticVoucherCampaignAsync($campaign_id) + public function archiveStaticVoucherCampaignAsync($campaign_id, string $contentType = self::contentTypes['archiveStaticVoucherCampaign'][0]) { - return $this->archiveStaticVoucherCampaignAsyncWithHttpInfo($campaign_id) + return $this->archiveStaticVoucherCampaignAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +457,15 @@ function ($response) { * Archive static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveStaticVoucherCampaignAsyncWithHttpInfo($campaign_id) + public function archiveStaticVoucherCampaignAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['archiveStaticVoucherCampaign'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucherCampaign'; - $request = $this->archiveStaticVoucherCampaignRequest($campaign_id); + $request = $this->archiveStaticVoucherCampaignRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +475,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +507,14 @@ function ($exception) { * Create request for operation 'archiveStaticVoucherCampaign' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveStaticVoucherCampaignRequest($campaign_id) + public function archiveStaticVoucherCampaignRequest($campaign_id, string $contentType = self::contentTypes['archiveStaticVoucherCampaign'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +522,7 @@ public function archiveStaticVoucherCampaignRequest($campaign_id) ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/{campaignID}'; $formParams = []; $queryParams = []; @@ -390,16 +542,11 @@ public function archiveStaticVoucherCampaignRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +564,12 @@ public function archiveStaticVoucherCampaignRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +585,11 @@ public function archiveStaticVoucherCampaignRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +601,15 @@ public function archiveStaticVoucherCampaignRequest($campaign_id) * Count loaded vouchers * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVouchersLoaded'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchMembersCount200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countVouchersLoaded($campaign_id) + public function countVouchersLoaded($campaign_id, string $contentType = self::contentTypes['countVouchersLoaded'][0]) { - list($response) = $this->countVouchersLoadedWithHttpInfo($campaign_id); + list($response) = $this->countVouchersLoadedWithHttpInfo($campaign_id, $contentType); return $response; } @@ -470,14 +619,15 @@ public function countVouchersLoaded($campaign_id) * Count loaded vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVouchersLoaded'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchMembersCount200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countVouchersLoadedWithHttpInfo($campaign_id) + public function countVouchersLoadedWithHttpInfo($campaign_id, string $contentType = self::contentTypes['countVouchersLoaded'][0]) { - $request = $this->countVouchersLoadedRequest($campaign_id); + $request = $this->countVouchersLoadedRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -516,14 +666,29 @@ public function countVouchersLoadedWithHttpInfo($campaign_id) switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2003' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchMembersCount200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchMembersCount200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2003', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchMembersCount200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -532,6 +697,21 @@ public function countVouchersLoadedWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +724,21 @@ public function countVouchersLoadedWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +751,21 @@ public function countVouchersLoadedWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -565,11 +775,26 @@ public function countVouchersLoadedWithHttpInfo($campaign_id) ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; + $returnType = '\OpenAPI\Client\Model\FetchMembersCount200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -583,7 +808,7 @@ public function countVouchersLoadedWithHttpInfo($campaign_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2003', + '\OpenAPI\Client\Model\FetchMembersCount200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -623,13 +848,14 @@ public function countVouchersLoadedWithHttpInfo($campaign_id) * Count loaded vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVouchersLoaded'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countVouchersLoadedAsync($campaign_id) + public function countVouchersLoadedAsync($campaign_id, string $contentType = self::contentTypes['countVouchersLoaded'][0]) { - return $this->countVouchersLoadedAsyncWithHttpInfo($campaign_id) + return $this->countVouchersLoadedAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +869,15 @@ function ($response) { * Count loaded vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVouchersLoaded'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countVouchersLoadedAsyncWithHttpInfo($campaign_id) + public function countVouchersLoadedAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['countVouchersLoaded'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; - $request = $this->countVouchersLoadedRequest($campaign_id); + $returnType = '\OpenAPI\Client\Model\FetchMembersCount200Response'; + $request = $this->countVouchersLoadedRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +887,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +919,14 @@ function ($exception) { * Create request for operation 'countVouchersLoaded' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVouchersLoaded'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countVouchersLoadedRequest($campaign_id) + public function countVouchersLoadedRequest($campaign_id, string $contentType = self::contentTypes['countVouchersLoaded'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +934,7 @@ public function countVouchersLoadedRequest($campaign_id) ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/count/vouchers/loaded/{campaignID}'; $formParams = []; $queryParams = []; @@ -721,16 +954,11 @@ public function countVouchersLoadedRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -748,12 +976,12 @@ public function countVouchersLoadedRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -769,10 +997,11 @@ public function countVouchersLoadedRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -784,14 +1013,15 @@ public function countVouchersLoadedRequest($campaign_id) * Count redeemed vouchers * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVouchersRedeemed'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchMembersCount200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function countVouchersRedeemed($campaign_id) + public function countVouchersRedeemed($campaign_id, string $contentType = self::contentTypes['countVouchersRedeemed'][0]) { - list($response) = $this->countVouchersRedeemedWithHttpInfo($campaign_id); + list($response) = $this->countVouchersRedeemedWithHttpInfo($campaign_id, $contentType); return $response; } @@ -801,14 +1031,15 @@ public function countVouchersRedeemed($campaign_id) * Count redeemed vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVouchersRedeemed'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2003|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchMembersCount200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function countVouchersRedeemedWithHttpInfo($campaign_id) + public function countVouchersRedeemedWithHttpInfo($campaign_id, string $contentType = self::contentTypes['countVouchersRedeemed'][0]) { - $request = $this->countVouchersRedeemedRequest($campaign_id); + $request = $this->countVouchersRedeemedRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -847,14 +1078,29 @@ public function countVouchersRedeemedWithHttpInfo($campaign_id) switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2003' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchMembersCount200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchMembersCount200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2003', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchMembersCount200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -863,6 +1109,21 @@ public function countVouchersRedeemedWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -875,6 +1136,21 @@ public function countVouchersRedeemedWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -887,6 +1163,21 @@ public function countVouchersRedeemedWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -896,11 +1187,26 @@ public function countVouchersRedeemedWithHttpInfo($campaign_id) ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; + $returnType = '\OpenAPI\Client\Model\FetchMembersCount200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -914,7 +1220,7 @@ public function countVouchersRedeemedWithHttpInfo($campaign_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2003', + '\OpenAPI\Client\Model\FetchMembersCount200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -954,13 +1260,14 @@ public function countVouchersRedeemedWithHttpInfo($campaign_id) * Count redeemed vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVouchersRedeemed'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countVouchersRedeemedAsync($campaign_id) + public function countVouchersRedeemedAsync($campaign_id, string $contentType = self::contentTypes['countVouchersRedeemed'][0]) { - return $this->countVouchersRedeemedAsyncWithHttpInfo($campaign_id) + return $this->countVouchersRedeemedAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -974,14 +1281,15 @@ function ($response) { * Count redeemed vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVouchersRedeemed'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function countVouchersRedeemedAsyncWithHttpInfo($campaign_id) + public function countVouchersRedeemedAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['countVouchersRedeemed'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2003'; - $request = $this->countVouchersRedeemedRequest($campaign_id); + $returnType = '\OpenAPI\Client\Model\FetchMembersCount200Response'; + $request = $this->countVouchersRedeemedRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -991,6 +1299,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1020,12 +1331,14 @@ function ($exception) { * Create request for operation 'countVouchersRedeemed' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['countVouchersRedeemed'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function countVouchersRedeemedRequest($campaign_id) + public function countVouchersRedeemedRequest($campaign_id, string $contentType = self::contentTypes['countVouchersRedeemed'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -1033,6 +1346,7 @@ public function countVouchersRedeemedRequest($campaign_id) ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/count/vouchers/redeemed/{campaignID}'; $formParams = []; $queryParams = []; @@ -1052,16 +1366,11 @@ public function countVouchersRedeemedRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1079,12 +1388,12 @@ public function countVouchersRedeemedRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1100,10 +1409,11 @@ public function countVouchersRedeemedRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1115,14 +1425,15 @@ public function countVouchersRedeemedRequest($campaign_id) * Create static voucher campaign * * @param \OpenAPI\Client\Model\CreateStaticVoucherCampaign $create_static_voucher_campaign create_static_voucher_campaign (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createStaticVoucherCampaign($create_static_voucher_campaign) + public function createStaticVoucherCampaign($create_static_voucher_campaign, string $contentType = self::contentTypes['createStaticVoucherCampaign'][0]) { - list($response) = $this->createStaticVoucherCampaignWithHttpInfo($create_static_voucher_campaign); + list($response) = $this->createStaticVoucherCampaignWithHttpInfo($create_static_voucher_campaign, $contentType); return $response; } @@ -1132,14 +1443,15 @@ public function createStaticVoucherCampaign($create_static_voucher_campaign) * Create static voucher campaign * * @param \OpenAPI\Client\Model\CreateStaticVoucherCampaign $create_static_voucher_campaign (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createStaticVoucherCampaignWithHttpInfo($create_static_voucher_campaign) + public function createStaticVoucherCampaignWithHttpInfo($create_static_voucher_campaign, string $contentType = self::contentTypes['createStaticVoucherCampaign'][0]) { - $request = $this->createStaticVoucherCampaignRequest($create_static_voucher_campaign); + $request = $this->createStaticVoucherCampaignRequest($create_static_voucher_campaign, $contentType); try { $options = $this->createHttpClientOption(); @@ -1182,6 +1494,21 @@ public function createStaticVoucherCampaignWithHttpInfo($create_static_voucher_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucherCampaign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1194,6 +1521,21 @@ public function createStaticVoucherCampaignWithHttpInfo($create_static_voucher_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1206,6 +1548,21 @@ public function createStaticVoucherCampaignWithHttpInfo($create_static_voucher_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1218,6 +1575,21 @@ public function createStaticVoucherCampaignWithHttpInfo($create_static_voucher_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1232,6 +1604,21 @@ public function createStaticVoucherCampaignWithHttpInfo($create_static_voucher_c $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1285,13 +1672,14 @@ public function createStaticVoucherCampaignWithHttpInfo($create_static_voucher_c * Create static voucher campaign * * @param \OpenAPI\Client\Model\CreateStaticVoucherCampaign $create_static_voucher_campaign (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStaticVoucherCampaignAsync($create_static_voucher_campaign) + public function createStaticVoucherCampaignAsync($create_static_voucher_campaign, string $contentType = self::contentTypes['createStaticVoucherCampaign'][0]) { - return $this->createStaticVoucherCampaignAsyncWithHttpInfo($create_static_voucher_campaign) + return $this->createStaticVoucherCampaignAsyncWithHttpInfo($create_static_voucher_campaign, $contentType) ->then( function ($response) { return $response[0]; @@ -1305,14 +1693,15 @@ function ($response) { * Create static voucher campaign * * @param \OpenAPI\Client\Model\CreateStaticVoucherCampaign $create_static_voucher_campaign (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStaticVoucherCampaignAsyncWithHttpInfo($create_static_voucher_campaign) + public function createStaticVoucherCampaignAsyncWithHttpInfo($create_static_voucher_campaign, string $contentType = self::contentTypes['createStaticVoucherCampaign'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucherCampaign'; - $request = $this->createStaticVoucherCampaignRequest($create_static_voucher_campaign); + $request = $this->createStaticVoucherCampaignRequest($create_static_voucher_campaign, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1322,6 +1711,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1351,12 +1743,14 @@ function ($exception) { * Create request for operation 'createStaticVoucherCampaign' * * @param \OpenAPI\Client\Model\CreateStaticVoucherCampaign $create_static_voucher_campaign (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createStaticVoucherCampaignRequest($create_static_voucher_campaign) + public function createStaticVoucherCampaignRequest($create_static_voucher_campaign, string $contentType = self::contentTypes['createStaticVoucherCampaign'][0]) { + // verify the required parameter 'create_static_voucher_campaign' is set if ($create_static_voucher_campaign === null || (is_array($create_static_voucher_campaign) && count($create_static_voucher_campaign) === 0)) { throw new \InvalidArgumentException( @@ -1364,6 +1758,7 @@ public function createStaticVoucherCampaignRequest($create_static_voucher_campai ); } + $resourcePath = '/v2/payment/staticVoucherCampaign'; $formParams = []; $queryParams = []; @@ -1375,21 +1770,17 @@ public function createStaticVoucherCampaignRequest($create_static_voucher_campai - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($create_static_voucher_campaign)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_static_voucher_campaign)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_static_voucher_campaign)); } else { $httpBody = $create_static_voucher_campaign; } @@ -1408,12 +1799,12 @@ public function createStaticVoucherCampaignRequest($create_static_voucher_campai // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1429,10 +1820,11 @@ public function createStaticVoucherCampaignRequest($create_static_voucher_campai $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1444,14 +1836,15 @@ public function createStaticVoucherCampaignRequest($create_static_voucher_campai * Import static voucher campaign * * @param \OpenAPI\Client\Model\CreateStaticVoucherCampaignWithVoucherWithCSV $create_static_voucher_campaign_with_voucher_with_csv create_static_voucher_campaign_with_voucher_with_csv (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignFromCSV'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createStaticVoucherCampaignFromCSV($create_static_voucher_campaign_with_voucher_with_csv) + public function createStaticVoucherCampaignFromCSV($create_static_voucher_campaign_with_voucher_with_csv, string $contentType = self::contentTypes['createStaticVoucherCampaignFromCSV'][0]) { - list($response) = $this->createStaticVoucherCampaignFromCSVWithHttpInfo($create_static_voucher_campaign_with_voucher_with_csv); + list($response) = $this->createStaticVoucherCampaignFromCSVWithHttpInfo($create_static_voucher_campaign_with_voucher_with_csv, $contentType); return $response; } @@ -1461,14 +1854,15 @@ public function createStaticVoucherCampaignFromCSV($create_static_voucher_campai * Import static voucher campaign * * @param \OpenAPI\Client\Model\CreateStaticVoucherCampaignWithVoucherWithCSV $create_static_voucher_campaign_with_voucher_with_csv (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignFromCSV'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createStaticVoucherCampaignFromCSVWithHttpInfo($create_static_voucher_campaign_with_voucher_with_csv) + public function createStaticVoucherCampaignFromCSVWithHttpInfo($create_static_voucher_campaign_with_voucher_with_csv, string $contentType = self::contentTypes['createStaticVoucherCampaignFromCSV'][0]) { - $request = $this->createStaticVoucherCampaignFromCSVRequest($create_static_voucher_campaign_with_voucher_with_csv); + $request = $this->createStaticVoucherCampaignFromCSVRequest($create_static_voucher_campaign_with_voucher_with_csv, $contentType); try { $options = $this->createHttpClientOption(); @@ -1511,6 +1905,21 @@ public function createStaticVoucherCampaignFromCSVWithHttpInfo($create_static_vo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucherCampaign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1523,6 +1932,21 @@ public function createStaticVoucherCampaignFromCSVWithHttpInfo($create_static_vo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1535,6 +1959,21 @@ public function createStaticVoucherCampaignFromCSVWithHttpInfo($create_static_vo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1547,6 +1986,21 @@ public function createStaticVoucherCampaignFromCSVWithHttpInfo($create_static_vo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1561,6 +2015,21 @@ public function createStaticVoucherCampaignFromCSVWithHttpInfo($create_static_vo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2083,14 @@ public function createStaticVoucherCampaignFromCSVWithHttpInfo($create_static_vo * Import static voucher campaign * * @param \OpenAPI\Client\Model\CreateStaticVoucherCampaignWithVoucherWithCSV $create_static_voucher_campaign_with_voucher_with_csv (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignFromCSV'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStaticVoucherCampaignFromCSVAsync($create_static_voucher_campaign_with_voucher_with_csv) + public function createStaticVoucherCampaignFromCSVAsync($create_static_voucher_campaign_with_voucher_with_csv, string $contentType = self::contentTypes['createStaticVoucherCampaignFromCSV'][0]) { - return $this->createStaticVoucherCampaignFromCSVAsyncWithHttpInfo($create_static_voucher_campaign_with_voucher_with_csv) + return $this->createStaticVoucherCampaignFromCSVAsyncWithHttpInfo($create_static_voucher_campaign_with_voucher_with_csv, $contentType) ->then( function ($response) { return $response[0]; @@ -1634,14 +2104,15 @@ function ($response) { * Import static voucher campaign * * @param \OpenAPI\Client\Model\CreateStaticVoucherCampaignWithVoucherWithCSV $create_static_voucher_campaign_with_voucher_with_csv (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignFromCSV'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStaticVoucherCampaignFromCSVAsyncWithHttpInfo($create_static_voucher_campaign_with_voucher_with_csv) + public function createStaticVoucherCampaignFromCSVAsyncWithHttpInfo($create_static_voucher_campaign_with_voucher_with_csv, string $contentType = self::contentTypes['createStaticVoucherCampaignFromCSV'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucherCampaign'; - $request = $this->createStaticVoucherCampaignFromCSVRequest($create_static_voucher_campaign_with_voucher_with_csv); + $request = $this->createStaticVoucherCampaignFromCSVRequest($create_static_voucher_campaign_with_voucher_with_csv, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1651,6 +2122,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1680,12 +2154,14 @@ function ($exception) { * Create request for operation 'createStaticVoucherCampaignFromCSV' * * @param \OpenAPI\Client\Model\CreateStaticVoucherCampaignWithVoucherWithCSV $create_static_voucher_campaign_with_voucher_with_csv (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignFromCSV'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createStaticVoucherCampaignFromCSVRequest($create_static_voucher_campaign_with_voucher_with_csv) + public function createStaticVoucherCampaignFromCSVRequest($create_static_voucher_campaign_with_voucher_with_csv, string $contentType = self::contentTypes['createStaticVoucherCampaignFromCSV'][0]) { + // verify the required parameter 'create_static_voucher_campaign_with_voucher_with_csv' is set if ($create_static_voucher_campaign_with_voucher_with_csv === null || (is_array($create_static_voucher_campaign_with_voucher_with_csv) && count($create_static_voucher_campaign_with_voucher_with_csv) === 0)) { throw new \InvalidArgumentException( @@ -1693,6 +2169,7 @@ public function createStaticVoucherCampaignFromCSVRequest($create_static_voucher ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/csv'; $formParams = []; $queryParams = []; @@ -1704,21 +2181,17 @@ public function createStaticVoucherCampaignFromCSVRequest($create_static_voucher - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($create_static_voucher_campaign_with_voucher_with_csv)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_static_voucher_campaign_with_voucher_with_csv)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_static_voucher_campaign_with_voucher_with_csv)); } else { $httpBody = $create_static_voucher_campaign_with_voucher_with_csv; } @@ -1737,12 +2210,12 @@ public function createStaticVoucherCampaignFromCSVRequest($create_static_voucher // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1758,10 +2231,11 @@ public function createStaticVoucherCampaignFromCSVRequest($create_static_voucher $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1773,14 +2247,15 @@ public function createStaticVoucherCampaignFromCSVRequest($create_static_voucher * Create static voucher campaign with voucher * * @param \OpenAPI\Client\Model\PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive $body body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignWithVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createStaticVoucherCampaignWithVoucher($body) + public function createStaticVoucherCampaignWithVoucher($body, string $contentType = self::contentTypes['createStaticVoucherCampaignWithVoucher'][0]) { - list($response) = $this->createStaticVoucherCampaignWithVoucherWithHttpInfo($body); + list($response) = $this->createStaticVoucherCampaignWithVoucherWithHttpInfo($body, $contentType); return $response; } @@ -1790,14 +2265,15 @@ public function createStaticVoucherCampaignWithVoucher($body) * Create static voucher campaign with voucher * * @param \OpenAPI\Client\Model\PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive $body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignWithVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createStaticVoucherCampaignWithVoucherWithHttpInfo($body) + public function createStaticVoucherCampaignWithVoucherWithHttpInfo($body, string $contentType = self::contentTypes['createStaticVoucherCampaignWithVoucher'][0]) { - $request = $this->createStaticVoucherCampaignWithVoucherRequest($body); + $request = $this->createStaticVoucherCampaignWithVoucherRequest($body, $contentType); try { $options = $this->createHttpClientOption(); @@ -1840,6 +2316,21 @@ public function createStaticVoucherCampaignWithVoucherWithHttpInfo($body) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucherCampaign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1852,6 +2343,21 @@ public function createStaticVoucherCampaignWithVoucherWithHttpInfo($body) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1864,6 +2370,21 @@ public function createStaticVoucherCampaignWithVoucherWithHttpInfo($body) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1876,6 +2397,21 @@ public function createStaticVoucherCampaignWithVoucherWithHttpInfo($body) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1890,6 +2426,21 @@ public function createStaticVoucherCampaignWithVoucherWithHttpInfo($body) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1943,13 +2494,14 @@ public function createStaticVoucherCampaignWithVoucherWithHttpInfo($body) * Create static voucher campaign with voucher * * @param \OpenAPI\Client\Model\PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive $body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignWithVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStaticVoucherCampaignWithVoucherAsync($body) + public function createStaticVoucherCampaignWithVoucherAsync($body, string $contentType = self::contentTypes['createStaticVoucherCampaignWithVoucher'][0]) { - return $this->createStaticVoucherCampaignWithVoucherAsyncWithHttpInfo($body) + return $this->createStaticVoucherCampaignWithVoucherAsyncWithHttpInfo($body, $contentType) ->then( function ($response) { return $response[0]; @@ -1963,14 +2515,15 @@ function ($response) { * Create static voucher campaign with voucher * * @param \OpenAPI\Client\Model\PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive $body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignWithVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStaticVoucherCampaignWithVoucherAsyncWithHttpInfo($body) + public function createStaticVoucherCampaignWithVoucherAsyncWithHttpInfo($body, string $contentType = self::contentTypes['createStaticVoucherCampaignWithVoucher'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucherCampaign'; - $request = $this->createStaticVoucherCampaignWithVoucherRequest($body); + $request = $this->createStaticVoucherCampaignWithVoucherRequest($body, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1980,6 +2533,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2009,12 +2565,14 @@ function ($exception) { * Create request for operation 'createStaticVoucherCampaignWithVoucher' * * @param \OpenAPI\Client\Model\PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive $body (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucherCampaignWithVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createStaticVoucherCampaignWithVoucherRequest($body) + public function createStaticVoucherCampaignWithVoucherRequest($body, string $contentType = self::contentTypes['createStaticVoucherCampaignWithVoucher'][0]) { + // verify the required parameter 'body' is set if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( @@ -2022,6 +2580,7 @@ public function createStaticVoucherCampaignWithVoucherRequest($body) ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/voucher'; $formParams = []; $queryParams = []; @@ -2033,21 +2592,17 @@ public function createStaticVoucherCampaignWithVoucherRequest($body) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($body)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body)); } else { $httpBody = $body; } @@ -2066,12 +2621,12 @@ public function createStaticVoucherCampaignWithVoucherRequest($body) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2087,10 +2642,11 @@ public function createStaticVoucherCampaignWithVoucherRequest($body) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2102,14 +2658,15 @@ public function createStaticVoucherCampaignWithVoucherRequest($body) * Duplicate static voucher campaign * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['duplicateStaticVoucherCampaignById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function duplicateStaticVoucherCampaignById($campaign_id) + public function duplicateStaticVoucherCampaignById($campaign_id, string $contentType = self::contentTypes['duplicateStaticVoucherCampaignById'][0]) { - list($response) = $this->duplicateStaticVoucherCampaignByIdWithHttpInfo($campaign_id); + list($response) = $this->duplicateStaticVoucherCampaignByIdWithHttpInfo($campaign_id, $contentType); return $response; } @@ -2119,14 +2676,15 @@ public function duplicateStaticVoucherCampaignById($campaign_id) * Duplicate static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['duplicateStaticVoucherCampaignById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function duplicateStaticVoucherCampaignByIdWithHttpInfo($campaign_id) + public function duplicateStaticVoucherCampaignByIdWithHttpInfo($campaign_id, string $contentType = self::contentTypes['duplicateStaticVoucherCampaignById'][0]) { - $request = $this->duplicateStaticVoucherCampaignByIdRequest($campaign_id); + $request = $this->duplicateStaticVoucherCampaignByIdRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2169,6 +2727,21 @@ public function duplicateStaticVoucherCampaignByIdWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucherCampaign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2181,6 +2754,21 @@ public function duplicateStaticVoucherCampaignByIdWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2193,6 +2781,21 @@ public function duplicateStaticVoucherCampaignByIdWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2205,6 +2808,21 @@ public function duplicateStaticVoucherCampaignByIdWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2219,6 +2837,21 @@ public function duplicateStaticVoucherCampaignByIdWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2272,13 +2905,14 @@ public function duplicateStaticVoucherCampaignByIdWithHttpInfo($campaign_id) * Duplicate static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['duplicateStaticVoucherCampaignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function duplicateStaticVoucherCampaignByIdAsync($campaign_id) + public function duplicateStaticVoucherCampaignByIdAsync($campaign_id, string $contentType = self::contentTypes['duplicateStaticVoucherCampaignById'][0]) { - return $this->duplicateStaticVoucherCampaignByIdAsyncWithHttpInfo($campaign_id) + return $this->duplicateStaticVoucherCampaignByIdAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2292,14 +2926,15 @@ function ($response) { * Duplicate static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['duplicateStaticVoucherCampaignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function duplicateStaticVoucherCampaignByIdAsyncWithHttpInfo($campaign_id) + public function duplicateStaticVoucherCampaignByIdAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['duplicateStaticVoucherCampaignById'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucherCampaign'; - $request = $this->duplicateStaticVoucherCampaignByIdRequest($campaign_id); + $request = $this->duplicateStaticVoucherCampaignByIdRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2309,6 +2944,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2338,12 +2976,14 @@ function ($exception) { * Create request for operation 'duplicateStaticVoucherCampaignById' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['duplicateStaticVoucherCampaignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function duplicateStaticVoucherCampaignByIdRequest($campaign_id) + public function duplicateStaticVoucherCampaignByIdRequest($campaign_id, string $contentType = self::contentTypes['duplicateStaticVoucherCampaignById'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -2351,6 +2991,7 @@ public function duplicateStaticVoucherCampaignByIdRequest($campaign_id) ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/duplicate/{campaignID}'; $formParams = []; $queryParams = []; @@ -2370,16 +3011,11 @@ public function duplicateStaticVoucherCampaignByIdRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2397,12 +3033,12 @@ public function duplicateStaticVoucherCampaignByIdRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2418,10 +3054,11 @@ public function duplicateStaticVoucherCampaignByIdRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2433,14 +3070,15 @@ public function duplicateStaticVoucherCampaignByIdRequest($campaign_id) * Fetch performance overview * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformanceOverview'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return object|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchPerformanceOverview($campaign_id) + public function fetchPerformanceOverview($campaign_id, string $contentType = self::contentTypes['fetchPerformanceOverview'][0]) { - list($response) = $this->fetchPerformanceOverviewWithHttpInfo($campaign_id); + list($response) = $this->fetchPerformanceOverviewWithHttpInfo($campaign_id, $contentType); return $response; } @@ -2450,14 +3088,15 @@ public function fetchPerformanceOverview($campaign_id) * Fetch performance overview * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformanceOverview'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of object|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchPerformanceOverviewWithHttpInfo($campaign_id) + public function fetchPerformanceOverviewWithHttpInfo($campaign_id, string $contentType = self::contentTypes['fetchPerformanceOverview'][0]) { - $request = $this->fetchPerformanceOverviewRequest($campaign_id); + $request = $this->fetchPerformanceOverviewRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2500,6 +3139,21 @@ public function fetchPerformanceOverviewWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('object' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2512,6 +3166,21 @@ public function fetchPerformanceOverviewWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2524,6 +3193,21 @@ public function fetchPerformanceOverviewWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2536,6 +3220,21 @@ public function fetchPerformanceOverviewWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2550,6 +3249,21 @@ public function fetchPerformanceOverviewWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2603,13 +3317,14 @@ public function fetchPerformanceOverviewWithHttpInfo($campaign_id) * Fetch performance overview * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformanceOverview'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPerformanceOverviewAsync($campaign_id) + public function fetchPerformanceOverviewAsync($campaign_id, string $contentType = self::contentTypes['fetchPerformanceOverview'][0]) { - return $this->fetchPerformanceOverviewAsyncWithHttpInfo($campaign_id) + return $this->fetchPerformanceOverviewAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2623,14 +3338,15 @@ function ($response) { * Fetch performance overview * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformanceOverview'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchPerformanceOverviewAsyncWithHttpInfo($campaign_id) + public function fetchPerformanceOverviewAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['fetchPerformanceOverview'][0]) { $returnType = 'object'; - $request = $this->fetchPerformanceOverviewRequest($campaign_id); + $request = $this->fetchPerformanceOverviewRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2640,6 +3356,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2669,12 +3388,14 @@ function ($exception) { * Create request for operation 'fetchPerformanceOverview' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchPerformanceOverview'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchPerformanceOverviewRequest($campaign_id) + public function fetchPerformanceOverviewRequest($campaign_id, string $contentType = self::contentTypes['fetchPerformanceOverview'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -2682,6 +3403,7 @@ public function fetchPerformanceOverviewRequest($campaign_id) ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/overview/performance/{campaignID}'; $formParams = []; $queryParams = []; @@ -2701,16 +3423,11 @@ public function fetchPerformanceOverviewRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2728,12 +3445,12 @@ public function fetchPerformanceOverviewRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2749,10 +3466,11 @@ public function fetchPerformanceOverviewRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2765,14 +3483,15 @@ public function fetchPerformanceOverviewRequest($campaign_id) * * @param \DateTime $broadcast_scheduled_start_at broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllStaticVoucherCampaigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchReachStatsOfAllStaticVoucherCampaigns($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllStaticVoucherCampaigns($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllStaticVoucherCampaigns'][0]) { - list($response) = $this->fetchReachStatsOfAllStaticVoucherCampaignsWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + list($response) = $this->fetchReachStatsOfAllStaticVoucherCampaignsWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $response; } @@ -2783,14 +3502,15 @@ public function fetchReachStatsOfAllStaticVoucherCampaigns($broadcast_scheduled_ * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllStaticVoucherCampaigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchReachStatsOfAllStaticVoucherCampaignsWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllStaticVoucherCampaignsWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllStaticVoucherCampaigns'][0]) { - $request = $this->fetchReachStatsOfAllStaticVoucherCampaignsRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfAllStaticVoucherCampaignsRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); try { $options = $this->createHttpClientOption(); @@ -2833,6 +3553,21 @@ public function fetchReachStatsOfAllStaticVoucherCampaignsWithHttpInfo($broadcas $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ReachPerformanceStats' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2845,6 +3580,21 @@ public function fetchReachStatsOfAllStaticVoucherCampaignsWithHttpInfo($broadcas $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2857,6 +3607,21 @@ public function fetchReachStatsOfAllStaticVoucherCampaignsWithHttpInfo($broadcas $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2869,6 +3634,21 @@ public function fetchReachStatsOfAllStaticVoucherCampaignsWithHttpInfo($broadcas $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2883,6 +3663,21 @@ public function fetchReachStatsOfAllStaticVoucherCampaignsWithHttpInfo($broadcas $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2937,13 +3732,14 @@ public function fetchReachStatsOfAllStaticVoucherCampaignsWithHttpInfo($broadcas * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllStaticVoucherCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfAllStaticVoucherCampaignsAsync($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllStaticVoucherCampaignsAsync($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllStaticVoucherCampaigns'][0]) { - return $this->fetchReachStatsOfAllStaticVoucherCampaignsAsyncWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at) + return $this->fetchReachStatsOfAllStaticVoucherCampaignsAsyncWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType) ->then( function ($response) { return $response[0]; @@ -2958,14 +3754,15 @@ function ($response) { * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllStaticVoucherCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfAllStaticVoucherCampaignsAsyncWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllStaticVoucherCampaignsAsyncWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllStaticVoucherCampaigns'][0]) { $returnType = '\OpenAPI\Client\Model\ReachPerformanceStats'; - $request = $this->fetchReachStatsOfAllStaticVoucherCampaignsRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfAllStaticVoucherCampaignsRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2975,6 +3772,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3005,13 +3805,17 @@ function ($exception) { * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllStaticVoucherCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchReachStatsOfAllStaticVoucherCampaignsRequest($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllStaticVoucherCampaignsRequest($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllStaticVoucherCampaigns'][0]) { + + + $resourcePath = '/v2/payment/staticVoucherCampaign/reach/all'; $formParams = []; $queryParams = []; @@ -3020,41 +3824,32 @@ public function fetchReachStatsOfAllStaticVoucherCampaignsRequest($broadcast_sch $multipart = false; // query params - if ($broadcast_scheduled_start_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_start_at)) { - foreach($broadcast_scheduled_start_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledStartAt'] = $broadcast_scheduled_start_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_start_at, + 'broadcastScheduledStartAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($broadcast_scheduled_end_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_end_at)) { - foreach($broadcast_scheduled_end_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledEndAt'] = $broadcast_scheduled_end_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_end_at, + 'broadcastScheduledEndAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3072,12 +3867,12 @@ public function fetchReachStatsOfAllStaticVoucherCampaignsRequest($broadcast_sch // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3093,10 +3888,11 @@ public function fetchReachStatsOfAllStaticVoucherCampaignsRequest($broadcast_sch $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3110,14 +3906,15 @@ public function fetchReachStatsOfAllStaticVoucherCampaignsRequest($broadcast_sch * @param mixed $static_voucher_campaign_id static_voucher_campaign_id (required) * @param \DateTime $broadcast_scheduled_start_at broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchReachStatsOfIndividualStaticVoucherCampaign($static_voucher_campaign_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualStaticVoucherCampaign($static_voucher_campaign_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualStaticVoucherCampaign'][0]) { - list($response) = $this->fetchReachStatsOfIndividualStaticVoucherCampaignWithHttpInfo($static_voucher_campaign_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + list($response) = $this->fetchReachStatsOfIndividualStaticVoucherCampaignWithHttpInfo($static_voucher_campaign_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $response; } @@ -3129,14 +3926,15 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaign($static_voucher * @param mixed $static_voucher_campaign_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchReachStatsOfIndividualStaticVoucherCampaignWithHttpInfo($static_voucher_campaign_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualStaticVoucherCampaignWithHttpInfo($static_voucher_campaign_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualStaticVoucherCampaign'][0]) { - $request = $this->fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_voucher_campaign_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_voucher_campaign_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); try { $options = $this->createHttpClientOption(); @@ -3179,6 +3977,21 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignWithHttpInfo($st $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ReachPerformanceStats' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3191,6 +4004,21 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignWithHttpInfo($st $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3203,6 +4031,21 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignWithHttpInfo($st $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3215,6 +4058,21 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignWithHttpInfo($st $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3229,6 +4087,21 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignWithHttpInfo($st $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3284,13 +4157,14 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignWithHttpInfo($st * @param mixed $static_voucher_campaign_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfIndividualStaticVoucherCampaignAsync($static_voucher_campaign_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualStaticVoucherCampaignAsync($static_voucher_campaign_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualStaticVoucherCampaign'][0]) { - return $this->fetchReachStatsOfIndividualStaticVoucherCampaignAsyncWithHttpInfo($static_voucher_campaign_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at) + return $this->fetchReachStatsOfIndividualStaticVoucherCampaignAsyncWithHttpInfo($static_voucher_campaign_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType) ->then( function ($response) { return $response[0]; @@ -3306,14 +4180,15 @@ function ($response) { * @param mixed $static_voucher_campaign_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfIndividualStaticVoucherCampaignAsyncWithHttpInfo($static_voucher_campaign_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualStaticVoucherCampaignAsyncWithHttpInfo($static_voucher_campaign_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualStaticVoucherCampaign'][0]) { $returnType = '\OpenAPI\Client\Model\ReachPerformanceStats'; - $request = $this->fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_voucher_campaign_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_voucher_campaign_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3323,6 +4198,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3354,12 +4232,14 @@ function ($exception) { * @param mixed $static_voucher_campaign_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_voucher_campaign_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_voucher_campaign_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualStaticVoucherCampaign'][0]) { + // verify the required parameter 'static_voucher_campaign_id' is set if ($static_voucher_campaign_id === null || (is_array($static_voucher_campaign_id) && count($static_voucher_campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -3367,6 +4247,9 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_ ); } + + + $resourcePath = '/v2/payment/staticVoucherCampaign/reach/{staticVoucherCampaignID}'; $formParams = []; $queryParams = []; @@ -3375,27 +4258,23 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_ $multipart = false; // query params - if ($broadcast_scheduled_start_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_start_at)) { - foreach($broadcast_scheduled_start_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledStartAt'] = $broadcast_scheduled_start_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_start_at, + 'broadcastScheduledStartAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($broadcast_scheduled_end_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_end_at)) { - foreach($broadcast_scheduled_end_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledEndAt'] = $broadcast_scheduled_end_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_end_at, + 'broadcastScheduledEndAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -3408,16 +4287,11 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_ } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3435,12 +4309,12 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3456,10 +4330,11 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3471,14 +4346,15 @@ public function fetchReachStatsOfIndividualStaticVoucherCampaignRequest($static_ * Fetch static voucher campaign * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchStaticVoucherCampaignById($id) + public function fetchStaticVoucherCampaignById($id, string $contentType = self::contentTypes['fetchStaticVoucherCampaignById'][0]) { - list($response) = $this->fetchStaticVoucherCampaignByIdWithHttpInfo($id); + list($response) = $this->fetchStaticVoucherCampaignByIdWithHttpInfo($id, $contentType); return $response; } @@ -3488,14 +4364,15 @@ public function fetchStaticVoucherCampaignById($id) * Fetch static voucher campaign * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignById'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchStaticVoucherCampaignByIdWithHttpInfo($id) + public function fetchStaticVoucherCampaignByIdWithHttpInfo($id, string $contentType = self::contentTypes['fetchStaticVoucherCampaignById'][0]) { - $request = $this->fetchStaticVoucherCampaignByIdRequest($id); + $request = $this->fetchStaticVoucherCampaignByIdRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3538,6 +4415,21 @@ public function fetchStaticVoucherCampaignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucherCampaign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3550,6 +4442,21 @@ public function fetchStaticVoucherCampaignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3562,6 +4469,21 @@ public function fetchStaticVoucherCampaignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3574,6 +4496,21 @@ public function fetchStaticVoucherCampaignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3588,6 +4525,21 @@ public function fetchStaticVoucherCampaignByIdWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3641,13 +4593,14 @@ public function fetchStaticVoucherCampaignByIdWithHttpInfo($id) * Fetch static voucher campaign * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherCampaignByIdAsync($id) + public function fetchStaticVoucherCampaignByIdAsync($id, string $contentType = self::contentTypes['fetchStaticVoucherCampaignById'][0]) { - return $this->fetchStaticVoucherCampaignByIdAsyncWithHttpInfo($id) + return $this->fetchStaticVoucherCampaignByIdAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -3661,14 +4614,15 @@ function ($response) { * Fetch static voucher campaign * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherCampaignByIdAsyncWithHttpInfo($id) + public function fetchStaticVoucherCampaignByIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchStaticVoucherCampaignById'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucherCampaign'; - $request = $this->fetchStaticVoucherCampaignByIdRequest($id); + $request = $this->fetchStaticVoucherCampaignByIdRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3678,6 +4632,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -3707,12 +4664,14 @@ function ($exception) { * Create request for operation 'fetchStaticVoucherCampaignById' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaignById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchStaticVoucherCampaignByIdRequest($id) + public function fetchStaticVoucherCampaignByIdRequest($id, string $contentType = self::contentTypes['fetchStaticVoucherCampaignById'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -3720,6 +4679,7 @@ public function fetchStaticVoucherCampaignByIdRequest($id) ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/{id}'; $formParams = []; $queryParams = []; @@ -3739,16 +4699,11 @@ public function fetchStaticVoucherCampaignByIdRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -3766,12 +4721,12 @@ public function fetchStaticVoucherCampaignByIdRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -3787,10 +4742,11 @@ public function fetchStaticVoucherCampaignByIdRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3802,15 +4758,16 @@ public function fetchStaticVoucherCampaignByIdRequest($id) * Fetches all static vouchers campaigns * * @param bool $is_archive_included is_archive_included (optional) - * @param double $source_id source_id (optional) + * @param float $source_id source_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucherCampaign[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchStaticVoucherCampaigns($is_archive_included = null, $source_id = null) + public function fetchStaticVoucherCampaigns($is_archive_included = null, $source_id = null, string $contentType = self::contentTypes['fetchStaticVoucherCampaigns'][0]) { - list($response) = $this->fetchStaticVoucherCampaignsWithHttpInfo($is_archive_included, $source_id); + list($response) = $this->fetchStaticVoucherCampaignsWithHttpInfo($is_archive_included, $source_id, $contentType); return $response; } @@ -3820,15 +4777,16 @@ public function fetchStaticVoucherCampaigns($is_archive_included = null, $source * Fetches all static vouchers campaigns * * @param bool $is_archive_included (optional) - * @param double $source_id (optional) + * @param float $source_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaigns'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucherCampaign[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchStaticVoucherCampaignsWithHttpInfo($is_archive_included = null, $source_id = null) + public function fetchStaticVoucherCampaignsWithHttpInfo($is_archive_included = null, $source_id = null, string $contentType = self::contentTypes['fetchStaticVoucherCampaigns'][0]) { - $request = $this->fetchStaticVoucherCampaignsRequest($is_archive_included, $source_id); + $request = $this->fetchStaticVoucherCampaignsRequest($is_archive_included, $source_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3871,6 +4829,21 @@ public function fetchStaticVoucherCampaignsWithHttpInfo($is_archive_included = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucherCampaign[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3883,6 +4856,21 @@ public function fetchStaticVoucherCampaignsWithHttpInfo($is_archive_included = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3895,6 +4883,21 @@ public function fetchStaticVoucherCampaignsWithHttpInfo($is_archive_included = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3907,6 +4910,21 @@ public function fetchStaticVoucherCampaignsWithHttpInfo($is_archive_included = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3921,6 +4939,21 @@ public function fetchStaticVoucherCampaignsWithHttpInfo($is_archive_included = n $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -3974,14 +5007,15 @@ public function fetchStaticVoucherCampaignsWithHttpInfo($is_archive_included = n * Fetches all static vouchers campaigns * * @param bool $is_archive_included (optional) - * @param double $source_id (optional) + * @param float $source_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherCampaignsAsync($is_archive_included = null, $source_id = null) + public function fetchStaticVoucherCampaignsAsync($is_archive_included = null, $source_id = null, string $contentType = self::contentTypes['fetchStaticVoucherCampaigns'][0]) { - return $this->fetchStaticVoucherCampaignsAsyncWithHttpInfo($is_archive_included, $source_id) + return $this->fetchStaticVoucherCampaignsAsyncWithHttpInfo($is_archive_included, $source_id, $contentType) ->then( function ($response) { return $response[0]; @@ -3995,15 +5029,16 @@ function ($response) { * Fetches all static vouchers campaigns * * @param bool $is_archive_included (optional) - * @param double $source_id (optional) + * @param float $source_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherCampaignsAsyncWithHttpInfo($is_archive_included = null, $source_id = null) + public function fetchStaticVoucherCampaignsAsyncWithHttpInfo($is_archive_included = null, $source_id = null, string $contentType = self::contentTypes['fetchStaticVoucherCampaigns'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucherCampaign[]'; - $request = $this->fetchStaticVoucherCampaignsRequest($is_archive_included, $source_id); + $request = $this->fetchStaticVoucherCampaignsRequest($is_archive_included, $source_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4013,6 +5048,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4042,14 +5080,18 @@ function ($exception) { * Create request for operation 'fetchStaticVoucherCampaigns' * * @param bool $is_archive_included (optional) - * @param double $source_id (optional) + * @param float $source_id (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucherCampaigns'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchStaticVoucherCampaignsRequest($is_archive_included = null, $source_id = null) + public function fetchStaticVoucherCampaignsRequest($is_archive_included = null, $source_id = null, string $contentType = self::contentTypes['fetchStaticVoucherCampaigns'][0]) { + + + $resourcePath = '/v2/payment/staticVoucherCampaign/all'; $formParams = []; $queryParams = []; @@ -4058,41 +5100,32 @@ public function fetchStaticVoucherCampaignsRequest($is_archive_included = null, $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($source_id !== null) { - if('form' === 'form' && is_array($source_id)) { - foreach($source_id as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['sourceID'] = $source_id; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $source_id, + 'sourceID', // param base name + 'number', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4110,12 +5143,12 @@ public function fetchStaticVoucherCampaignsRequest($is_archive_included = null, // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4131,10 +5164,11 @@ public function fetchStaticVoucherCampaignsRequest($is_archive_included = null, $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4146,14 +5180,15 @@ public function fetchStaticVoucherCampaignsRequest($is_archive_included = null, * Fetch static vouchers * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchStaticVouchers($campaign_id) + public function fetchStaticVouchers($campaign_id, string $contentType = self::contentTypes['fetchStaticVouchers'][0]) { - list($response) = $this->fetchStaticVouchersWithHttpInfo($campaign_id); + list($response) = $this->fetchStaticVouchersWithHttpInfo($campaign_id, $contentType); return $response; } @@ -4163,14 +5198,15 @@ public function fetchStaticVouchers($campaign_id) * Fetch static vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchStaticVouchersWithHttpInfo($campaign_id) + public function fetchStaticVouchersWithHttpInfo($campaign_id, string $contentType = self::contentTypes['fetchStaticVouchers'][0]) { - $request = $this->fetchStaticVouchersRequest($campaign_id); + $request = $this->fetchStaticVouchersRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -4213,6 +5249,21 @@ public function fetchStaticVouchersWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4225,6 +5276,21 @@ public function fetchStaticVouchersWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4237,6 +5303,21 @@ public function fetchStaticVouchersWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4249,6 +5330,21 @@ public function fetchStaticVouchersWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4263,6 +5359,21 @@ public function fetchStaticVouchersWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4316,13 +5427,14 @@ public function fetchStaticVouchersWithHttpInfo($campaign_id) * Fetch static vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVouchersAsync($campaign_id) + public function fetchStaticVouchersAsync($campaign_id, string $contentType = self::contentTypes['fetchStaticVouchers'][0]) { - return $this->fetchStaticVouchersAsyncWithHttpInfo($campaign_id) + return $this->fetchStaticVouchersAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -4336,14 +5448,15 @@ function ($response) { * Fetch static vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVouchersAsyncWithHttpInfo($campaign_id) + public function fetchStaticVouchersAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['fetchStaticVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucher[]'; - $request = $this->fetchStaticVouchersRequest($campaign_id); + $request = $this->fetchStaticVouchersRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4353,6 +5466,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4382,12 +5498,14 @@ function ($exception) { * Create request for operation 'fetchStaticVouchers' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchStaticVouchersRequest($campaign_id) + public function fetchStaticVouchersRequest($campaign_id, string $contentType = self::contentTypes['fetchStaticVouchers'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -4395,6 +5513,7 @@ public function fetchStaticVouchersRequest($campaign_id) ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/staticVouchers/{campaignID}'; $formParams = []; $queryParams = []; @@ -4414,16 +5533,11 @@ public function fetchStaticVouchersRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4441,12 +5555,12 @@ public function fetchStaticVouchersRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4462,10 +5576,11 @@ public function fetchStaticVouchersRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4477,16 +5592,17 @@ public function fetchStaticVouchersRequest($campaign_id) * Fetch static vouchers by page * * @param mixed $campaign_id campaign_id (required) - * @param double $pagenum pagenum (required) - * @param double $pagesize pagesize (required) + * @param float $pagenum pagenum (required) + * @param float $pagesize pagesize (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVouchersPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2008|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchStaticVouchersPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchStaticVouchersPage($campaign_id, $pagenum, $pagesize) + public function fetchStaticVouchersPage($campaign_id, $pagenum, $pagesize, string $contentType = self::contentTypes['fetchStaticVouchersPage'][0]) { - list($response) = $this->fetchStaticVouchersPageWithHttpInfo($campaign_id, $pagenum, $pagesize); + list($response) = $this->fetchStaticVouchersPageWithHttpInfo($campaign_id, $pagenum, $pagesize, $contentType); return $response; } @@ -4496,16 +5612,17 @@ public function fetchStaticVouchersPage($campaign_id, $pagenum, $pagesize) * Fetch static vouchers by page * * @param mixed $campaign_id (required) - * @param double $pagenum (required) - * @param double $pagesize (required) + * @param float $pagenum (required) + * @param float $pagesize (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVouchersPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2008|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchStaticVouchersPage200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchStaticVouchersPageWithHttpInfo($campaign_id, $pagenum, $pagesize) + public function fetchStaticVouchersPageWithHttpInfo($campaign_id, $pagenum, $pagesize, string $contentType = self::contentTypes['fetchStaticVouchersPage'][0]) { - $request = $this->fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize); + $request = $this->fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize, $contentType); try { $options = $this->createHttpClientOption(); @@ -4544,14 +5661,29 @@ public function fetchStaticVouchersPageWithHttpInfo($campaign_id, $pagenum, $pag switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2008' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchStaticVouchersPage200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchStaticVouchersPage200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2008', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchStaticVouchersPage200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4560,6 +5692,21 @@ public function fetchStaticVouchersPageWithHttpInfo($campaign_id, $pagenum, $pag $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4572,6 +5719,21 @@ public function fetchStaticVouchersPageWithHttpInfo($campaign_id, $pagenum, $pag $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4584,6 +5746,21 @@ public function fetchStaticVouchersPageWithHttpInfo($campaign_id, $pagenum, $pag $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4593,11 +5770,26 @@ public function fetchStaticVouchersPageWithHttpInfo($campaign_id, $pagenum, $pag ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2008'; + $returnType = '\OpenAPI\Client\Model\FetchStaticVouchersPage200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4611,7 +5803,7 @@ public function fetchStaticVouchersPageWithHttpInfo($campaign_id, $pagenum, $pag case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2008', + '\OpenAPI\Client\Model\FetchStaticVouchersPage200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4651,15 +5843,16 @@ public function fetchStaticVouchersPageWithHttpInfo($campaign_id, $pagenum, $pag * Fetch static vouchers by page * * @param mixed $campaign_id (required) - * @param double $pagenum (required) - * @param double $pagesize (required) + * @param float $pagenum (required) + * @param float $pagesize (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVouchersPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVouchersPageAsync($campaign_id, $pagenum, $pagesize) + public function fetchStaticVouchersPageAsync($campaign_id, $pagenum, $pagesize, string $contentType = self::contentTypes['fetchStaticVouchersPage'][0]) { - return $this->fetchStaticVouchersPageAsyncWithHttpInfo($campaign_id, $pagenum, $pagesize) + return $this->fetchStaticVouchersPageAsyncWithHttpInfo($campaign_id, $pagenum, $pagesize, $contentType) ->then( function ($response) { return $response[0]; @@ -4673,16 +5866,17 @@ function ($response) { * Fetch static vouchers by page * * @param mixed $campaign_id (required) - * @param double $pagenum (required) - * @param double $pagesize (required) + * @param float $pagenum (required) + * @param float $pagesize (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVouchersPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVouchersPageAsyncWithHttpInfo($campaign_id, $pagenum, $pagesize) + public function fetchStaticVouchersPageAsyncWithHttpInfo($campaign_id, $pagenum, $pagesize, string $contentType = self::contentTypes['fetchStaticVouchersPage'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2008'; - $request = $this->fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize); + $returnType = '\OpenAPI\Client\Model\FetchStaticVouchersPage200Response'; + $request = $this->fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4692,6 +5886,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -4721,26 +5918,30 @@ function ($exception) { * Create request for operation 'fetchStaticVouchersPage' * * @param mixed $campaign_id (required) - * @param double $pagenum (required) - * @param double $pagesize (required) + * @param float $pagenum (required) + * @param float $pagesize (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVouchersPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize) + public function fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize, string $contentType = self::contentTypes['fetchStaticVouchersPage'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaign_id when calling fetchStaticVouchersPage' ); } + // verify the required parameter 'pagenum' is set if ($pagenum === null || (is_array($pagenum) && count($pagenum) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $pagenum when calling fetchStaticVouchersPage' ); } + // verify the required parameter 'pagesize' is set if ($pagesize === null || (is_array($pagesize) && count($pagesize) === 0)) { throw new \InvalidArgumentException( @@ -4748,6 +5949,7 @@ public function fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/staticVouchers/page/{campaignID}'; $formParams = []; $queryParams = []; @@ -4756,27 +5958,23 @@ public function fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize $multipart = false; // query params - if ($pagenum !== null) { - if('form' === 'form' && is_array($pagenum)) { - foreach($pagenum as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pagenum'] = $pagenum; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pagenum, + 'pagenum', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($pagesize !== null) { - if('form' === 'form' && is_array($pagesize)) { - foreach($pagesize as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pagesize'] = $pagesize; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pagesize, + 'pagesize', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // path params @@ -4789,16 +5987,11 @@ public function fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -4816,12 +6009,12 @@ public function fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -4837,10 +6030,11 @@ public function fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -4852,14 +6046,15 @@ public function fetchStaticVouchersPageRequest($campaign_id, $pagenum, $pagesize * Fetch views * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTWalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchViews($campaign_id) + public function fetchViews($campaign_id, string $contentType = self::contentTypes['fetchViews'][0]) { - list($response) = $this->fetchViewsWithHttpInfo($campaign_id); + list($response) = $this->fetchViewsWithHttpInfo($campaign_id, $contentType); return $response; } @@ -4869,14 +6064,15 @@ public function fetchViews($campaign_id) * Fetch views * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchViews'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTWalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchViewsWithHttpInfo($campaign_id) + public function fetchViewsWithHttpInfo($campaign_id, string $contentType = self::contentTypes['fetchViews'][0]) { - $request = $this->fetchViewsRequest($campaign_id); + $request = $this->fetchViewsRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -4919,6 +6115,21 @@ public function fetchViewsWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTWalletPageView[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4931,6 +6142,21 @@ public function fetchViewsWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4943,6 +6169,21 @@ public function fetchViewsWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4955,6 +6196,21 @@ public function fetchViewsWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -4969,6 +6225,21 @@ public function fetchViewsWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5022,13 +6293,14 @@ public function fetchViewsWithHttpInfo($campaign_id) * Fetch views * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchViewsAsync($campaign_id) + public function fetchViewsAsync($campaign_id, string $contentType = self::contentTypes['fetchViews'][0]) { - return $this->fetchViewsAsyncWithHttpInfo($campaign_id) + return $this->fetchViewsAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -5042,14 +6314,15 @@ function ($response) { * Fetch views * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchViewsAsyncWithHttpInfo($campaign_id) + public function fetchViewsAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['fetchViews'][0]) { $returnType = '\OpenAPI\Client\Model\WTWalletPageView[]'; - $request = $this->fetchViewsRequest($campaign_id); + $request = $this->fetchViewsRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5059,6 +6332,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5088,12 +6364,14 @@ function ($exception) { * Create request for operation 'fetchViews' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchViews'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchViewsRequest($campaign_id) + public function fetchViewsRequest($campaign_id, string $contentType = self::contentTypes['fetchViews'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -5101,6 +6379,7 @@ public function fetchViewsRequest($campaign_id) ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/views/{campaignID}'; $formParams = []; $queryParams = []; @@ -5120,16 +6399,11 @@ public function fetchViewsRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5147,12 +6421,12 @@ public function fetchViewsRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5168,10 +6442,11 @@ public function fetchViewsRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5183,14 +6458,15 @@ public function fetchViewsRequest($campaign_id) * Fetch redeemed vouchers * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVouchersRedeemed'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchVouchersRedeemed($campaign_id) + public function fetchVouchersRedeemed($campaign_id, string $contentType = self::contentTypes['fetchVouchersRedeemed'][0]) { - list($response) = $this->fetchVouchersRedeemedWithHttpInfo($campaign_id); + list($response) = $this->fetchVouchersRedeemedWithHttpInfo($campaign_id, $contentType); return $response; } @@ -5200,14 +6476,15 @@ public function fetchVouchersRedeemed($campaign_id) * Fetch redeemed vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVouchersRedeemed'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucher[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchVouchersRedeemedWithHttpInfo($campaign_id) + public function fetchVouchersRedeemedWithHttpInfo($campaign_id, string $contentType = self::contentTypes['fetchVouchersRedeemed'][0]) { - $request = $this->fetchVouchersRedeemedRequest($campaign_id); + $request = $this->fetchVouchersRedeemedRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -5250,6 +6527,21 @@ public function fetchVouchersRedeemedWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucher[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5262,6 +6554,21 @@ public function fetchVouchersRedeemedWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5274,6 +6581,21 @@ public function fetchVouchersRedeemedWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5286,6 +6608,21 @@ public function fetchVouchersRedeemedWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5300,6 +6637,21 @@ public function fetchVouchersRedeemedWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5353,13 +6705,14 @@ public function fetchVouchersRedeemedWithHttpInfo($campaign_id) * Fetch redeemed vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVouchersRedeemed'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchVouchersRedeemedAsync($campaign_id) + public function fetchVouchersRedeemedAsync($campaign_id, string $contentType = self::contentTypes['fetchVouchersRedeemed'][0]) { - return $this->fetchVouchersRedeemedAsyncWithHttpInfo($campaign_id) + return $this->fetchVouchersRedeemedAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -5373,14 +6726,15 @@ function ($response) { * Fetch redeemed vouchers * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVouchersRedeemed'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchVouchersRedeemedAsyncWithHttpInfo($campaign_id) + public function fetchVouchersRedeemedAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['fetchVouchersRedeemed'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucher[]'; - $request = $this->fetchVouchersRedeemedRequest($campaign_id); + $request = $this->fetchVouchersRedeemedRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5390,6 +6744,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5419,12 +6776,14 @@ function ($exception) { * Create request for operation 'fetchVouchersRedeemed' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVouchersRedeemed'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchVouchersRedeemedRequest($campaign_id) + public function fetchVouchersRedeemedRequest($campaign_id, string $contentType = self::contentTypes['fetchVouchersRedeemed'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -5432,6 +6791,7 @@ public function fetchVouchersRedeemedRequest($campaign_id) ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/vouchers/redeemed/{campaignID}'; $formParams = []; $queryParams = []; @@ -5451,16 +6811,11 @@ public function fetchVouchersRedeemedRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -5478,12 +6833,12 @@ public function fetchVouchersRedeemedRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5499,10 +6854,11 @@ public function fetchVouchersRedeemedRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5515,15 +6871,16 @@ public function fetchVouchersRedeemedRequest($campaign_id) * * @param mixed $campaign_id campaign_id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessages $wt_static_voucher_campaign_preview_messages wt_static_voucher_campaign_preview_messages (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['previewMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\VSCampaignGeneratedMessage[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError * @deprecated */ - public function previewMessages($campaign_id, $wt_static_voucher_campaign_preview_messages) + public function previewMessages($campaign_id, $wt_static_voucher_campaign_preview_messages, string $contentType = self::contentTypes['previewMessages'][0]) { - list($response) = $this->previewMessagesWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages); + list($response) = $this->previewMessagesWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages, $contentType); return $response; } @@ -5534,15 +6891,16 @@ public function previewMessages($campaign_id, $wt_static_voucher_campaign_previe * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessages $wt_static_voucher_campaign_preview_messages (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['previewMessages'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\VSCampaignGeneratedMessage[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function previewMessagesWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages) + public function previewMessagesWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages, string $contentType = self::contentTypes['previewMessages'][0]) { - $request = $this->previewMessagesRequest($campaign_id, $wt_static_voucher_campaign_preview_messages); + $request = $this->previewMessagesRequest($campaign_id, $wt_static_voucher_campaign_preview_messages, $contentType); try { $options = $this->createHttpClientOption(); @@ -5585,6 +6943,21 @@ public function previewMessagesWithHttpInfo($campaign_id, $wt_static_voucher_cam $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\VSCampaignGeneratedMessage[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5597,6 +6970,21 @@ public function previewMessagesWithHttpInfo($campaign_id, $wt_static_voucher_cam $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5609,6 +6997,21 @@ public function previewMessagesWithHttpInfo($campaign_id, $wt_static_voucher_cam $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5621,6 +7024,21 @@ public function previewMessagesWithHttpInfo($campaign_id, $wt_static_voucher_cam $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5635,6 +7053,21 @@ public function previewMessagesWithHttpInfo($campaign_id, $wt_static_voucher_cam $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5689,14 +7122,15 @@ public function previewMessagesWithHttpInfo($campaign_id, $wt_static_voucher_cam * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessages $wt_static_voucher_campaign_preview_messages (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['previewMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function previewMessagesAsync($campaign_id, $wt_static_voucher_campaign_preview_messages) + public function previewMessagesAsync($campaign_id, $wt_static_voucher_campaign_preview_messages, string $contentType = self::contentTypes['previewMessages'][0]) { - return $this->previewMessagesAsyncWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages) + return $this->previewMessagesAsyncWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages, $contentType) ->then( function ($response) { return $response[0]; @@ -5711,15 +7145,16 @@ function ($response) { * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessages $wt_static_voucher_campaign_preview_messages (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['previewMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function previewMessagesAsyncWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages) + public function previewMessagesAsyncWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages, string $contentType = self::contentTypes['previewMessages'][0]) { $returnType = '\OpenAPI\Client\Model\VSCampaignGeneratedMessage[]'; - $request = $this->previewMessagesRequest($campaign_id, $wt_static_voucher_campaign_preview_messages); + $request = $this->previewMessagesRequest($campaign_id, $wt_static_voucher_campaign_preview_messages, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5729,6 +7164,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -5759,19 +7197,22 @@ function ($exception) { * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessages $wt_static_voucher_campaign_preview_messages (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['previewMessages'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function previewMessagesRequest($campaign_id, $wt_static_voucher_campaign_preview_messages) + public function previewMessagesRequest($campaign_id, $wt_static_voucher_campaign_preview_messages, string $contentType = self::contentTypes['previewMessages'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaign_id when calling previewMessages' ); } + // verify the required parameter 'wt_static_voucher_campaign_preview_messages' is set if ($wt_static_voucher_campaign_preview_messages === null || (is_array($wt_static_voucher_campaign_preview_messages) && count($wt_static_voucher_campaign_preview_messages) === 0)) { throw new \InvalidArgumentException( @@ -5779,6 +7220,7 @@ public function previewMessagesRequest($campaign_id, $wt_static_voucher_campaign ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/preview/{campaignID}'; $formParams = []; $queryParams = []; @@ -5798,21 +7240,17 @@ public function previewMessagesRequest($campaign_id, $wt_static_voucher_campaign } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_static_voucher_campaign_preview_messages)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_static_voucher_campaign_preview_messages)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_static_voucher_campaign_preview_messages)); } else { $httpBody = $wt_static_voucher_campaign_preview_messages; } @@ -5831,12 +7269,12 @@ public function previewMessagesRequest($campaign_id, $wt_static_voucher_campaign // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -5852,10 +7290,11 @@ public function previewMessagesRequest($campaign_id, $wt_static_voucher_campaign $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -5868,14 +7307,15 @@ public function previewMessagesRequest($campaign_id, $wt_static_voucher_campaign * * @param mixed $campaign_id campaign_id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessagesByPage $wt_static_voucher_campaign_preview_messages_by_page wt_static_voucher_campaign_preview_messages_by_page (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['previewMessagesByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\VSCampaignGeneratedMessagePagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function previewMessagesByPage($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page) + public function previewMessagesByPage($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page, string $contentType = self::contentTypes['previewMessagesByPage'][0]) { - list($response) = $this->previewMessagesByPageWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page); + list($response) = $this->previewMessagesByPageWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page, $contentType); return $response; } @@ -5886,14 +7326,15 @@ public function previewMessagesByPage($campaign_id, $wt_static_voucher_campaign_ * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessagesByPage $wt_static_voucher_campaign_preview_messages_by_page (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['previewMessagesByPage'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\VSCampaignGeneratedMessagePagination|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function previewMessagesByPageWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page) + public function previewMessagesByPageWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page, string $contentType = self::contentTypes['previewMessagesByPage'][0]) { - $request = $this->previewMessagesByPageRequest($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page); + $request = $this->previewMessagesByPageRequest($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page, $contentType); try { $options = $this->createHttpClientOption(); @@ -5936,6 +7377,21 @@ public function previewMessagesByPageWithHttpInfo($campaign_id, $wt_static_vouch $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\VSCampaignGeneratedMessagePagination' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5948,6 +7404,21 @@ public function previewMessagesByPageWithHttpInfo($campaign_id, $wt_static_vouch $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5960,6 +7431,21 @@ public function previewMessagesByPageWithHttpInfo($campaign_id, $wt_static_vouch $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5972,6 +7458,21 @@ public function previewMessagesByPageWithHttpInfo($campaign_id, $wt_static_vouch $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -5986,6 +7487,21 @@ public function previewMessagesByPageWithHttpInfo($campaign_id, $wt_static_vouch $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6040,13 +7556,14 @@ public function previewMessagesByPageWithHttpInfo($campaign_id, $wt_static_vouch * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessagesByPage $wt_static_voucher_campaign_preview_messages_by_page (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['previewMessagesByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function previewMessagesByPageAsync($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page) + public function previewMessagesByPageAsync($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page, string $contentType = self::contentTypes['previewMessagesByPage'][0]) { - return $this->previewMessagesByPageAsyncWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page) + return $this->previewMessagesByPageAsyncWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page, $contentType) ->then( function ($response) { return $response[0]; @@ -6061,14 +7578,15 @@ function ($response) { * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessagesByPage $wt_static_voucher_campaign_preview_messages_by_page (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['previewMessagesByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function previewMessagesByPageAsyncWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page) + public function previewMessagesByPageAsyncWithHttpInfo($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page, string $contentType = self::contentTypes['previewMessagesByPage'][0]) { $returnType = '\OpenAPI\Client\Model\VSCampaignGeneratedMessagePagination'; - $request = $this->previewMessagesByPageRequest($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page); + $request = $this->previewMessagesByPageRequest($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6078,6 +7596,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6108,18 +7629,21 @@ function ($exception) { * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherCampaignPreviewMessagesByPage $wt_static_voucher_campaign_preview_messages_by_page (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['previewMessagesByPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function previewMessagesByPageRequest($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page) + public function previewMessagesByPageRequest($campaign_id, $wt_static_voucher_campaign_preview_messages_by_page, string $contentType = self::contentTypes['previewMessagesByPage'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaign_id when calling previewMessagesByPage' ); } + // verify the required parameter 'wt_static_voucher_campaign_preview_messages_by_page' is set if ($wt_static_voucher_campaign_preview_messages_by_page === null || (is_array($wt_static_voucher_campaign_preview_messages_by_page) && count($wt_static_voucher_campaign_preview_messages_by_page) === 0)) { throw new \InvalidArgumentException( @@ -6127,6 +7651,7 @@ public function previewMessagesByPageRequest($campaign_id, $wt_static_voucher_ca ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/preview/page/{campaignID}'; $formParams = []; $queryParams = []; @@ -6146,21 +7671,17 @@ public function previewMessagesByPageRequest($campaign_id, $wt_static_voucher_ca } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_static_voucher_campaign_preview_messages_by_page)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_static_voucher_campaign_preview_messages_by_page)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_static_voucher_campaign_preview_messages_by_page)); } else { $httpBody = $wt_static_voucher_campaign_preview_messages_by_page; } @@ -6179,12 +7700,12 @@ public function previewMessagesByPageRequest($campaign_id, $wt_static_voucher_ca // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6200,10 +7721,11 @@ public function previewMessagesByPageRequest($campaign_id, $wt_static_voucher_ca $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6215,14 +7737,15 @@ public function previewMessagesByPageRequest($campaign_id, $wt_static_voucher_ca * Restore static voucher campaign * * @param mixed $campaign_id campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\StaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreStaticVoucherCampaign($campaign_id) + public function restoreStaticVoucherCampaign($campaign_id, string $contentType = self::contentTypes['restoreStaticVoucherCampaign'][0]) { - list($response) = $this->restoreStaticVoucherCampaignWithHttpInfo($campaign_id); + list($response) = $this->restoreStaticVoucherCampaignWithHttpInfo($campaign_id, $contentType); return $response; } @@ -6232,14 +7755,15 @@ public function restoreStaticVoucherCampaign($campaign_id) * Restore static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\StaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreStaticVoucherCampaignWithHttpInfo($campaign_id) + public function restoreStaticVoucherCampaignWithHttpInfo($campaign_id, string $contentType = self::contentTypes['restoreStaticVoucherCampaign'][0]) { - $request = $this->restoreStaticVoucherCampaignRequest($campaign_id); + $request = $this->restoreStaticVoucherCampaignRequest($campaign_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -6282,6 +7806,21 @@ public function restoreStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\StaticVoucherCampaign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6294,6 +7833,21 @@ public function restoreStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6306,6 +7860,21 @@ public function restoreStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6318,6 +7887,21 @@ public function restoreStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6332,6 +7916,21 @@ public function restoreStaticVoucherCampaignWithHttpInfo($campaign_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6385,13 +7984,14 @@ public function restoreStaticVoucherCampaignWithHttpInfo($campaign_id) * Restore static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreStaticVoucherCampaignAsync($campaign_id) + public function restoreStaticVoucherCampaignAsync($campaign_id, string $contentType = self::contentTypes['restoreStaticVoucherCampaign'][0]) { - return $this->restoreStaticVoucherCampaignAsyncWithHttpInfo($campaign_id) + return $this->restoreStaticVoucherCampaignAsyncWithHttpInfo($campaign_id, $contentType) ->then( function ($response) { return $response[0]; @@ -6405,14 +8005,15 @@ function ($response) { * Restore static voucher campaign * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreStaticVoucherCampaignAsyncWithHttpInfo($campaign_id) + public function restoreStaticVoucherCampaignAsyncWithHttpInfo($campaign_id, string $contentType = self::contentTypes['restoreStaticVoucherCampaign'][0]) { $returnType = '\OpenAPI\Client\Model\StaticVoucherCampaign'; - $request = $this->restoreStaticVoucherCampaignRequest($campaign_id); + $request = $this->restoreStaticVoucherCampaignRequest($campaign_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6422,6 +8023,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6451,12 +8055,14 @@ function ($exception) { * Create request for operation 'restoreStaticVoucherCampaign' * * @param mixed $campaign_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreStaticVoucherCampaignRequest($campaign_id) + public function restoreStaticVoucherCampaignRequest($campaign_id, string $contentType = self::contentTypes['restoreStaticVoucherCampaign'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( @@ -6464,6 +8070,7 @@ public function restoreStaticVoucherCampaignRequest($campaign_id) ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/{campaignID}'; $formParams = []; $queryParams = []; @@ -6483,16 +8090,11 @@ public function restoreStaticVoucherCampaignRequest($campaign_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -6510,12 +8112,12 @@ public function restoreStaticVoucherCampaignRequest($campaign_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6531,10 +8133,11 @@ public function restoreStaticVoucherCampaignRequest($campaign_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6547,14 +8150,15 @@ public function restoreStaticVoucherCampaignRequest($campaign_id) * * @param mixed $campaign_id campaign_id (required) * @param \OpenAPI\Client\Model\StaticVoucherCampaignUpdate $static_voucher_campaign_update static_voucher_campaign_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateStaticVoucherCampaign($campaign_id, $static_voucher_campaign_update) + public function updateStaticVoucherCampaign($campaign_id, $static_voucher_campaign_update, string $contentType = self::contentTypes['updateStaticVoucherCampaign'][0]) { - list($response) = $this->updateStaticVoucherCampaignWithHttpInfo($campaign_id, $static_voucher_campaign_update); + list($response) = $this->updateStaticVoucherCampaignWithHttpInfo($campaign_id, $static_voucher_campaign_update, $contentType); return $response; } @@ -6565,14 +8169,15 @@ public function updateStaticVoucherCampaign($campaign_id, $static_voucher_campai * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\StaticVoucherCampaignUpdate $static_voucher_campaign_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucherCampaign'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateStaticVoucherCampaignWithHttpInfo($campaign_id, $static_voucher_campaign_update) + public function updateStaticVoucherCampaignWithHttpInfo($campaign_id, $static_voucher_campaign_update, string $contentType = self::contentTypes['updateStaticVoucherCampaign'][0]) { - $request = $this->updateStaticVoucherCampaignRequest($campaign_id, $static_voucher_campaign_update); + $request = $this->updateStaticVoucherCampaignRequest($campaign_id, $static_voucher_campaign_update, $contentType); try { $options = $this->createHttpClientOption(); @@ -6615,6 +8220,21 @@ public function updateStaticVoucherCampaignWithHttpInfo($campaign_id, $static_vo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucherCampaign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6627,6 +8247,21 @@ public function updateStaticVoucherCampaignWithHttpInfo($campaign_id, $static_vo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6639,6 +8274,21 @@ public function updateStaticVoucherCampaignWithHttpInfo($campaign_id, $static_vo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6651,6 +8301,21 @@ public function updateStaticVoucherCampaignWithHttpInfo($campaign_id, $static_vo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6665,6 +8330,21 @@ public function updateStaticVoucherCampaignWithHttpInfo($campaign_id, $static_vo $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6719,13 +8399,14 @@ public function updateStaticVoucherCampaignWithHttpInfo($campaign_id, $static_vo * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\StaticVoucherCampaignUpdate $static_voucher_campaign_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStaticVoucherCampaignAsync($campaign_id, $static_voucher_campaign_update) + public function updateStaticVoucherCampaignAsync($campaign_id, $static_voucher_campaign_update, string $contentType = self::contentTypes['updateStaticVoucherCampaign'][0]) { - return $this->updateStaticVoucherCampaignAsyncWithHttpInfo($campaign_id, $static_voucher_campaign_update) + return $this->updateStaticVoucherCampaignAsyncWithHttpInfo($campaign_id, $static_voucher_campaign_update, $contentType) ->then( function ($response) { return $response[0]; @@ -6740,14 +8421,15 @@ function ($response) { * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\StaticVoucherCampaignUpdate $static_voucher_campaign_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStaticVoucherCampaignAsyncWithHttpInfo($campaign_id, $static_voucher_campaign_update) + public function updateStaticVoucherCampaignAsyncWithHttpInfo($campaign_id, $static_voucher_campaign_update, string $contentType = self::contentTypes['updateStaticVoucherCampaign'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucherCampaign'; - $request = $this->updateStaticVoucherCampaignRequest($campaign_id, $static_voucher_campaign_update); + $request = $this->updateStaticVoucherCampaignRequest($campaign_id, $static_voucher_campaign_update, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6757,6 +8439,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -6787,18 +8472,21 @@ function ($exception) { * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\StaticVoucherCampaignUpdate $static_voucher_campaign_update (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucherCampaign'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateStaticVoucherCampaignRequest($campaign_id, $static_voucher_campaign_update) + public function updateStaticVoucherCampaignRequest($campaign_id, $static_voucher_campaign_update, string $contentType = self::contentTypes['updateStaticVoucherCampaign'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaign_id when calling updateStaticVoucherCampaign' ); } + // verify the required parameter 'static_voucher_campaign_update' is set if ($static_voucher_campaign_update === null || (is_array($static_voucher_campaign_update) && count($static_voucher_campaign_update) === 0)) { throw new \InvalidArgumentException( @@ -6806,6 +8494,7 @@ public function updateStaticVoucherCampaignRequest($campaign_id, $static_voucher ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/{campaignID}'; $formParams = []; $queryParams = []; @@ -6825,21 +8514,17 @@ public function updateStaticVoucherCampaignRequest($campaign_id, $static_voucher } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($static_voucher_campaign_update)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($static_voucher_campaign_update)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($static_voucher_campaign_update)); } else { $httpBody = $static_voucher_campaign_update; } @@ -6858,12 +8543,12 @@ public function updateStaticVoucherCampaignRequest($campaign_id, $static_voucher // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -6879,10 +8564,11 @@ public function updateStaticVoucherCampaignRequest($campaign_id, $static_voucher $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -6895,14 +8581,15 @@ public function updateStaticVoucherCampaignRequest($campaign_id, $static_voucher * * @param mixed $campaign_id campaign_id (required) * @param \OpenAPI\Client\Model\UpdateStaticVoucherCampaignWithVoucher $update_static_voucher_campaign_with_voucher update_static_voucher_campaign_with_voucher (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucherCampaignWithVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateStaticVoucherCampaignWithVoucher($campaign_id, $update_static_voucher_campaign_with_voucher) + public function updateStaticVoucherCampaignWithVoucher($campaign_id, $update_static_voucher_campaign_with_voucher, string $contentType = self::contentTypes['updateStaticVoucherCampaignWithVoucher'][0]) { - list($response) = $this->updateStaticVoucherCampaignWithVoucherWithHttpInfo($campaign_id, $update_static_voucher_campaign_with_voucher); + list($response) = $this->updateStaticVoucherCampaignWithVoucherWithHttpInfo($campaign_id, $update_static_voucher_campaign_with_voucher, $contentType); return $response; } @@ -6913,14 +8600,15 @@ public function updateStaticVoucherCampaignWithVoucher($campaign_id, $update_sta * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\UpdateStaticVoucherCampaignWithVoucher $update_static_voucher_campaign_with_voucher (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucherCampaignWithVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucherCampaign|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateStaticVoucherCampaignWithVoucherWithHttpInfo($campaign_id, $update_static_voucher_campaign_with_voucher) + public function updateStaticVoucherCampaignWithVoucherWithHttpInfo($campaign_id, $update_static_voucher_campaign_with_voucher, string $contentType = self::contentTypes['updateStaticVoucherCampaignWithVoucher'][0]) { - $request = $this->updateStaticVoucherCampaignWithVoucherRequest($campaign_id, $update_static_voucher_campaign_with_voucher); + $request = $this->updateStaticVoucherCampaignWithVoucherRequest($campaign_id, $update_static_voucher_campaign_with_voucher, $contentType); try { $options = $this->createHttpClientOption(); @@ -6963,6 +8651,21 @@ public function updateStaticVoucherCampaignWithVoucherWithHttpInfo($campaign_id, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucherCampaign' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6975,6 +8678,21 @@ public function updateStaticVoucherCampaignWithVoucherWithHttpInfo($campaign_id, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6987,6 +8705,21 @@ public function updateStaticVoucherCampaignWithVoucherWithHttpInfo($campaign_id, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -6999,6 +8732,21 @@ public function updateStaticVoucherCampaignWithVoucherWithHttpInfo($campaign_id, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7013,6 +8761,21 @@ public function updateStaticVoucherCampaignWithVoucherWithHttpInfo($campaign_id, $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -7067,13 +8830,14 @@ public function updateStaticVoucherCampaignWithVoucherWithHttpInfo($campaign_id, * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\UpdateStaticVoucherCampaignWithVoucher $update_static_voucher_campaign_with_voucher (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucherCampaignWithVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStaticVoucherCampaignWithVoucherAsync($campaign_id, $update_static_voucher_campaign_with_voucher) + public function updateStaticVoucherCampaignWithVoucherAsync($campaign_id, $update_static_voucher_campaign_with_voucher, string $contentType = self::contentTypes['updateStaticVoucherCampaignWithVoucher'][0]) { - return $this->updateStaticVoucherCampaignWithVoucherAsyncWithHttpInfo($campaign_id, $update_static_voucher_campaign_with_voucher) + return $this->updateStaticVoucherCampaignWithVoucherAsyncWithHttpInfo($campaign_id, $update_static_voucher_campaign_with_voucher, $contentType) ->then( function ($response) { return $response[0]; @@ -7088,14 +8852,15 @@ function ($response) { * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\UpdateStaticVoucherCampaignWithVoucher $update_static_voucher_campaign_with_voucher (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucherCampaignWithVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStaticVoucherCampaignWithVoucherAsyncWithHttpInfo($campaign_id, $update_static_voucher_campaign_with_voucher) + public function updateStaticVoucherCampaignWithVoucherAsyncWithHttpInfo($campaign_id, $update_static_voucher_campaign_with_voucher, string $contentType = self::contentTypes['updateStaticVoucherCampaignWithVoucher'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucherCampaign'; - $request = $this->updateStaticVoucherCampaignWithVoucherRequest($campaign_id, $update_static_voucher_campaign_with_voucher); + $request = $this->updateStaticVoucherCampaignWithVoucherRequest($campaign_id, $update_static_voucher_campaign_with_voucher, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7105,6 +8870,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -7135,18 +8903,21 @@ function ($exception) { * * @param mixed $campaign_id (required) * @param \OpenAPI\Client\Model\UpdateStaticVoucherCampaignWithVoucher $update_static_voucher_campaign_with_voucher (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucherCampaignWithVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateStaticVoucherCampaignWithVoucherRequest($campaign_id, $update_static_voucher_campaign_with_voucher) + public function updateStaticVoucherCampaignWithVoucherRequest($campaign_id, $update_static_voucher_campaign_with_voucher, string $contentType = self::contentTypes['updateStaticVoucherCampaignWithVoucher'][0]) { + // verify the required parameter 'campaign_id' is set if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $campaign_id when calling updateStaticVoucherCampaignWithVoucher' ); } + // verify the required parameter 'update_static_voucher_campaign_with_voucher' is set if ($update_static_voucher_campaign_with_voucher === null || (is_array($update_static_voucher_campaign_with_voucher) && count($update_static_voucher_campaign_with_voucher) === 0)) { throw new \InvalidArgumentException( @@ -7154,6 +8925,7 @@ public function updateStaticVoucherCampaignWithVoucherRequest($campaign_id, $upd ); } + $resourcePath = '/v2/payment/staticVoucherCampaign/voucher/{campaignID}'; $formParams = []; $queryParams = []; @@ -7173,21 +8945,17 @@ public function updateStaticVoucherCampaignWithVoucherRequest($campaign_id, $upd } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($update_static_voucher_campaign_with_voucher)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_static_voucher_campaign_with_voucher)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_static_voucher_campaign_with_voucher)); } else { $httpBody = $update_static_voucher_campaign_with_voucher; } @@ -7206,12 +8974,12 @@ public function updateStaticVoucherCampaignWithVoucherRequest($campaign_id, $upd // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -7227,10 +8995,11 @@ public function updateStaticVoucherCampaignWithVoucherRequest($campaign_id, $upd $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/StaticVouchersApi.php b/lib/Api/StaticVouchersApi.php index 0f737d6..70e99b7 100644 --- a/lib/Api/StaticVouchersApi.php +++ b/lib/Api/StaticVouchersApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'deleteStaticVoucher' => [ + 'application/json', + ], + 'fetchReachStatsOfAllStaticVouchers' => [ + 'application/json', + ], + 'fetchReachStatsOfIndividualStaticVoucher' => [ + 'application/json', + ], + 'fetchStaticVoucher' => [ + 'application/json', + ], + 'updateStaticVoucher' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +144,15 @@ public function getConfig() * Create static voucher * * @param \OpenAPI\Client\Model\WTStaticVoucherCreateParams $wt_static_voucher_create_params wt_static_voucher_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError */ - public function createStaticVoucher($wt_static_voucher_create_params) + public function createStaticVoucher($wt_static_voucher_create_params, string $contentType = self::contentTypes['createStaticVoucher'][0]) { - list($response) = $this->createStaticVoucherWithHttpInfo($wt_static_voucher_create_params); + list($response) = $this->createStaticVoucherWithHttpInfo($wt_static_voucher_create_params, $contentType); return $response; } @@ -139,14 +162,15 @@ public function createStaticVoucher($wt_static_voucher_create_params) * Create static voucher * * @param \OpenAPI\Client\Model\WTStaticVoucherCreateParams $wt_static_voucher_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\MerchantNotInitialized|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createStaticVoucherWithHttpInfo($wt_static_voucher_create_params) + public function createStaticVoucherWithHttpInfo($wt_static_voucher_create_params, string $contentType = self::contentTypes['createStaticVoucher'][0]) { - $request = $this->createStaticVoucherRequest($wt_static_voucher_create_params); + $request = $this->createStaticVoucherRequest($wt_static_voucher_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +213,21 @@ public function createStaticVoucherWithHttpInfo($wt_static_voucher_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucher' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +240,21 @@ public function createStaticVoucherWithHttpInfo($wt_static_voucher_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +267,21 @@ public function createStaticVoucherWithHttpInfo($wt_static_voucher_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +294,21 @@ public function createStaticVoucherWithHttpInfo($wt_static_voucher_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -237,6 +321,21 @@ public function createStaticVoucherWithHttpInfo($wt_static_voucher_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\MerchantNotInitialized' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -249,6 +348,21 @@ public function createStaticVoucherWithHttpInfo($wt_static_voucher_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -263,6 +377,21 @@ public function createStaticVoucherWithHttpInfo($wt_static_voucher_create_params $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -332,13 +461,14 @@ public function createStaticVoucherWithHttpInfo($wt_static_voucher_create_params * Create static voucher * * @param \OpenAPI\Client\Model\WTStaticVoucherCreateParams $wt_static_voucher_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStaticVoucherAsync($wt_static_voucher_create_params) + public function createStaticVoucherAsync($wt_static_voucher_create_params, string $contentType = self::contentTypes['createStaticVoucher'][0]) { - return $this->createStaticVoucherAsyncWithHttpInfo($wt_static_voucher_create_params) + return $this->createStaticVoucherAsyncWithHttpInfo($wt_static_voucher_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -352,14 +482,15 @@ function ($response) { * Create static voucher * * @param \OpenAPI\Client\Model\WTStaticVoucherCreateParams $wt_static_voucher_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createStaticVoucherAsyncWithHttpInfo($wt_static_voucher_create_params) + public function createStaticVoucherAsyncWithHttpInfo($wt_static_voucher_create_params, string $contentType = self::contentTypes['createStaticVoucher'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucher'; - $request = $this->createStaticVoucherRequest($wt_static_voucher_create_params); + $request = $this->createStaticVoucherRequest($wt_static_voucher_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -369,6 +500,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -398,12 +532,14 @@ function ($exception) { * Create request for operation 'createStaticVoucher' * * @param \OpenAPI\Client\Model\WTStaticVoucherCreateParams $wt_static_voucher_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createStaticVoucherRequest($wt_static_voucher_create_params) + public function createStaticVoucherRequest($wt_static_voucher_create_params, string $contentType = self::contentTypes['createStaticVoucher'][0]) { + // verify the required parameter 'wt_static_voucher_create_params' is set if ($wt_static_voucher_create_params === null || (is_array($wt_static_voucher_create_params) && count($wt_static_voucher_create_params) === 0)) { throw new \InvalidArgumentException( @@ -411,6 +547,7 @@ public function createStaticVoucherRequest($wt_static_voucher_create_params) ); } + $resourcePath = '/v2/payment/staticVoucher'; $formParams = []; $queryParams = []; @@ -422,21 +559,17 @@ public function createStaticVoucherRequest($wt_static_voucher_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_static_voucher_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_static_voucher_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_static_voucher_create_params)); } else { $httpBody = $wt_static_voucher_create_params; } @@ -455,12 +588,12 @@ public function createStaticVoucherRequest($wt_static_voucher_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -476,10 +609,11 @@ public function createStaticVoucherRequest($wt_static_voucher_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -491,14 +625,15 @@ public function createStaticVoucherRequest($wt_static_voucher_create_params) * Delete static voucher * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteStaticVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function deleteStaticVoucher($id) + public function deleteStaticVoucher($id, string $contentType = self::contentTypes['deleteStaticVoucher'][0]) { - list($response) = $this->deleteStaticVoucherWithHttpInfo($id); + list($response) = $this->deleteStaticVoucherWithHttpInfo($id, $contentType); return $response; } @@ -508,14 +643,15 @@ public function deleteStaticVoucher($id) * Delete static voucher * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteStaticVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function deleteStaticVoucherWithHttpInfo($id) + public function deleteStaticVoucherWithHttpInfo($id, string $contentType = self::contentTypes['deleteStaticVoucher'][0]) { - $request = $this->deleteStaticVoucherRequest($id); + $request = $this->deleteStaticVoucherRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -558,6 +694,21 @@ public function deleteStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +721,21 @@ public function deleteStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -582,6 +748,21 @@ public function deleteStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -594,6 +775,21 @@ public function deleteStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -606,6 +802,21 @@ public function deleteStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -618,6 +829,21 @@ public function deleteStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -632,6 +858,21 @@ public function deleteStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -701,13 +942,14 @@ public function deleteStaticVoucherWithHttpInfo($id) * Delete static voucher * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteStaticVoucherAsync($id) + public function deleteStaticVoucherAsync($id, string $contentType = self::contentTypes['deleteStaticVoucher'][0]) { - return $this->deleteStaticVoucherAsyncWithHttpInfo($id) + return $this->deleteStaticVoucherAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -721,14 +963,15 @@ function ($response) { * Delete static voucher * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteStaticVoucherAsyncWithHttpInfo($id) + public function deleteStaticVoucherAsyncWithHttpInfo($id, string $contentType = self::contentTypes['deleteStaticVoucher'][0]) { $returnType = 'bool'; - $request = $this->deleteStaticVoucherRequest($id); + $request = $this->deleteStaticVoucherRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -738,6 +981,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -767,12 +1013,14 @@ function ($exception) { * Create request for operation 'deleteStaticVoucher' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteStaticVoucherRequest($id) + public function deleteStaticVoucherRequest($id, string $contentType = self::contentTypes['deleteStaticVoucher'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -780,6 +1028,7 @@ public function deleteStaticVoucherRequest($id) ); } + $resourcePath = '/v2/payment/staticVoucher/{id}'; $formParams = []; $queryParams = []; @@ -799,16 +1048,11 @@ public function deleteStaticVoucherRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -826,12 +1070,12 @@ public function deleteStaticVoucherRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -847,10 +1091,11 @@ public function deleteStaticVoucherRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -863,14 +1108,15 @@ public function deleteStaticVoucherRequest($id) * * @param \DateTime $broadcast_scheduled_start_at broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllStaticVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchReachStatsOfAllStaticVouchers($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllStaticVouchers($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllStaticVouchers'][0]) { - list($response) = $this->fetchReachStatsOfAllStaticVouchersWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + list($response) = $this->fetchReachStatsOfAllStaticVouchersWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $response; } @@ -881,14 +1127,15 @@ public function fetchReachStatsOfAllStaticVouchers($broadcast_scheduled_start_at * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllStaticVouchers'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchReachStatsOfAllStaticVouchersWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllStaticVouchersWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllStaticVouchers'][0]) { - $request = $this->fetchReachStatsOfAllStaticVouchersRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfAllStaticVouchersRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); try { $options = $this->createHttpClientOption(); @@ -931,6 +1178,21 @@ public function fetchReachStatsOfAllStaticVouchersWithHttpInfo($broadcast_schedu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ReachPerformanceStats' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -943,6 +1205,21 @@ public function fetchReachStatsOfAllStaticVouchersWithHttpInfo($broadcast_schedu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -955,6 +1232,21 @@ public function fetchReachStatsOfAllStaticVouchersWithHttpInfo($broadcast_schedu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -967,6 +1259,21 @@ public function fetchReachStatsOfAllStaticVouchersWithHttpInfo($broadcast_schedu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -981,6 +1288,21 @@ public function fetchReachStatsOfAllStaticVouchersWithHttpInfo($broadcast_schedu $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1035,13 +1357,14 @@ public function fetchReachStatsOfAllStaticVouchersWithHttpInfo($broadcast_schedu * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfAllStaticVouchersAsync($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllStaticVouchersAsync($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllStaticVouchers'][0]) { - return $this->fetchReachStatsOfAllStaticVouchersAsyncWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at) + return $this->fetchReachStatsOfAllStaticVouchersAsyncWithHttpInfo($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType) ->then( function ($response) { return $response[0]; @@ -1056,14 +1379,15 @@ function ($response) { * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfAllStaticVouchersAsyncWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllStaticVouchersAsyncWithHttpInfo($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllStaticVouchers'][0]) { $returnType = '\OpenAPI\Client\Model\ReachPerformanceStats'; - $request = $this->fetchReachStatsOfAllStaticVouchersRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfAllStaticVouchersRequest($broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1073,6 +1397,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1103,13 +1430,17 @@ function ($exception) { * * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfAllStaticVouchers'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchReachStatsOfAllStaticVouchersRequest($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfAllStaticVouchersRequest($broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfAllStaticVouchers'][0]) { + + + $resourcePath = '/v2/payment/staticVoucher/reach/all'; $formParams = []; $queryParams = []; @@ -1118,41 +1449,32 @@ public function fetchReachStatsOfAllStaticVouchersRequest($broadcast_scheduled_s $multipart = false; // query params - if ($broadcast_scheduled_start_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_start_at)) { - foreach($broadcast_scheduled_start_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledStartAt'] = $broadcast_scheduled_start_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_start_at, + 'broadcastScheduledStartAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($broadcast_scheduled_end_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_end_at)) { - foreach($broadcast_scheduled_end_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledEndAt'] = $broadcast_scheduled_end_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_end_at, + 'broadcastScheduledEndAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1170,12 +1492,12 @@ public function fetchReachStatsOfAllStaticVouchersRequest($broadcast_scheduled_s // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1191,10 +1513,11 @@ public function fetchReachStatsOfAllStaticVouchersRequest($broadcast_scheduled_s $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1208,14 +1531,15 @@ public function fetchReachStatsOfAllStaticVouchersRequest($broadcast_scheduled_s * @param mixed $static_voucher_id static_voucher_id (required) * @param \DateTime $broadcast_scheduled_start_at broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualStaticVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchReachStatsOfIndividualStaticVoucher($static_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualStaticVoucher($static_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualStaticVoucher'][0]) { - list($response) = $this->fetchReachStatsOfIndividualStaticVoucherWithHttpInfo($static_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + list($response) = $this->fetchReachStatsOfIndividualStaticVoucherWithHttpInfo($static_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $response; } @@ -1227,14 +1551,15 @@ public function fetchReachStatsOfIndividualStaticVoucher($static_voucher_id, $br * @param mixed $static_voucher_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualStaticVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ReachPerformanceStats|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchReachStatsOfIndividualStaticVoucherWithHttpInfo($static_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualStaticVoucherWithHttpInfo($static_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualStaticVoucher'][0]) { - $request = $this->fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); try { $options = $this->createHttpClientOption(); @@ -1277,6 +1602,21 @@ public function fetchReachStatsOfIndividualStaticVoucherWithHttpInfo($static_vou $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ReachPerformanceStats' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1289,6 +1629,21 @@ public function fetchReachStatsOfIndividualStaticVoucherWithHttpInfo($static_vou $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1301,6 +1656,21 @@ public function fetchReachStatsOfIndividualStaticVoucherWithHttpInfo($static_vou $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1313,6 +1683,21 @@ public function fetchReachStatsOfIndividualStaticVoucherWithHttpInfo($static_vou $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1327,6 +1712,21 @@ public function fetchReachStatsOfIndividualStaticVoucherWithHttpInfo($static_vou $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1382,13 +1782,14 @@ public function fetchReachStatsOfIndividualStaticVoucherWithHttpInfo($static_vou * @param mixed $static_voucher_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfIndividualStaticVoucherAsync($static_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualStaticVoucherAsync($static_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualStaticVoucher'][0]) { - return $this->fetchReachStatsOfIndividualStaticVoucherAsyncWithHttpInfo($static_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at) + return $this->fetchReachStatsOfIndividualStaticVoucherAsyncWithHttpInfo($static_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType) ->then( function ($response) { return $response[0]; @@ -1404,14 +1805,15 @@ function ($response) { * @param mixed $static_voucher_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchReachStatsOfIndividualStaticVoucherAsyncWithHttpInfo($static_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualStaticVoucherAsyncWithHttpInfo($static_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualStaticVoucher'][0]) { $returnType = '\OpenAPI\Client\Model\ReachPerformanceStats'; - $request = $this->fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at); + $request = $this->fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_id, $broadcast_scheduled_start_at, $broadcast_scheduled_end_at, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1421,6 +1823,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1452,12 +1857,14 @@ function ($exception) { * @param mixed $static_voucher_id (required) * @param \DateTime $broadcast_scheduled_start_at (optional) * @param \DateTime $broadcast_scheduled_end_at (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchReachStatsOfIndividualStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null) + public function fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_id, $broadcast_scheduled_start_at = null, $broadcast_scheduled_end_at = null, string $contentType = self::contentTypes['fetchReachStatsOfIndividualStaticVoucher'][0]) { + // verify the required parameter 'static_voucher_id' is set if ($static_voucher_id === null || (is_array($static_voucher_id) && count($static_voucher_id) === 0)) { throw new \InvalidArgumentException( @@ -1465,6 +1872,9 @@ public function fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_ ); } + + + $resourcePath = '/v2/payment/staticVoucher/reach/{staticVoucherID}'; $formParams = []; $queryParams = []; @@ -1473,27 +1883,23 @@ public function fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_ $multipart = false; // query params - if ($broadcast_scheduled_start_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_start_at)) { - foreach($broadcast_scheduled_start_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledStartAt'] = $broadcast_scheduled_start_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_start_at, + 'broadcastScheduledStartAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // query params - if ($broadcast_scheduled_end_at !== null) { - if('form' === 'form' && is_array($broadcast_scheduled_end_at)) { - foreach($broadcast_scheduled_end_at as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['broadcastScheduledEndAt'] = $broadcast_scheduled_end_at; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $broadcast_scheduled_end_at, + 'broadcastScheduledEndAt', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -1506,16 +1912,11 @@ public function fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_ } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1533,12 +1934,12 @@ public function fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1554,10 +1955,11 @@ public function fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1569,14 +1971,15 @@ public function fetchReachStatsOfIndividualStaticVoucherRequest($static_voucher_ * Fetch static voucher * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function fetchStaticVoucher($id) + public function fetchStaticVoucher($id, string $contentType = self::contentTypes['fetchStaticVoucher'][0]) { - list($response) = $this->fetchStaticVoucherWithHttpInfo($id); + list($response) = $this->fetchStaticVoucherWithHttpInfo($id, $contentType); return $response; } @@ -1586,14 +1989,15 @@ public function fetchStaticVoucher($id) * Fetch static voucher * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchStaticVoucherWithHttpInfo($id) + public function fetchStaticVoucherWithHttpInfo($id, string $contentType = self::contentTypes['fetchStaticVoucher'][0]) { - $request = $this->fetchStaticVoucherRequest($id); + $request = $this->fetchStaticVoucherRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1636,6 +2040,21 @@ public function fetchStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucher' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1648,6 +2067,21 @@ public function fetchStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1660,6 +2094,21 @@ public function fetchStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1672,6 +2121,21 @@ public function fetchStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1684,6 +2148,21 @@ public function fetchStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1698,6 +2177,21 @@ public function fetchStaticVoucherWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1759,13 +2253,14 @@ public function fetchStaticVoucherWithHttpInfo($id) * Fetch static voucher * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherAsync($id) + public function fetchStaticVoucherAsync($id, string $contentType = self::contentTypes['fetchStaticVoucher'][0]) { - return $this->fetchStaticVoucherAsyncWithHttpInfo($id) + return $this->fetchStaticVoucherAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1779,14 +2274,15 @@ function ($response) { * Fetch static voucher * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchStaticVoucherAsyncWithHttpInfo($id) + public function fetchStaticVoucherAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchStaticVoucher'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucher'; - $request = $this->fetchStaticVoucherRequest($id); + $request = $this->fetchStaticVoucherRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1796,6 +2292,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1825,12 +2324,14 @@ function ($exception) { * Create request for operation 'fetchStaticVoucher' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchStaticVoucherRequest($id) + public function fetchStaticVoucherRequest($id, string $contentType = self::contentTypes['fetchStaticVoucher'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1838,6 +2339,7 @@ public function fetchStaticVoucherRequest($id) ); } + $resourcePath = '/v2/payment/staticVoucher/{id}'; $formParams = []; $queryParams = []; @@ -1857,16 +2359,11 @@ public function fetchStaticVoucherRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1884,12 +2381,12 @@ public function fetchStaticVoucherRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1905,10 +2402,11 @@ public function fetchStaticVoucherRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1921,14 +2419,15 @@ public function fetchStaticVoucherRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherUpdateParams $wt_static_voucher_update_params wt_static_voucher_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTStaticVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function updateStaticVoucher($id, $wt_static_voucher_update_params) + public function updateStaticVoucher($id, $wt_static_voucher_update_params, string $contentType = self::contentTypes['updateStaticVoucher'][0]) { - list($response) = $this->updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_params); + list($response) = $this->updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_params, $contentType); return $response; } @@ -1939,14 +2438,15 @@ public function updateStaticVoucher($id, $wt_static_voucher_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherUpdateParams $wt_static_voucher_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucher'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTStaticVoucher|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\DuplicateRowFound|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_params) + public function updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_params, string $contentType = self::contentTypes['updateStaticVoucher'][0]) { - $request = $this->updateStaticVoucherRequest($id, $wt_static_voucher_update_params); + $request = $this->updateStaticVoucherRequest($id, $wt_static_voucher_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1989,6 +2489,21 @@ public function updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTStaticVoucher' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2001,6 +2516,21 @@ public function updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2013,6 +2543,21 @@ public function updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\DuplicateRowFound' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2025,6 +2570,21 @@ public function updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2037,6 +2597,21 @@ public function updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2049,6 +2624,21 @@ public function updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2063,6 +2653,21 @@ public function updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_p $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2133,13 +2738,14 @@ public function updateStaticVoucherWithHttpInfo($id, $wt_static_voucher_update_p * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherUpdateParams $wt_static_voucher_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStaticVoucherAsync($id, $wt_static_voucher_update_params) + public function updateStaticVoucherAsync($id, $wt_static_voucher_update_params, string $contentType = self::contentTypes['updateStaticVoucher'][0]) { - return $this->updateStaticVoucherAsyncWithHttpInfo($id, $wt_static_voucher_update_params) + return $this->updateStaticVoucherAsyncWithHttpInfo($id, $wt_static_voucher_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -2154,14 +2760,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherUpdateParams $wt_static_voucher_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateStaticVoucherAsyncWithHttpInfo($id, $wt_static_voucher_update_params) + public function updateStaticVoucherAsyncWithHttpInfo($id, $wt_static_voucher_update_params, string $contentType = self::contentTypes['updateStaticVoucher'][0]) { $returnType = '\OpenAPI\Client\Model\WTStaticVoucher'; - $request = $this->updateStaticVoucherRequest($id, $wt_static_voucher_update_params); + $request = $this->updateStaticVoucherRequest($id, $wt_static_voucher_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2171,6 +2778,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2201,18 +2811,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTStaticVoucherUpdateParams $wt_static_voucher_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateStaticVoucher'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateStaticVoucherRequest($id, $wt_static_voucher_update_params) + public function updateStaticVoucherRequest($id, $wt_static_voucher_update_params, string $contentType = self::contentTypes['updateStaticVoucher'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateStaticVoucher' ); } + // verify the required parameter 'wt_static_voucher_update_params' is set if ($wt_static_voucher_update_params === null || (is_array($wt_static_voucher_update_params) && count($wt_static_voucher_update_params) === 0)) { throw new \InvalidArgumentException( @@ -2220,6 +2833,7 @@ public function updateStaticVoucherRequest($id, $wt_static_voucher_update_params ); } + $resourcePath = '/v2/payment/staticVoucher/{id}'; $formParams = []; $queryParams = []; @@ -2239,21 +2853,17 @@ public function updateStaticVoucherRequest($id, $wt_static_voucher_update_params } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_static_voucher_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_static_voucher_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_static_voucher_update_params)); } else { $httpBody = $wt_static_voucher_update_params; } @@ -2272,12 +2882,12 @@ public function updateStaticVoucherRequest($id, $wt_static_voucher_update_params // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2293,10 +2903,11 @@ public function updateStaticVoucherRequest($id, $wt_static_voucher_update_params $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/SystemApi.php b/lib/Api/SystemApi.php index debe17a..4b0788c 100644 --- a/lib/Api/SystemApi.php +++ b/lib/Api/SystemApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'deleteRole' => [ + 'application/json', + ], + 'fetchAuditLogOfRoles' => [ + 'application/json', + ], + 'fetchEmployeesWithRole' => [ + 'application/json', + ], + 'fetchWebpagesForRole' => [ + 'application/json', + ], + 'getPaymentPrefixes' => [ + 'application/json', + ], + 'loadRole' => [ + 'application/json', + ], + 'saveRole' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +150,15 @@ public function getConfig() * Create role * * @param \OpenAPI\Client\Model\WTSystemRoleCreate $wt_system_role_create wt_system_role_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Role|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createRole($wt_system_role_create) + public function createRole($wt_system_role_create, string $contentType = self::contentTypes['createRole'][0]) { - list($response) = $this->createRoleWithHttpInfo($wt_system_role_create); + list($response) = $this->createRoleWithHttpInfo($wt_system_role_create, $contentType); return $response; } @@ -139,14 +168,15 @@ public function createRole($wt_system_role_create) * Create role * * @param \OpenAPI\Client\Model\WTSystemRoleCreate $wt_system_role_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Role|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createRoleWithHttpInfo($wt_system_role_create) + public function createRoleWithHttpInfo($wt_system_role_create, string $contentType = self::contentTypes['createRole'][0]) { - $request = $this->createRoleRequest($wt_system_role_create); + $request = $this->createRoleRequest($wt_system_role_create, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +219,21 @@ public function createRoleWithHttpInfo($wt_system_role_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Role' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +246,21 @@ public function createRoleWithHttpInfo($wt_system_role_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +273,21 @@ public function createRoleWithHttpInfo($wt_system_role_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +300,21 @@ public function createRoleWithHttpInfo($wt_system_role_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +329,21 @@ public function createRoleWithHttpInfo($wt_system_role_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +397,14 @@ public function createRoleWithHttpInfo($wt_system_role_create) * Create role * * @param \OpenAPI\Client\Model\WTSystemRoleCreate $wt_system_role_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createRoleAsync($wt_system_role_create) + public function createRoleAsync($wt_system_role_create, string $contentType = self::contentTypes['createRole'][0]) { - return $this->createRoleAsyncWithHttpInfo($wt_system_role_create) + return $this->createRoleAsyncWithHttpInfo($wt_system_role_create, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +418,15 @@ function ($response) { * Create role * * @param \OpenAPI\Client\Model\WTSystemRoleCreate $wt_system_role_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createRoleAsyncWithHttpInfo($wt_system_role_create) + public function createRoleAsyncWithHttpInfo($wt_system_role_create, string $contentType = self::contentTypes['createRole'][0]) { $returnType = '\OpenAPI\Client\Model\Role'; - $request = $this->createRoleRequest($wt_system_role_create); + $request = $this->createRoleRequest($wt_system_role_create, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +436,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +468,14 @@ function ($exception) { * Create request for operation 'createRole' * * @param \OpenAPI\Client\Model\WTSystemRoleCreate $wt_system_role_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createRoleRequest($wt_system_role_create) + public function createRoleRequest($wt_system_role_create, string $contentType = self::contentTypes['createRole'][0]) { + // verify the required parameter 'wt_system_role_create' is set if ($wt_system_role_create === null || (is_array($wt_system_role_create) && count($wt_system_role_create) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +483,7 @@ public function createRoleRequest($wt_system_role_create) ); } + $resourcePath = '/v2/system/roles'; $formParams = []; $queryParams = []; @@ -382,21 +495,17 @@ public function createRoleRequest($wt_system_role_create) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_system_role_create)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_system_role_create)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_system_role_create)); } else { $httpBody = $wt_system_role_create; } @@ -415,12 +524,12 @@ public function createRoleRequest($wt_system_role_create) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -436,10 +545,11 @@ public function createRoleRequest($wt_system_role_create) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -451,14 +561,15 @@ public function createRoleRequest($wt_system_role_create) * Delete role * * @param string $role_id role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function deleteRole($role_id) + public function deleteRole($role_id, string $contentType = self::contentTypes['deleteRole'][0]) { - list($response) = $this->deleteRoleWithHttpInfo($role_id); + list($response) = $this->deleteRoleWithHttpInfo($role_id, $contentType); return $response; } @@ -468,14 +579,15 @@ public function deleteRole($role_id) * Delete role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of bool|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function deleteRoleWithHttpInfo($role_id) + public function deleteRoleWithHttpInfo($role_id, string $contentType = self::contentTypes['deleteRole'][0]) { - $request = $this->deleteRoleRequest($role_id); + $request = $this->deleteRoleRequest($role_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -518,6 +630,21 @@ public function deleteRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('bool' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -530,6 +657,21 @@ public function deleteRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -542,6 +684,21 @@ public function deleteRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -554,6 +711,21 @@ public function deleteRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -568,6 +740,21 @@ public function deleteRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -621,13 +808,14 @@ public function deleteRoleWithHttpInfo($role_id) * Delete role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteRoleAsync($role_id) + public function deleteRoleAsync($role_id, string $contentType = self::contentTypes['deleteRole'][0]) { - return $this->deleteRoleAsyncWithHttpInfo($role_id) + return $this->deleteRoleAsyncWithHttpInfo($role_id, $contentType) ->then( function ($response) { return $response[0]; @@ -641,14 +829,15 @@ function ($response) { * Delete role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteRoleAsyncWithHttpInfo($role_id) + public function deleteRoleAsyncWithHttpInfo($role_id, string $contentType = self::contentTypes['deleteRole'][0]) { $returnType = 'bool'; - $request = $this->deleteRoleRequest($role_id); + $request = $this->deleteRoleRequest($role_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -658,6 +847,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -687,12 +879,14 @@ function ($exception) { * Create request for operation 'deleteRole' * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['deleteRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function deleteRoleRequest($role_id) + public function deleteRoleRequest($role_id, string $contentType = self::contentTypes['deleteRole'][0]) { + // verify the required parameter 'role_id' is set if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { throw new \InvalidArgumentException( @@ -708,7 +902,7 @@ public function deleteRoleRequest($role_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $role_id)) { throw new \InvalidArgumentException("invalid value for \"role_id\" when calling SystemApi.deleteRole, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/system/roles/{roleID}'; $formParams = []; @@ -729,16 +923,11 @@ public function deleteRoleRequest($role_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -756,12 +945,12 @@ public function deleteRoleRequest($role_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -777,10 +966,11 @@ public function deleteRoleRequest($role_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -793,14 +983,15 @@ public function deleteRoleRequest($role_id) * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAuditLogOfRoles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\RoleAuditLog[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAuditLogOfRoles($start_date_time, $end_date_time) + public function fetchAuditLogOfRoles($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchAuditLogOfRoles'][0]) { - list($response) = $this->fetchAuditLogOfRolesWithHttpInfo($start_date_time, $end_date_time); + list($response) = $this->fetchAuditLogOfRolesWithHttpInfo($start_date_time, $end_date_time, $contentType); return $response; } @@ -811,14 +1002,15 @@ public function fetchAuditLogOfRoles($start_date_time, $end_date_time) * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAuditLogOfRoles'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\RoleAuditLog[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAuditLogOfRolesWithHttpInfo($start_date_time, $end_date_time) + public function fetchAuditLogOfRolesWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchAuditLogOfRoles'][0]) { - $request = $this->fetchAuditLogOfRolesRequest($start_date_time, $end_date_time); + $request = $this->fetchAuditLogOfRolesRequest($start_date_time, $end_date_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -861,6 +1053,21 @@ public function fetchAuditLogOfRolesWithHttpInfo($start_date_time, $end_date_tim $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\RoleAuditLog[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1080,21 @@ public function fetchAuditLogOfRolesWithHttpInfo($start_date_time, $end_date_tim $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1107,21 @@ public function fetchAuditLogOfRolesWithHttpInfo($start_date_time, $end_date_tim $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -897,6 +1134,21 @@ public function fetchAuditLogOfRolesWithHttpInfo($start_date_time, $end_date_tim $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -911,6 +1163,21 @@ public function fetchAuditLogOfRolesWithHttpInfo($start_date_time, $end_date_tim $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -965,13 +1232,14 @@ public function fetchAuditLogOfRolesWithHttpInfo($start_date_time, $end_date_tim * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAuditLogOfRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAuditLogOfRolesAsync($start_date_time, $end_date_time) + public function fetchAuditLogOfRolesAsync($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchAuditLogOfRoles'][0]) { - return $this->fetchAuditLogOfRolesAsyncWithHttpInfo($start_date_time, $end_date_time) + return $this->fetchAuditLogOfRolesAsyncWithHttpInfo($start_date_time, $end_date_time, $contentType) ->then( function ($response) { return $response[0]; @@ -986,14 +1254,15 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAuditLogOfRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAuditLogOfRolesAsyncWithHttpInfo($start_date_time, $end_date_time) + public function fetchAuditLogOfRolesAsyncWithHttpInfo($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchAuditLogOfRoles'][0]) { $returnType = '\OpenAPI\Client\Model\RoleAuditLog[]'; - $request = $this->fetchAuditLogOfRolesRequest($start_date_time, $end_date_time); + $request = $this->fetchAuditLogOfRolesRequest($start_date_time, $end_date_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1003,6 +1272,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1033,18 +1305,21 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAuditLogOfRoles'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAuditLogOfRolesRequest($start_date_time, $end_date_time) + public function fetchAuditLogOfRolesRequest($start_date_time, $end_date_time, string $contentType = self::contentTypes['fetchAuditLogOfRoles'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchAuditLogOfRoles' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( @@ -1052,6 +1327,7 @@ public function fetchAuditLogOfRolesRequest($start_date_time, $end_date_time) ); } + $resourcePath = '/v2/system/roles/auditLog'; $formParams = []; $queryParams = []; @@ -1060,41 +1336,32 @@ public function fetchAuditLogOfRolesRequest($start_date_time, $end_date_time) $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1112,12 +1379,12 @@ public function fetchAuditLogOfRolesRequest($start_date_time, $end_date_time) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1133,10 +1400,11 @@ public function fetchAuditLogOfRolesRequest($start_date_time, $end_date_time) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1148,14 +1416,15 @@ public function fetchAuditLogOfRolesRequest($start_date_time, $end_date_time) * Fetch employees with role * * @param string $role_id role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeesWithRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Employee[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchEmployeesWithRole($role_id) + public function fetchEmployeesWithRole($role_id, string $contentType = self::contentTypes['fetchEmployeesWithRole'][0]) { - list($response) = $this->fetchEmployeesWithRoleWithHttpInfo($role_id); + list($response) = $this->fetchEmployeesWithRoleWithHttpInfo($role_id, $contentType); return $response; } @@ -1165,14 +1434,15 @@ public function fetchEmployeesWithRole($role_id) * Fetch employees with role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeesWithRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Employee[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchEmployeesWithRoleWithHttpInfo($role_id) + public function fetchEmployeesWithRoleWithHttpInfo($role_id, string $contentType = self::contentTypes['fetchEmployeesWithRole'][0]) { - $request = $this->fetchEmployeesWithRoleRequest($role_id); + $request = $this->fetchEmployeesWithRoleRequest($role_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1215,6 +1485,21 @@ public function fetchEmployeesWithRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Employee[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1512,21 @@ public function fetchEmployeesWithRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1239,6 +1539,21 @@ public function fetchEmployeesWithRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1251,6 +1566,21 @@ public function fetchEmployeesWithRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1265,6 +1595,21 @@ public function fetchEmployeesWithRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1318,13 +1663,14 @@ public function fetchEmployeesWithRoleWithHttpInfo($role_id) * Fetch employees with role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeesWithRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchEmployeesWithRoleAsync($role_id) + public function fetchEmployeesWithRoleAsync($role_id, string $contentType = self::contentTypes['fetchEmployeesWithRole'][0]) { - return $this->fetchEmployeesWithRoleAsyncWithHttpInfo($role_id) + return $this->fetchEmployeesWithRoleAsyncWithHttpInfo($role_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1338,14 +1684,15 @@ function ($response) { * Fetch employees with role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeesWithRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchEmployeesWithRoleAsyncWithHttpInfo($role_id) + public function fetchEmployeesWithRoleAsyncWithHttpInfo($role_id, string $contentType = self::contentTypes['fetchEmployeesWithRole'][0]) { $returnType = '\OpenAPI\Client\Model\Employee[]'; - $request = $this->fetchEmployeesWithRoleRequest($role_id); + $request = $this->fetchEmployeesWithRoleRequest($role_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1355,6 +1702,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1384,12 +1734,14 @@ function ($exception) { * Create request for operation 'fetchEmployeesWithRole' * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchEmployeesWithRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchEmployeesWithRoleRequest($role_id) + public function fetchEmployeesWithRoleRequest($role_id, string $contentType = self::contentTypes['fetchEmployeesWithRole'][0]) { + // verify the required parameter 'role_id' is set if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { throw new \InvalidArgumentException( @@ -1405,7 +1757,7 @@ public function fetchEmployeesWithRoleRequest($role_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $role_id)) { throw new \InvalidArgumentException("invalid value for \"role_id\" when calling SystemApi.fetchEmployeesWithRole, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/system/roles/employees/{roleID}'; $formParams = []; @@ -1426,16 +1778,11 @@ public function fetchEmployeesWithRoleRequest($role_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1453,12 +1800,12 @@ public function fetchEmployeesWithRoleRequest($role_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1474,10 +1821,11 @@ public function fetchEmployeesWithRoleRequest($role_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1489,14 +1837,15 @@ public function fetchEmployeesWithRoleRequest($role_id) * Fetch webpages for role * * @param string $role_id role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWebpagesForRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Webpage[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchWebpagesForRole($role_id) + public function fetchWebpagesForRole($role_id, string $contentType = self::contentTypes['fetchWebpagesForRole'][0]) { - list($response) = $this->fetchWebpagesForRoleWithHttpInfo($role_id); + list($response) = $this->fetchWebpagesForRoleWithHttpInfo($role_id, $contentType); return $response; } @@ -1506,14 +1855,15 @@ public function fetchWebpagesForRole($role_id) * Fetch webpages for role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWebpagesForRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Webpage[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchWebpagesForRoleWithHttpInfo($role_id) + public function fetchWebpagesForRoleWithHttpInfo($role_id, string $contentType = self::contentTypes['fetchWebpagesForRole'][0]) { - $request = $this->fetchWebpagesForRoleRequest($role_id); + $request = $this->fetchWebpagesForRoleRequest($role_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1556,6 +1906,21 @@ public function fetchWebpagesForRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Webpage[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1568,6 +1933,21 @@ public function fetchWebpagesForRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1580,6 +1960,21 @@ public function fetchWebpagesForRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1592,6 +1987,21 @@ public function fetchWebpagesForRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1606,6 +2016,21 @@ public function fetchWebpagesForRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1659,13 +2084,14 @@ public function fetchWebpagesForRoleWithHttpInfo($role_id) * Fetch webpages for role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWebpagesForRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWebpagesForRoleAsync($role_id) + public function fetchWebpagesForRoleAsync($role_id, string $contentType = self::contentTypes['fetchWebpagesForRole'][0]) { - return $this->fetchWebpagesForRoleAsyncWithHttpInfo($role_id) + return $this->fetchWebpagesForRoleAsyncWithHttpInfo($role_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1679,14 +2105,15 @@ function ($response) { * Fetch webpages for role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWebpagesForRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWebpagesForRoleAsyncWithHttpInfo($role_id) + public function fetchWebpagesForRoleAsyncWithHttpInfo($role_id, string $contentType = self::contentTypes['fetchWebpagesForRole'][0]) { $returnType = '\OpenAPI\Client\Model\Webpage[]'; - $request = $this->fetchWebpagesForRoleRequest($role_id); + $request = $this->fetchWebpagesForRoleRequest($role_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1696,6 +2123,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1725,12 +2155,14 @@ function ($exception) { * Create request for operation 'fetchWebpagesForRole' * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWebpagesForRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchWebpagesForRoleRequest($role_id) + public function fetchWebpagesForRoleRequest($role_id, string $contentType = self::contentTypes['fetchWebpagesForRole'][0]) { + // verify the required parameter 'role_id' is set if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { throw new \InvalidArgumentException( @@ -1746,7 +2178,7 @@ public function fetchWebpagesForRoleRequest($role_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $role_id)) { throw new \InvalidArgumentException("invalid value for \"role_id\" when calling SystemApi.fetchWebpagesForRole, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/system/roles/webpages/{roleID}'; $formParams = []; @@ -1767,16 +2199,11 @@ public function fetchWebpagesForRoleRequest($role_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1794,12 +2221,12 @@ public function fetchWebpagesForRoleRequest($role_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1815,10 +2242,11 @@ public function fetchWebpagesForRoleRequest($role_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1829,14 +2257,15 @@ public function fetchWebpagesForRoleRequest($role_id) * * Get payment prefixes * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaymentPrefixes'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function getPaymentPrefixes() + public function getPaymentPrefixes(string $contentType = self::contentTypes['getPaymentPrefixes'][0]) { - list($response) = $this->getPaymentPrefixesWithHttpInfo(); + list($response) = $this->getPaymentPrefixesWithHttpInfo($contentType); return $response; } @@ -1845,14 +2274,15 @@ public function getPaymentPrefixes() * * Get payment prefixes * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaymentPrefixes'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function getPaymentPrefixesWithHttpInfo() + public function getPaymentPrefixesWithHttpInfo(string $contentType = self::contentTypes['getPaymentPrefixes'][0]) { - $request = $this->getPaymentPrefixesRequest(); + $request = $this->getPaymentPrefixesRequest($contentType); try { $options = $this->createHttpClientOption(); @@ -1895,6 +2325,21 @@ public function getPaymentPrefixesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1907,6 +2352,21 @@ public function getPaymentPrefixesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1919,6 +2379,21 @@ public function getPaymentPrefixesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1931,6 +2406,21 @@ public function getPaymentPrefixesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1945,6 +2435,21 @@ public function getPaymentPrefixesWithHttpInfo() $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1997,13 +2502,14 @@ public function getPaymentPrefixesWithHttpInfo() * * Get payment prefixes * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaymentPrefixes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPaymentPrefixesAsync() + public function getPaymentPrefixesAsync(string $contentType = self::contentTypes['getPaymentPrefixes'][0]) { - return $this->getPaymentPrefixesAsyncWithHttpInfo() + return $this->getPaymentPrefixesAsyncWithHttpInfo($contentType) ->then( function ($response) { return $response[0]; @@ -2016,14 +2522,15 @@ function ($response) { * * Get payment prefixes * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaymentPrefixes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPaymentPrefixesAsyncWithHttpInfo() + public function getPaymentPrefixesAsyncWithHttpInfo(string $contentType = self::contentTypes['getPaymentPrefixes'][0]) { $returnType = 'mixed[]'; - $request = $this->getPaymentPrefixesRequest(); + $request = $this->getPaymentPrefixesRequest($contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2033,6 +2540,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2061,13 +2571,15 @@ function ($exception) { /** * Create request for operation 'getPaymentPrefixes' * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPaymentPrefixes'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPaymentPrefixesRequest() + public function getPaymentPrefixesRequest(string $contentType = self::contentTypes['getPaymentPrefixes'][0]) { + $resourcePath = '/v2/system/prefixes'; $formParams = []; $queryParams = []; @@ -2079,16 +2591,11 @@ public function getPaymentPrefixesRequest() - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2106,12 +2613,12 @@ public function getPaymentPrefixesRequest() // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2127,10 +2634,11 @@ public function getPaymentPrefixesRequest() $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2142,14 +2650,15 @@ public function getPaymentPrefixesRequest() * Fetch role * * @param string $role_id role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loadRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTRole|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function loadRole($role_id) + public function loadRole($role_id, string $contentType = self::contentTypes['loadRole'][0]) { - list($response) = $this->loadRoleWithHttpInfo($role_id); + list($response) = $this->loadRoleWithHttpInfo($role_id, $contentType); return $response; } @@ -2159,14 +2668,15 @@ public function loadRole($role_id) * Fetch role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loadRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTRole|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function loadRoleWithHttpInfo($role_id) + public function loadRoleWithHttpInfo($role_id, string $contentType = self::contentTypes['loadRole'][0]) { - $request = $this->loadRoleRequest($role_id); + $request = $this->loadRoleRequest($role_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2209,6 +2719,21 @@ public function loadRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTRole' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2221,6 +2746,21 @@ public function loadRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2233,6 +2773,21 @@ public function loadRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2245,6 +2800,21 @@ public function loadRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2259,6 +2829,21 @@ public function loadRoleWithHttpInfo($role_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2312,13 +2897,14 @@ public function loadRoleWithHttpInfo($role_id) * Fetch role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loadRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function loadRoleAsync($role_id) + public function loadRoleAsync($role_id, string $contentType = self::contentTypes['loadRole'][0]) { - return $this->loadRoleAsyncWithHttpInfo($role_id) + return $this->loadRoleAsyncWithHttpInfo($role_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2332,14 +2918,15 @@ function ($response) { * Fetch role * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loadRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function loadRoleAsyncWithHttpInfo($role_id) + public function loadRoleAsyncWithHttpInfo($role_id, string $contentType = self::contentTypes['loadRole'][0]) { $returnType = '\OpenAPI\Client\Model\WTRole'; - $request = $this->loadRoleRequest($role_id); + $request = $this->loadRoleRequest($role_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2349,6 +2936,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2378,12 +2968,14 @@ function ($exception) { * Create request for operation 'loadRole' * * @param string $role_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['loadRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function loadRoleRequest($role_id) + public function loadRoleRequest($role_id, string $contentType = self::contentTypes['loadRole'][0]) { + // verify the required parameter 'role_id' is set if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { throw new \InvalidArgumentException( @@ -2399,7 +2991,7 @@ public function loadRoleRequest($role_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $role_id)) { throw new \InvalidArgumentException("invalid value for \"role_id\" when calling SystemApi.loadRole, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/system/roles/{roleID}'; $formParams = []; @@ -2420,16 +3012,11 @@ public function loadRoleRequest($role_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2447,12 +3034,12 @@ public function loadRoleRequest($role_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2468,10 +3055,11 @@ public function loadRoleRequest($role_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2484,14 +3072,15 @@ public function loadRoleRequest($role_id) * * @param string $role_id role_id (required) * @param \OpenAPI\Client\Model\WTSystemRoleCreate $wt_system_role_create wt_system_role_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Role|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function saveRole($role_id, $wt_system_role_create) + public function saveRole($role_id, $wt_system_role_create, string $contentType = self::contentTypes['saveRole'][0]) { - list($response) = $this->saveRoleWithHttpInfo($role_id, $wt_system_role_create); + list($response) = $this->saveRoleWithHttpInfo($role_id, $wt_system_role_create, $contentType); return $response; } @@ -2502,14 +3091,15 @@ public function saveRole($role_id, $wt_system_role_create) * * @param string $role_id (required) * @param \OpenAPI\Client\Model\WTSystemRoleCreate $wt_system_role_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveRole'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Role|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function saveRoleWithHttpInfo($role_id, $wt_system_role_create) + public function saveRoleWithHttpInfo($role_id, $wt_system_role_create, string $contentType = self::contentTypes['saveRole'][0]) { - $request = $this->saveRoleRequest($role_id, $wt_system_role_create); + $request = $this->saveRoleRequest($role_id, $wt_system_role_create, $contentType); try { $options = $this->createHttpClientOption(); @@ -2552,6 +3142,21 @@ public function saveRoleWithHttpInfo($role_id, $wt_system_role_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Role' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2564,6 +3169,21 @@ public function saveRoleWithHttpInfo($role_id, $wt_system_role_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2576,6 +3196,21 @@ public function saveRoleWithHttpInfo($role_id, $wt_system_role_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2588,6 +3223,21 @@ public function saveRoleWithHttpInfo($role_id, $wt_system_role_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2602,6 +3252,21 @@ public function saveRoleWithHttpInfo($role_id, $wt_system_role_create) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2656,13 +3321,14 @@ public function saveRoleWithHttpInfo($role_id, $wt_system_role_create) * * @param string $role_id (required) * @param \OpenAPI\Client\Model\WTSystemRoleCreate $wt_system_role_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveRoleAsync($role_id, $wt_system_role_create) + public function saveRoleAsync($role_id, $wt_system_role_create, string $contentType = self::contentTypes['saveRole'][0]) { - return $this->saveRoleAsyncWithHttpInfo($role_id, $wt_system_role_create) + return $this->saveRoleAsyncWithHttpInfo($role_id, $wt_system_role_create, $contentType) ->then( function ($response) { return $response[0]; @@ -2677,14 +3343,15 @@ function ($response) { * * @param string $role_id (required) * @param \OpenAPI\Client\Model\WTSystemRoleCreate $wt_system_role_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function saveRoleAsyncWithHttpInfo($role_id, $wt_system_role_create) + public function saveRoleAsyncWithHttpInfo($role_id, $wt_system_role_create, string $contentType = self::contentTypes['saveRole'][0]) { $returnType = '\OpenAPI\Client\Model\Role'; - $request = $this->saveRoleRequest($role_id, $wt_system_role_create); + $request = $this->saveRoleRequest($role_id, $wt_system_role_create, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2694,6 +3361,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2724,12 +3394,14 @@ function ($exception) { * * @param string $role_id (required) * @param \OpenAPI\Client\Model\WTSystemRoleCreate $wt_system_role_create (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['saveRole'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function saveRoleRequest($role_id, $wt_system_role_create) + public function saveRoleRequest($role_id, $wt_system_role_create, string $contentType = self::contentTypes['saveRole'][0]) { + // verify the required parameter 'role_id' is set if ($role_id === null || (is_array($role_id) && count($role_id) === 0)) { throw new \InvalidArgumentException( @@ -2745,7 +3417,7 @@ public function saveRoleRequest($role_id, $wt_system_role_create) if (!preg_match("/^[a-zA-Z0-9]+$/", $role_id)) { throw new \InvalidArgumentException("invalid value for \"role_id\" when calling SystemApi.saveRole, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + // verify the required parameter 'wt_system_role_create' is set if ($wt_system_role_create === null || (is_array($wt_system_role_create) && count($wt_system_role_create) === 0)) { throw new \InvalidArgumentException( @@ -2753,6 +3425,7 @@ public function saveRoleRequest($role_id, $wt_system_role_create) ); } + $resourcePath = '/v2/system/roles/{roleID}'; $formParams = []; $queryParams = []; @@ -2772,21 +3445,17 @@ public function saveRoleRequest($role_id, $wt_system_role_create) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_system_role_create)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_system_role_create)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_system_role_create)); } else { $httpBody = $wt_system_role_create; } @@ -2805,12 +3474,12 @@ public function saveRoleRequest($role_id, $wt_system_role_create) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2826,10 +3495,11 @@ public function saveRoleRequest($role_id, $wt_system_role_create) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/TicketApi.php b/lib/Api/TicketApi.php index 5eb4b28..9c9e0ed 100644 --- a/lib/Api/TicketApi.php +++ b/lib/Api/TicketApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createTicket' => [ + 'application/json', + ], + 'fetchTicket' => [ + 'application/json', + ], + 'restoreTicket' => [ + 'application/json', + ], + 'updateTicket' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive ticket * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Ticket|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveTicket($id) + public function archiveTicket($id, string $contentType = self::contentTypes['archiveTicket'][0]) { - list($response) = $this->archiveTicketWithHttpInfo($id); + list($response) = $this->archiveTicketWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveTicket($id) * Archive ticket * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Ticket|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveTicketWithHttpInfo($id) + public function archiveTicketWithHttpInfo($id, string $contentType = self::contentTypes['archiveTicket'][0]) { - $request = $this->archiveTicketRequest($id); + $request = $this->archiveTicketRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Ticket' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveTicketWithHttpInfo($id) * Archive ticket * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveTicketAsync($id) + public function archiveTicketAsync($id, string $contentType = self::contentTypes['archiveTicket'][0]) { - return $this->archiveTicketAsyncWithHttpInfo($id) + return $this->archiveTicketAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive ticket * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveTicketAsyncWithHttpInfo($id) + public function archiveTicketAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveTicket'][0]) { $returnType = '\OpenAPI\Client\Model\Ticket'; - $request = $this->archiveTicketRequest($id); + $request = $this->archiveTicketRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveTicket' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveTicketRequest($id) + public function archiveTicketRequest($id, string $contentType = self::contentTypes['archiveTicket'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveTicketRequest($id) ); } + $resourcePath = '/v2/ticket/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveTicketRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveTicketRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveTicketRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveTicketRequest($id) * Create ticket * * @param \OpenAPI\Client\Model\WTTicketCreateParams $wt_ticket_create_params wt_ticket_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Ticket|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createTicket($wt_ticket_create_params) + public function createTicket($wt_ticket_create_params, string $contentType = self::contentTypes['createTicket'][0]) { - list($response) = $this->createTicketWithHttpInfo($wt_ticket_create_params); + list($response) = $this->createTicketWithHttpInfo($wt_ticket_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createTicket($wt_ticket_create_params) * Create ticket * * @param \OpenAPI\Client\Model\WTTicketCreateParams $wt_ticket_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Ticket|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createTicketWithHttpInfo($wt_ticket_create_params) + public function createTicketWithHttpInfo($wt_ticket_create_params, string $contentType = self::contentTypes['createTicket'][0]) { - $request = $this->createTicketRequest($wt_ticket_create_params); + $request = $this->createTicketRequest($wt_ticket_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createTicketWithHttpInfo($wt_ticket_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Ticket' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createTicketWithHttpInfo($wt_ticket_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createTicketWithHttpInfo($wt_ticket_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createTicketWithHttpInfo($wt_ticket_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createTicketWithHttpInfo($wt_ticket_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createTicketWithHttpInfo($wt_ticket_create_params) * Create ticket * * @param \OpenAPI\Client\Model\WTTicketCreateParams $wt_ticket_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTicketAsync($wt_ticket_create_params) + public function createTicketAsync($wt_ticket_create_params, string $contentType = self::contentTypes['createTicket'][0]) { - return $this->createTicketAsyncWithHttpInfo($wt_ticket_create_params) + return $this->createTicketAsyncWithHttpInfo($wt_ticket_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create ticket * * @param \OpenAPI\Client\Model\WTTicketCreateParams $wt_ticket_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTicketAsyncWithHttpInfo($wt_ticket_create_params) + public function createTicketAsyncWithHttpInfo($wt_ticket_create_params, string $contentType = self::contentTypes['createTicket'][0]) { $returnType = '\OpenAPI\Client\Model\Ticket'; - $request = $this->createTicketRequest($wt_ticket_create_params); + $request = $this->createTicketRequest($wt_ticket_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createTicket' * * @param \OpenAPI\Client\Model\WTTicketCreateParams $wt_ticket_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createTicketRequest($wt_ticket_create_params) + public function createTicketRequest($wt_ticket_create_params, string $contentType = self::contentTypes['createTicket'][0]) { + // verify the required parameter 'wt_ticket_create_params' is set if ($wt_ticket_create_params === null || (is_array($wt_ticket_create_params) && count($wt_ticket_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createTicketRequest($wt_ticket_create_params) ); } + $resourcePath = '/v2/ticket'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createTicketRequest($wt_ticket_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_ticket_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_ticket_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_ticket_create_params)); } else { $httpBody = $wt_ticket_create_params; } @@ -746,12 +927,12 @@ public function createTicketRequest($wt_ticket_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createTicketRequest($wt_ticket_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createTicketRequest($wt_ticket_create_params) * Fetch ticket * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WTTicket|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError */ - public function fetchTicket($id) + public function fetchTicket($id, string $contentType = self::contentTypes['fetchTicket'][0]) { - list($response) = $this->fetchTicketWithHttpInfo($id); + list($response) = $this->fetchTicketWithHttpInfo($id, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchTicket($id) * Fetch ticket * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WTTicket|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\ForeignKeyDoesNotExist|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchTicketWithHttpInfo($id) + public function fetchTicketWithHttpInfo($id, string $contentType = self::contentTypes['fetchTicket'][0]) { - $request = $this->fetchTicketRequest($id); + $request = $this->fetchTicketRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WTTicket' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\ForeignKeyDoesNotExist' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -897,6 +1141,21 @@ public function fetchTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -911,6 +1170,21 @@ public function fetchTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -972,13 +1246,14 @@ public function fetchTicketWithHttpInfo($id) * Fetch ticket * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchTicketAsync($id) + public function fetchTicketAsync($id, string $contentType = self::contentTypes['fetchTicket'][0]) { - return $this->fetchTicketAsyncWithHttpInfo($id) + return $this->fetchTicketAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -992,14 +1267,15 @@ function ($response) { * Fetch ticket * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchTicketAsyncWithHttpInfo($id) + public function fetchTicketAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchTicket'][0]) { $returnType = '\OpenAPI\Client\Model\WTTicket'; - $request = $this->fetchTicketRequest($id); + $request = $this->fetchTicketRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1009,6 +1285,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1038,12 +1317,14 @@ function ($exception) { * Create request for operation 'fetchTicket' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchTicketRequest($id) + public function fetchTicketRequest($id, string $contentType = self::contentTypes['fetchTicket'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1051,6 +1332,7 @@ public function fetchTicketRequest($id) ); } + $resourcePath = '/v2/ticket/{id}'; $formParams = []; $queryParams = []; @@ -1070,16 +1352,11 @@ public function fetchTicketRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1097,12 +1374,12 @@ public function fetchTicketRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1118,10 +1395,11 @@ public function fetchTicketRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1133,14 +1411,15 @@ public function fetchTicketRequest($id) * Restore ticket * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Ticket|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreTicket($id) + public function restoreTicket($id, string $contentType = self::contentTypes['restoreTicket'][0]) { - list($response) = $this->restoreTicketWithHttpInfo($id); + list($response) = $this->restoreTicketWithHttpInfo($id, $contentType); return $response; } @@ -1150,14 +1429,15 @@ public function restoreTicket($id) * Restore ticket * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Ticket|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreTicketWithHttpInfo($id) + public function restoreTicketWithHttpInfo($id, string $contentType = self::contentTypes['restoreTicket'][0]) { - $request = $this->restoreTicketRequest($id); + $request = $this->restoreTicketRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1200,6 +1480,21 @@ public function restoreTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Ticket' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1212,6 +1507,21 @@ public function restoreTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1224,6 +1534,21 @@ public function restoreTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1236,6 +1561,21 @@ public function restoreTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1250,6 +1590,21 @@ public function restoreTicketWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1303,13 +1658,14 @@ public function restoreTicketWithHttpInfo($id) * Restore ticket * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreTicketAsync($id) + public function restoreTicketAsync($id, string $contentType = self::contentTypes['restoreTicket'][0]) { - return $this->restoreTicketAsyncWithHttpInfo($id) + return $this->restoreTicketAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1323,14 +1679,15 @@ function ($response) { * Restore ticket * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreTicketAsyncWithHttpInfo($id) + public function restoreTicketAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreTicket'][0]) { $returnType = '\OpenAPI\Client\Model\Ticket'; - $request = $this->restoreTicketRequest($id); + $request = $this->restoreTicketRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1340,6 +1697,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1369,12 +1729,14 @@ function ($exception) { * Create request for operation 'restoreTicket' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreTicketRequest($id) + public function restoreTicketRequest($id, string $contentType = self::contentTypes['restoreTicket'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1382,6 +1744,7 @@ public function restoreTicketRequest($id) ); } + $resourcePath = '/v2/ticket/{id}'; $formParams = []; $queryParams = []; @@ -1401,16 +1764,11 @@ public function restoreTicketRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1428,12 +1786,12 @@ public function restoreTicketRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1449,10 +1807,11 @@ public function restoreTicketRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1465,14 +1824,15 @@ public function restoreTicketRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTTicketUpdateParams $wt_ticket_update_params wt_ticket_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Ticket|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateTicket($id, $wt_ticket_update_params) + public function updateTicket($id, $wt_ticket_update_params, string $contentType = self::contentTypes['updateTicket'][0]) { - list($response) = $this->updateTicketWithHttpInfo($id, $wt_ticket_update_params); + list($response) = $this->updateTicketWithHttpInfo($id, $wt_ticket_update_params, $contentType); return $response; } @@ -1483,14 +1843,15 @@ public function updateTicket($id, $wt_ticket_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTTicketUpdateParams $wt_ticket_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTicket'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Ticket|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateTicketWithHttpInfo($id, $wt_ticket_update_params) + public function updateTicketWithHttpInfo($id, $wt_ticket_update_params, string $contentType = self::contentTypes['updateTicket'][0]) { - $request = $this->updateTicketRequest($id, $wt_ticket_update_params); + $request = $this->updateTicketRequest($id, $wt_ticket_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1533,6 +1894,21 @@ public function updateTicketWithHttpInfo($id, $wt_ticket_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Ticket' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1545,6 +1921,21 @@ public function updateTicketWithHttpInfo($id, $wt_ticket_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1557,6 +1948,21 @@ public function updateTicketWithHttpInfo($id, $wt_ticket_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1569,6 +1975,21 @@ public function updateTicketWithHttpInfo($id, $wt_ticket_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1583,6 +2004,21 @@ public function updateTicketWithHttpInfo($id, $wt_ticket_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1637,13 +2073,14 @@ public function updateTicketWithHttpInfo($id, $wt_ticket_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTTicketUpdateParams $wt_ticket_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateTicketAsync($id, $wt_ticket_update_params) + public function updateTicketAsync($id, $wt_ticket_update_params, string $contentType = self::contentTypes['updateTicket'][0]) { - return $this->updateTicketAsyncWithHttpInfo($id, $wt_ticket_update_params) + return $this->updateTicketAsyncWithHttpInfo($id, $wt_ticket_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1658,14 +2095,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTTicketUpdateParams $wt_ticket_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateTicketAsyncWithHttpInfo($id, $wt_ticket_update_params) + public function updateTicketAsyncWithHttpInfo($id, $wt_ticket_update_params, string $contentType = self::contentTypes['updateTicket'][0]) { $returnType = '\OpenAPI\Client\Model\Ticket'; - $request = $this->updateTicketRequest($id, $wt_ticket_update_params); + $request = $this->updateTicketRequest($id, $wt_ticket_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1675,6 +2113,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1705,18 +2146,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTTicketUpdateParams $wt_ticket_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateTicket'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateTicketRequest($id, $wt_ticket_update_params) + public function updateTicketRequest($id, $wt_ticket_update_params, string $contentType = self::contentTypes['updateTicket'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateTicket' ); } + // verify the required parameter 'wt_ticket_update_params' is set if ($wt_ticket_update_params === null || (is_array($wt_ticket_update_params) && count($wt_ticket_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1724,6 +2168,7 @@ public function updateTicketRequest($id, $wt_ticket_update_params) ); } + $resourcePath = '/v2/ticket/{id}'; $formParams = []; $queryParams = []; @@ -1743,21 +2188,17 @@ public function updateTicketRequest($id, $wt_ticket_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_ticket_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_ticket_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_ticket_update_params)); } else { $httpBody = $wt_ticket_update_params; } @@ -1776,12 +2217,12 @@ public function updateTicketRequest($id, $wt_ticket_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1797,10 +2238,11 @@ public function updateTicketRequest($id, $wt_ticket_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/TransactionLedgerApi.php b/lib/Api/TransactionLedgerApi.php index bea62b8..7970027 100644 --- a/lib/Api/TransactionLedgerApi.php +++ b/lib/Api/TransactionLedgerApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -123,17 +130,18 @@ public function getConfig() * * @param \DateTime $start_date_time start_date_time (required) * @param \DateTime $end_date_time end_date_time (required) - * @param double $page_num page_num (required) - * @param double $page_size page_size (required) - * @param \OpenAPI\Client\Model\ApplicableTerminals $register_type register_type (optional) + * @param float $page_num page_num (required) + * @param float $page_size page_size (required) + * @param ApplicableTerminals $register_type register_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLedgerTransactions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \OpenAPI\Client\Model\InlineResponse2009|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError + * @return \OpenAPI\Client\Model\FetchAllLedgerTransactions200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllLedgerTransactions($start_date_time, $end_date_time, $page_num, $page_size, $register_type = null) + public function fetchAllLedgerTransactions($start_date_time, $end_date_time, $page_num, $page_size, $register_type = null, string $contentType = self::contentTypes['fetchAllLedgerTransactions'][0]) { - list($response) = $this->fetchAllLedgerTransactionsWithHttpInfo($start_date_time, $end_date_time, $page_num, $page_size, $register_type); + list($response) = $this->fetchAllLedgerTransactionsWithHttpInfo($start_date_time, $end_date_time, $page_num, $page_size, $register_type, $contentType); return $response; } @@ -144,17 +152,18 @@ public function fetchAllLedgerTransactions($start_date_time, $end_date_time, $pa * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) - * @param double $page_num (required) - * @param double $page_size (required) - * @param \OpenAPI\Client\Model\ApplicableTerminals $register_type (optional) + * @param float $page_num (required) + * @param float $page_size (required) + * @param ApplicableTerminals $register_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLedgerTransactions'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \OpenAPI\Client\Model\InlineResponse2009|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) + * @return array of \OpenAPI\Client\Model\FetchAllLedgerTransactions200Response|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllLedgerTransactionsWithHttpInfo($start_date_time, $end_date_time, $page_num, $page_size, $register_type = null) + public function fetchAllLedgerTransactionsWithHttpInfo($start_date_time, $end_date_time, $page_num, $page_size, $register_type = null, string $contentType = self::contentTypes['fetchAllLedgerTransactions'][0]) { - $request = $this->fetchAllLedgerTransactionsRequest($start_date_time, $end_date_time, $page_num, $page_size, $register_type); + $request = $this->fetchAllLedgerTransactionsRequest($start_date_time, $end_date_time, $page_num, $page_size, $register_type, $contentType); try { $options = $this->createHttpClientOption(); @@ -193,14 +202,29 @@ public function fetchAllLedgerTransactionsWithHttpInfo($start_date_time, $end_da switch($statusCode) { case 200: - if ('\OpenAPI\Client\Model\InlineResponse2009' === '\SplFileObject') { + if ('\OpenAPI\Client\Model\FetchAllLedgerTransactions200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FetchAllLedgerTransactions200Response' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\InlineResponse2009', []), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\FetchAllLedgerTransactions200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -209,6 +233,21 @@ public function fetchAllLedgerTransactionsWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -221,6 +260,21 @@ public function fetchAllLedgerTransactionsWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -233,6 +287,21 @@ public function fetchAllLedgerTransactionsWithHttpInfo($start_date_time, $end_da $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -242,11 +311,26 @@ public function fetchAllLedgerTransactionsWithHttpInfo($start_date_time, $end_da ]; } - $returnType = '\OpenAPI\Client\Model\InlineResponse2009'; + $returnType = '\OpenAPI\Client\Model\FetchAllLedgerTransactions200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -260,7 +344,7 @@ public function fetchAllLedgerTransactionsWithHttpInfo($start_date_time, $end_da case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\OpenAPI\Client\Model\InlineResponse2009', + '\OpenAPI\Client\Model\FetchAllLedgerTransactions200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -301,16 +385,17 @@ public function fetchAllLedgerTransactionsWithHttpInfo($start_date_time, $end_da * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) - * @param double $page_num (required) - * @param double $page_size (required) - * @param \OpenAPI\Client\Model\ApplicableTerminals $register_type (optional) + * @param float $page_num (required) + * @param float $page_size (required) + * @param ApplicableTerminals $register_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLedgerTransactions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllLedgerTransactionsAsync($start_date_time, $end_date_time, $page_num, $page_size, $register_type = null) + public function fetchAllLedgerTransactionsAsync($start_date_time, $end_date_time, $page_num, $page_size, $register_type = null, string $contentType = self::contentTypes['fetchAllLedgerTransactions'][0]) { - return $this->fetchAllLedgerTransactionsAsyncWithHttpInfo($start_date_time, $end_date_time, $page_num, $page_size, $register_type) + return $this->fetchAllLedgerTransactionsAsyncWithHttpInfo($start_date_time, $end_date_time, $page_num, $page_size, $register_type, $contentType) ->then( function ($response) { return $response[0]; @@ -325,17 +410,18 @@ function ($response) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) - * @param double $page_num (required) - * @param double $page_size (required) - * @param \OpenAPI\Client\Model\ApplicableTerminals $register_type (optional) + * @param float $page_num (required) + * @param float $page_size (required) + * @param ApplicableTerminals $register_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLedgerTransactions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllLedgerTransactionsAsyncWithHttpInfo($start_date_time, $end_date_time, $page_num, $page_size, $register_type = null) + public function fetchAllLedgerTransactionsAsyncWithHttpInfo($start_date_time, $end_date_time, $page_num, $page_size, $register_type = null, string $contentType = self::contentTypes['fetchAllLedgerTransactions'][0]) { - $returnType = '\OpenAPI\Client\Model\InlineResponse2009'; - $request = $this->fetchAllLedgerTransactionsRequest($start_date_time, $end_date_time, $page_num, $page_size, $register_type); + $returnType = '\OpenAPI\Client\Model\FetchAllLedgerTransactions200Response'; + $request = $this->fetchAllLedgerTransactionsRequest($start_date_time, $end_date_time, $page_num, $page_size, $register_type, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -345,6 +431,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -375,33 +464,38 @@ function ($exception) { * * @param \DateTime $start_date_time (required) * @param \DateTime $end_date_time (required) - * @param double $page_num (required) - * @param double $page_size (required) - * @param \OpenAPI\Client\Model\ApplicableTerminals $register_type (optional) + * @param float $page_num (required) + * @param float $page_size (required) + * @param ApplicableTerminals $register_type (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllLedgerTransactions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllLedgerTransactionsRequest($start_date_time, $end_date_time, $page_num, $page_size, $register_type = null) + public function fetchAllLedgerTransactionsRequest($start_date_time, $end_date_time, $page_num, $page_size, $register_type = null, string $contentType = self::contentTypes['fetchAllLedgerTransactions'][0]) { + // verify the required parameter 'start_date_time' is set if ($start_date_time === null || (is_array($start_date_time) && count($start_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $start_date_time when calling fetchAllLedgerTransactions' ); } + // verify the required parameter 'end_date_time' is set if ($end_date_time === null || (is_array($end_date_time) && count($end_date_time) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $end_date_time when calling fetchAllLedgerTransactions' ); } + // verify the required parameter 'page_num' is set if ($page_num === null || (is_array($page_num) && count($page_num) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $page_num when calling fetchAllLedgerTransactions' ); } + // verify the required parameter 'page_size' is set if ($page_size === null || (is_array($page_size) && count($page_size) === 0)) { throw new \InvalidArgumentException( @@ -409,6 +503,8 @@ public function fetchAllLedgerTransactionsRequest($start_date_time, $end_date_ti ); } + + $resourcePath = '/v2/pos/ledger/transactions/all'; $formParams = []; $queryParams = []; @@ -417,74 +513,59 @@ public function fetchAllLedgerTransactionsRequest($start_date_time, $end_date_ti $multipart = false; // query params - if ($start_date_time !== null) { - if('form' === 'form' && is_array($start_date_time)) { - foreach($start_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['startDateTime'] = $start_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_date_time, + 'startDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($end_date_time !== null) { - if('form' === 'form' && is_array($end_date_time)) { - foreach($end_date_time as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['endDateTime'] = $end_date_time; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_date_time, + 'endDateTime', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($page_num !== null) { - if('form' === 'form' && is_array($page_num)) { - foreach($page_num as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageNum'] = $page_num; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_num, + 'pageNum', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($page_size !== null) { - if('form' === 'form' && is_array($page_size)) { - foreach($page_size as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageSize'] = $page_size; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'number', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // query params - if ($register_type !== null) { - if('form' === 'form' && is_array($register_type)) { - foreach($register_type as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['registerType'] = $register_type; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $register_type, + 'registerType', // param base name + 'AnyOfStringStringStringStringStringStringString', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -502,12 +583,12 @@ public function fetchAllLedgerTransactionsRequest($start_date_time, $end_date_ti // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -523,10 +604,11 @@ public function fetchAllLedgerTransactionsRequest($start_date_time, $end_date_ti $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/VideosApi.php b/lib/Api/VideosApi.php index 25b7977..951eb09 100644 --- a/lib/Api/VideosApi.php +++ b/lib/Api/VideosApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createVideo' => [ + 'application/json', + ], + 'fetchAllVideo' => [ + 'application/json', + ], + 'restoreVideo' => [ + 'application/json', + ], + 'updateVideo' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +141,15 @@ public function getConfig() * Archive video * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveVideo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Video|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveVideo($id) + public function archiveVideo($id, string $contentType = self::contentTypes['archiveVideo'][0]) { - list($response) = $this->archiveVideoWithHttpInfo($id); + list($response) = $this->archiveVideoWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +159,15 @@ public function archiveVideo($id) * Archive video * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveVideo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Video|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveVideoWithHttpInfo($id) + public function archiveVideoWithHttpInfo($id, string $contentType = self::contentTypes['archiveVideo'][0]) { - $request = $this->archiveVideoRequest($id); + $request = $this->archiveVideoRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +210,21 @@ public function archiveVideoWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Video' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +237,21 @@ public function archiveVideoWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +264,21 @@ public function archiveVideoWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +291,21 @@ public function archiveVideoWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +320,21 @@ public function archiveVideoWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +388,14 @@ public function archiveVideoWithHttpInfo($id) * Archive video * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveVideoAsync($id) + public function archiveVideoAsync($id, string $contentType = self::contentTypes['archiveVideo'][0]) { - return $this->archiveVideoAsyncWithHttpInfo($id) + return $this->archiveVideoAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +409,15 @@ function ($response) { * Archive video * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveVideoAsyncWithHttpInfo($id) + public function archiveVideoAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveVideo'][0]) { $returnType = '\OpenAPI\Client\Model\Video'; - $request = $this->archiveVideoRequest($id); + $request = $this->archiveVideoRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +427,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +459,14 @@ function ($exception) { * Create request for operation 'archiveVideo' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveVideoRequest($id) + public function archiveVideoRequest($id, string $contentType = self::contentTypes['archiveVideo'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +474,7 @@ public function archiveVideoRequest($id) ); } + $resourcePath = '/v2/video/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +494,11 @@ public function archiveVideoRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +516,12 @@ public function archiveVideoRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +537,11 @@ public function archiveVideoRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +553,15 @@ public function archiveVideoRequest($id) * Create video * * @param \OpenAPI\Client\Model\WTVideoCreateParams $wt_video_create_params wt_video_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVideo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Video|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createVideo($wt_video_create_params) + public function createVideo($wt_video_create_params, string $contentType = self::contentTypes['createVideo'][0]) { - list($response) = $this->createVideoWithHttpInfo($wt_video_create_params); + list($response) = $this->createVideoWithHttpInfo($wt_video_create_params, $contentType); return $response; } @@ -470,14 +571,15 @@ public function createVideo($wt_video_create_params) * Create video * * @param \OpenAPI\Client\Model\WTVideoCreateParams $wt_video_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVideo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Video|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createVideoWithHttpInfo($wt_video_create_params) + public function createVideoWithHttpInfo($wt_video_create_params, string $contentType = self::contentTypes['createVideo'][0]) { - $request = $this->createVideoRequest($wt_video_create_params); + $request = $this->createVideoRequest($wt_video_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +622,21 @@ public function createVideoWithHttpInfo($wt_video_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Video' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +649,21 @@ public function createVideoWithHttpInfo($wt_video_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +676,21 @@ public function createVideoWithHttpInfo($wt_video_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +703,21 @@ public function createVideoWithHttpInfo($wt_video_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +732,21 @@ public function createVideoWithHttpInfo($wt_video_create_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +800,14 @@ public function createVideoWithHttpInfo($wt_video_create_params) * Create video * * @param \OpenAPI\Client\Model\WTVideoCreateParams $wt_video_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createVideoAsync($wt_video_create_params) + public function createVideoAsync($wt_video_create_params, string $contentType = self::contentTypes['createVideo'][0]) { - return $this->createVideoAsyncWithHttpInfo($wt_video_create_params) + return $this->createVideoAsyncWithHttpInfo($wt_video_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +821,15 @@ function ($response) { * Create video * * @param \OpenAPI\Client\Model\WTVideoCreateParams $wt_video_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createVideoAsyncWithHttpInfo($wt_video_create_params) + public function createVideoAsyncWithHttpInfo($wt_video_create_params, string $contentType = self::contentTypes['createVideo'][0]) { $returnType = '\OpenAPI\Client\Model\Video'; - $request = $this->createVideoRequest($wt_video_create_params); + $request = $this->createVideoRequest($wt_video_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +839,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +871,14 @@ function ($exception) { * Create request for operation 'createVideo' * * @param \OpenAPI\Client\Model\WTVideoCreateParams $wt_video_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createVideoRequest($wt_video_create_params) + public function createVideoRequest($wt_video_create_params, string $contentType = self::contentTypes['createVideo'][0]) { + // verify the required parameter 'wt_video_create_params' is set if ($wt_video_create_params === null || (is_array($wt_video_create_params) && count($wt_video_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +886,7 @@ public function createVideoRequest($wt_video_create_params) ); } + $resourcePath = '/v2/video'; $formParams = []; $queryParams = []; @@ -713,21 +898,17 @@ public function createVideoRequest($wt_video_create_params) - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_video_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_video_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_video_create_params)); } else { $httpBody = $wt_video_create_params; } @@ -746,12 +927,12 @@ public function createVideoRequest($wt_video_create_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +948,11 @@ public function createVideoRequest($wt_video_create_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +964,15 @@ public function createVideoRequest($wt_video_create_params) * Fetch all video * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVideo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllVideo($is_archive_included = null) + public function fetchAllVideo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllVideo'][0]) { - list($response) = $this->fetchAllVideoWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllVideoWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +982,15 @@ public function fetchAllVideo($is_archive_included = null) * Fetch all video * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVideo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllVideoWithHttpInfo($is_archive_included = null) + public function fetchAllVideoWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllVideo'][0]) { - $request = $this->fetchAllVideoRequest($is_archive_included); + $request = $this->fetchAllVideoRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1033,21 @@ public function fetchAllVideoWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1060,21 @@ public function fetchAllVideoWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1087,21 @@ public function fetchAllVideoWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1114,21 @@ public function fetchAllVideoWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1143,21 @@ public function fetchAllVideoWithHttpInfo($is_archive_included = null) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1211,14 @@ public function fetchAllVideoWithHttpInfo($is_archive_included = null) * Fetch all video * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllVideoAsync($is_archive_included = null) + public function fetchAllVideoAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllVideo'][0]) { - return $this->fetchAllVideoAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllVideoAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1232,15 @@ function ($response) { * Fetch all video * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllVideoAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllVideoAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllVideo'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllVideoRequest($is_archive_included); + $request = $this->fetchAllVideoRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1250,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1282,16 @@ function ($exception) { * Create request for operation 'fetchAllVideo' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllVideoRequest($is_archive_included = null) + public function fetchAllVideoRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllVideo'][0]) { + + $resourcePath = '/v2/video/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1300,23 @@ public function fetchAllVideoRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1334,12 @@ public function fetchAllVideoRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1355,11 @@ public function fetchAllVideoRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1371,15 @@ public function fetchAllVideoRequest($is_archive_included = null) * Restore video * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreVideo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Video|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreVideo($id) + public function restoreVideo($id, string $contentType = self::contentTypes['restoreVideo'][0]) { - list($response) = $this->restoreVideoWithHttpInfo($id); + list($response) = $this->restoreVideoWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1389,15 @@ public function restoreVideo($id) * Restore video * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreVideo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Video|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreVideoWithHttpInfo($id) + public function restoreVideoWithHttpInfo($id, string $contentType = self::contentTypes['restoreVideo'][0]) { - $request = $this->restoreVideoRequest($id); + $request = $this->restoreVideoRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1440,21 @@ public function restoreVideoWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Video' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1467,21 @@ public function restoreVideoWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1494,21 @@ public function restoreVideoWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1521,21 @@ public function restoreVideoWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1550,21 @@ public function restoreVideoWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1618,14 @@ public function restoreVideoWithHttpInfo($id) * Restore video * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreVideoAsync($id) + public function restoreVideoAsync($id, string $contentType = self::contentTypes['restoreVideo'][0]) { - return $this->restoreVideoAsyncWithHttpInfo($id) + return $this->restoreVideoAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1639,15 @@ function ($response) { * Restore video * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreVideoAsyncWithHttpInfo($id) + public function restoreVideoAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreVideo'][0]) { $returnType = '\OpenAPI\Client\Model\Video'; - $request = $this->restoreVideoRequest($id); + $request = $this->restoreVideoRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1657,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1689,14 @@ function ($exception) { * Create request for operation 'restoreVideo' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreVideoRequest($id) + public function restoreVideoRequest($id, string $contentType = self::contentTypes['restoreVideo'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1704,7 @@ public function restoreVideoRequest($id) ); } + $resourcePath = '/v2/video/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1724,11 @@ public function restoreVideoRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1746,12 @@ public function restoreVideoRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1767,11 @@ public function restoreVideoRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1442,14 +1784,15 @@ public function restoreVideoRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTVideoUpdateParams $wt_video_update_params wt_video_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateVideo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\Video|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateVideo($id, $wt_video_update_params) + public function updateVideo($id, $wt_video_update_params, string $contentType = self::contentTypes['updateVideo'][0]) { - list($response) = $this->updateVideoWithHttpInfo($id, $wt_video_update_params); + list($response) = $this->updateVideoWithHttpInfo($id, $wt_video_update_params, $contentType); return $response; } @@ -1460,14 +1803,15 @@ public function updateVideo($id, $wt_video_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTVideoUpdateParams $wt_video_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateVideo'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\Video|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateVideoWithHttpInfo($id, $wt_video_update_params) + public function updateVideoWithHttpInfo($id, $wt_video_update_params, string $contentType = self::contentTypes['updateVideo'][0]) { - $request = $this->updateVideoRequest($id, $wt_video_update_params); + $request = $this->updateVideoRequest($id, $wt_video_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -1510,6 +1854,21 @@ public function updateVideoWithHttpInfo($id, $wt_video_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\Video' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1522,6 +1881,21 @@ public function updateVideoWithHttpInfo($id, $wt_video_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1534,6 +1908,21 @@ public function updateVideoWithHttpInfo($id, $wt_video_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1546,6 +1935,21 @@ public function updateVideoWithHttpInfo($id, $wt_video_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1560,6 +1964,21 @@ public function updateVideoWithHttpInfo($id, $wt_video_update_params) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1614,13 +2033,14 @@ public function updateVideoWithHttpInfo($id, $wt_video_update_params) * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTVideoUpdateParams $wt_video_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateVideoAsync($id, $wt_video_update_params) + public function updateVideoAsync($id, $wt_video_update_params, string $contentType = self::contentTypes['updateVideo'][0]) { - return $this->updateVideoAsyncWithHttpInfo($id, $wt_video_update_params) + return $this->updateVideoAsyncWithHttpInfo($id, $wt_video_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -1635,14 +2055,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTVideoUpdateParams $wt_video_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateVideoAsyncWithHttpInfo($id, $wt_video_update_params) + public function updateVideoAsyncWithHttpInfo($id, $wt_video_update_params, string $contentType = self::contentTypes['updateVideo'][0]) { $returnType = '\OpenAPI\Client\Model\Video'; - $request = $this->updateVideoRequest($id, $wt_video_update_params); + $request = $this->updateVideoRequest($id, $wt_video_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1652,6 +2073,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1682,18 +2106,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTVideoUpdateParams $wt_video_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateVideo'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateVideoRequest($id, $wt_video_update_params) + public function updateVideoRequest($id, $wt_video_update_params, string $contentType = self::contentTypes['updateVideo'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateVideo' ); } + // verify the required parameter 'wt_video_update_params' is set if ($wt_video_update_params === null || (is_array($wt_video_update_params) && count($wt_video_update_params) === 0)) { throw new \InvalidArgumentException( @@ -1701,6 +2128,7 @@ public function updateVideoRequest($id, $wt_video_update_params) ); } + $resourcePath = '/v2/video/{id}'; $formParams = []; $queryParams = []; @@ -1720,21 +2148,17 @@ public function updateVideoRequest($id, $wt_video_update_params) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_video_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_video_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_video_update_params)); } else { $httpBody = $wt_video_update_params; } @@ -1753,12 +2177,12 @@ public function updateVideoRequest($id, $wt_video_update_params) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1774,10 +2198,11 @@ public function updateVideoRequest($id, $wt_video_update_params) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/VirtualBusinessCardApi.php b/lib/Api/VirtualBusinessCardApi.php index c8d8aeb..bbb04ce 100644 --- a/lib/Api/VirtualBusinessCardApi.php +++ b/lib/Api/VirtualBusinessCardApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'createVirtualBusinessCard' => [ + 'application/json', + ], + 'fetchAllVirtualBusinessCards' => [ + 'application/json', + ], + 'fetchVirtualBusinessCard' => [ + 'application/json', + ], + 'fetchVirtualBusinessCardRequests' => [ + 'application/json', + ], + 'restoreVirtualBusinessCard' => [ + 'application/json', + ], + 'updateVirtualBusinessCard' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +147,15 @@ public function getConfig() * Archive VirtualBusinessCard * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveVirtualBusinessCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\VirtualBusinessCard|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function archiveVirtualBusinessCard($id) + public function archiveVirtualBusinessCard($id, string $contentType = self::contentTypes['archiveVirtualBusinessCard'][0]) { - list($response) = $this->archiveVirtualBusinessCardWithHttpInfo($id); + list($response) = $this->archiveVirtualBusinessCardWithHttpInfo($id, $contentType); return $response; } @@ -139,14 +165,15 @@ public function archiveVirtualBusinessCard($id) * Archive VirtualBusinessCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveVirtualBusinessCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\VirtualBusinessCard|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function archiveVirtualBusinessCardWithHttpInfo($id) + public function archiveVirtualBusinessCardWithHttpInfo($id, string $contentType = self::contentTypes['archiveVirtualBusinessCard'][0]) { - $request = $this->archiveVirtualBusinessCardRequest($id); + $request = $this->archiveVirtualBusinessCardRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +216,21 @@ public function archiveVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\VirtualBusinessCard' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +243,21 @@ public function archiveVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +270,21 @@ public function archiveVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +297,21 @@ public function archiveVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +326,21 @@ public function archiveVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +394,14 @@ public function archiveVirtualBusinessCardWithHttpInfo($id) * Archive VirtualBusinessCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveVirtualBusinessCardAsync($id) + public function archiveVirtualBusinessCardAsync($id, string $contentType = self::contentTypes['archiveVirtualBusinessCard'][0]) { - return $this->archiveVirtualBusinessCardAsyncWithHttpInfo($id) + return $this->archiveVirtualBusinessCardAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +415,15 @@ function ($response) { * Archive VirtualBusinessCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function archiveVirtualBusinessCardAsyncWithHttpInfo($id) + public function archiveVirtualBusinessCardAsyncWithHttpInfo($id, string $contentType = self::contentTypes['archiveVirtualBusinessCard'][0]) { $returnType = '\OpenAPI\Client\Model\VirtualBusinessCard'; - $request = $this->archiveVirtualBusinessCardRequest($id); + $request = $this->archiveVirtualBusinessCardRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +433,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +465,14 @@ function ($exception) { * Create request for operation 'archiveVirtualBusinessCard' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['archiveVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function archiveVirtualBusinessCardRequest($id) + public function archiveVirtualBusinessCardRequest($id, string $contentType = self::contentTypes['archiveVirtualBusinessCard'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +480,7 @@ public function archiveVirtualBusinessCardRequest($id) ); } + $resourcePath = '/v2/virtualBusinessCard/{id}'; $formParams = []; $queryParams = []; @@ -390,16 +500,11 @@ public function archiveVirtualBusinessCardRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +522,12 @@ public function archiveVirtualBusinessCardRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +543,11 @@ public function archiveVirtualBusinessCardRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -453,14 +559,15 @@ public function archiveVirtualBusinessCardRequest($id) * Create VirtualBusinessCard * * @param \OpenAPI\Client\Model\WTVirtualBusinessCardCreateParams $wt_virtual_business_card_create_params wt_virtual_business_card_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVirtualBusinessCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\VirtualBusinessCard|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function createVirtualBusinessCard($wt_virtual_business_card_create_params) + public function createVirtualBusinessCard($wt_virtual_business_card_create_params, string $contentType = self::contentTypes['createVirtualBusinessCard'][0]) { - list($response) = $this->createVirtualBusinessCardWithHttpInfo($wt_virtual_business_card_create_params); + list($response) = $this->createVirtualBusinessCardWithHttpInfo($wt_virtual_business_card_create_params, $contentType); return $response; } @@ -470,14 +577,15 @@ public function createVirtualBusinessCard($wt_virtual_business_card_create_param * Create VirtualBusinessCard * * @param \OpenAPI\Client\Model\WTVirtualBusinessCardCreateParams $wt_virtual_business_card_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVirtualBusinessCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\VirtualBusinessCard|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function createVirtualBusinessCardWithHttpInfo($wt_virtual_business_card_create_params) + public function createVirtualBusinessCardWithHttpInfo($wt_virtual_business_card_create_params, string $contentType = self::contentTypes['createVirtualBusinessCard'][0]) { - $request = $this->createVirtualBusinessCardRequest($wt_virtual_business_card_create_params); + $request = $this->createVirtualBusinessCardRequest($wt_virtual_business_card_create_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -520,6 +628,21 @@ public function createVirtualBusinessCardWithHttpInfo($wt_virtual_business_card_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\VirtualBusinessCard' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -532,6 +655,21 @@ public function createVirtualBusinessCardWithHttpInfo($wt_virtual_business_card_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -544,6 +682,21 @@ public function createVirtualBusinessCardWithHttpInfo($wt_virtual_business_card_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -556,6 +709,21 @@ public function createVirtualBusinessCardWithHttpInfo($wt_virtual_business_card_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -570,6 +738,21 @@ public function createVirtualBusinessCardWithHttpInfo($wt_virtual_business_card_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -623,13 +806,14 @@ public function createVirtualBusinessCardWithHttpInfo($wt_virtual_business_card_ * Create VirtualBusinessCard * * @param \OpenAPI\Client\Model\WTVirtualBusinessCardCreateParams $wt_virtual_business_card_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createVirtualBusinessCardAsync($wt_virtual_business_card_create_params) + public function createVirtualBusinessCardAsync($wt_virtual_business_card_create_params, string $contentType = self::contentTypes['createVirtualBusinessCard'][0]) { - return $this->createVirtualBusinessCardAsyncWithHttpInfo($wt_virtual_business_card_create_params) + return $this->createVirtualBusinessCardAsyncWithHttpInfo($wt_virtual_business_card_create_params, $contentType) ->then( function ($response) { return $response[0]; @@ -643,14 +827,15 @@ function ($response) { * Create VirtualBusinessCard * * @param \OpenAPI\Client\Model\WTVirtualBusinessCardCreateParams $wt_virtual_business_card_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createVirtualBusinessCardAsyncWithHttpInfo($wt_virtual_business_card_create_params) + public function createVirtualBusinessCardAsyncWithHttpInfo($wt_virtual_business_card_create_params, string $contentType = self::contentTypes['createVirtualBusinessCard'][0]) { $returnType = '\OpenAPI\Client\Model\VirtualBusinessCard'; - $request = $this->createVirtualBusinessCardRequest($wt_virtual_business_card_create_params); + $request = $this->createVirtualBusinessCardRequest($wt_virtual_business_card_create_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -660,6 +845,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -689,12 +877,14 @@ function ($exception) { * Create request for operation 'createVirtualBusinessCard' * * @param \OpenAPI\Client\Model\WTVirtualBusinessCardCreateParams $wt_virtual_business_card_create_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createVirtualBusinessCardRequest($wt_virtual_business_card_create_params) + public function createVirtualBusinessCardRequest($wt_virtual_business_card_create_params, string $contentType = self::contentTypes['createVirtualBusinessCard'][0]) { + // verify the required parameter 'wt_virtual_business_card_create_params' is set if ($wt_virtual_business_card_create_params === null || (is_array($wt_virtual_business_card_create_params) && count($wt_virtual_business_card_create_params) === 0)) { throw new \InvalidArgumentException( @@ -702,6 +892,7 @@ public function createVirtualBusinessCardRequest($wt_virtual_business_card_creat ); } + $resourcePath = '/v2/virtualBusinessCard'; $formParams = []; $queryParams = []; @@ -713,21 +904,17 @@ public function createVirtualBusinessCardRequest($wt_virtual_business_card_creat - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_virtual_business_card_create_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_virtual_business_card_create_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_virtual_business_card_create_params)); } else { $httpBody = $wt_virtual_business_card_create_params; } @@ -746,12 +933,12 @@ public function createVirtualBusinessCardRequest($wt_virtual_business_card_creat // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -767,10 +954,11 @@ public function createVirtualBusinessCardRequest($wt_virtual_business_card_creat $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -782,14 +970,15 @@ public function createVirtualBusinessCardRequest($wt_virtual_business_card_creat * Fetch all VirtualBusinessCards * * @param bool $is_archive_included is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVirtualBusinessCards'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchAllVirtualBusinessCards($is_archive_included = null) + public function fetchAllVirtualBusinessCards($is_archive_included = null, string $contentType = self::contentTypes['fetchAllVirtualBusinessCards'][0]) { - list($response) = $this->fetchAllVirtualBusinessCardsWithHttpInfo($is_archive_included); + list($response) = $this->fetchAllVirtualBusinessCardsWithHttpInfo($is_archive_included, $contentType); return $response; } @@ -799,14 +988,15 @@ public function fetchAllVirtualBusinessCards($is_archive_included = null) * Fetch all VirtualBusinessCards * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVirtualBusinessCards'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchAllVirtualBusinessCardsWithHttpInfo($is_archive_included = null) + public function fetchAllVirtualBusinessCardsWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllVirtualBusinessCards'][0]) { - $request = $this->fetchAllVirtualBusinessCardsRequest($is_archive_included); + $request = $this->fetchAllVirtualBusinessCardsRequest($is_archive_included, $contentType); try { $options = $this->createHttpClientOption(); @@ -849,6 +1039,21 @@ public function fetchAllVirtualBusinessCardsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -861,6 +1066,21 @@ public function fetchAllVirtualBusinessCardsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -873,6 +1093,21 @@ public function fetchAllVirtualBusinessCardsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -885,6 +1120,21 @@ public function fetchAllVirtualBusinessCardsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -899,6 +1149,21 @@ public function fetchAllVirtualBusinessCardsWithHttpInfo($is_archive_included = $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -952,13 +1217,14 @@ public function fetchAllVirtualBusinessCardsWithHttpInfo($is_archive_included = * Fetch all VirtualBusinessCards * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVirtualBusinessCards'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllVirtualBusinessCardsAsync($is_archive_included = null) + public function fetchAllVirtualBusinessCardsAsync($is_archive_included = null, string $contentType = self::contentTypes['fetchAllVirtualBusinessCards'][0]) { - return $this->fetchAllVirtualBusinessCardsAsyncWithHttpInfo($is_archive_included) + return $this->fetchAllVirtualBusinessCardsAsyncWithHttpInfo($is_archive_included, $contentType) ->then( function ($response) { return $response[0]; @@ -972,14 +1238,15 @@ function ($response) { * Fetch all VirtualBusinessCards * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVirtualBusinessCards'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchAllVirtualBusinessCardsAsyncWithHttpInfo($is_archive_included = null) + public function fetchAllVirtualBusinessCardsAsyncWithHttpInfo($is_archive_included = null, string $contentType = self::contentTypes['fetchAllVirtualBusinessCards'][0]) { $returnType = 'mixed'; - $request = $this->fetchAllVirtualBusinessCardsRequest($is_archive_included); + $request = $this->fetchAllVirtualBusinessCardsRequest($is_archive_included, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -989,6 +1256,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1018,13 +1288,16 @@ function ($exception) { * Create request for operation 'fetchAllVirtualBusinessCards' * * @param bool $is_archive_included (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchAllVirtualBusinessCards'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchAllVirtualBusinessCardsRequest($is_archive_included = null) + public function fetchAllVirtualBusinessCardsRequest($is_archive_included = null, string $contentType = self::contentTypes['fetchAllVirtualBusinessCards'][0]) { + + $resourcePath = '/v2/virtualBusinessCard/all'; $formParams = []; $queryParams = []; @@ -1033,30 +1306,23 @@ public function fetchAllVirtualBusinessCardsRequest($is_archive_included = null) $multipart = false; // query params - if ($is_archive_included !== null) { - if('form' === 'form' && is_array($is_archive_included)) { - foreach($is_archive_included as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isArchiveIncluded'] = $is_archive_included; - } - } + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_archive_included, + 'isArchiveIncluded', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1074,12 +1340,12 @@ public function fetchAllVirtualBusinessCardsRequest($is_archive_included = null) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1095,10 +1361,11 @@ public function fetchAllVirtualBusinessCardsRequest($is_archive_included = null) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1110,14 +1377,15 @@ public function fetchAllVirtualBusinessCardsRequest($is_archive_included = null) * Fetch virtual business card * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVirtualBusinessCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\VirtualBusinessCard|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchVirtualBusinessCard($id) + public function fetchVirtualBusinessCard($id, string $contentType = self::contentTypes['fetchVirtualBusinessCard'][0]) { - list($response) = $this->fetchVirtualBusinessCardWithHttpInfo($id); + list($response) = $this->fetchVirtualBusinessCardWithHttpInfo($id, $contentType); return $response; } @@ -1127,14 +1395,15 @@ public function fetchVirtualBusinessCard($id) * Fetch virtual business card * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVirtualBusinessCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\VirtualBusinessCard|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchVirtualBusinessCardWithHttpInfo($id) + public function fetchVirtualBusinessCardWithHttpInfo($id, string $contentType = self::contentTypes['fetchVirtualBusinessCard'][0]) { - $request = $this->fetchVirtualBusinessCardRequest($id); + $request = $this->fetchVirtualBusinessCardRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1177,6 +1446,21 @@ public function fetchVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\VirtualBusinessCard' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1189,6 +1473,21 @@ public function fetchVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1201,6 +1500,21 @@ public function fetchVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1213,6 +1527,21 @@ public function fetchVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1227,6 +1556,21 @@ public function fetchVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1280,13 +1624,14 @@ public function fetchVirtualBusinessCardWithHttpInfo($id) * Fetch virtual business card * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchVirtualBusinessCardAsync($id) + public function fetchVirtualBusinessCardAsync($id, string $contentType = self::contentTypes['fetchVirtualBusinessCard'][0]) { - return $this->fetchVirtualBusinessCardAsyncWithHttpInfo($id) + return $this->fetchVirtualBusinessCardAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1300,14 +1645,15 @@ function ($response) { * Fetch virtual business card * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchVirtualBusinessCardAsyncWithHttpInfo($id) + public function fetchVirtualBusinessCardAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchVirtualBusinessCard'][0]) { $returnType = '\OpenAPI\Client\Model\VirtualBusinessCard'; - $request = $this->fetchVirtualBusinessCardRequest($id); + $request = $this->fetchVirtualBusinessCardRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1317,6 +1663,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1346,12 +1695,14 @@ function ($exception) { * Create request for operation 'fetchVirtualBusinessCard' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchVirtualBusinessCardRequest($id) + public function fetchVirtualBusinessCardRequest($id, string $contentType = self::contentTypes['fetchVirtualBusinessCard'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1359,6 +1710,7 @@ public function fetchVirtualBusinessCardRequest($id) ); } + $resourcePath = '/v2/virtualBusinessCard/{id}'; $formParams = []; $queryParams = []; @@ -1378,16 +1730,11 @@ public function fetchVirtualBusinessCardRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1405,12 +1752,12 @@ public function fetchVirtualBusinessCardRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1426,10 +1773,11 @@ public function fetchVirtualBusinessCardRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1441,14 +1789,15 @@ public function fetchVirtualBusinessCardRequest($id) * Fetch requests * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVirtualBusinessCardRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\WalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchVirtualBusinessCardRequests($id) + public function fetchVirtualBusinessCardRequests($id, string $contentType = self::contentTypes['fetchVirtualBusinessCardRequests'][0]) { - list($response) = $this->fetchVirtualBusinessCardRequestsWithHttpInfo($id); + list($response) = $this->fetchVirtualBusinessCardRequestsWithHttpInfo($id, $contentType); return $response; } @@ -1458,14 +1807,15 @@ public function fetchVirtualBusinessCardRequests($id) * Fetch requests * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVirtualBusinessCardRequests'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\WalletPageView[]|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchVirtualBusinessCardRequestsWithHttpInfo($id) + public function fetchVirtualBusinessCardRequestsWithHttpInfo($id, string $contentType = self::contentTypes['fetchVirtualBusinessCardRequests'][0]) { - $request = $this->fetchVirtualBusinessCardRequestsRequest($id); + $request = $this->fetchVirtualBusinessCardRequestsRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1508,6 +1858,21 @@ public function fetchVirtualBusinessCardRequestsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\WalletPageView[]' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1520,6 +1885,21 @@ public function fetchVirtualBusinessCardRequestsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1532,6 +1912,21 @@ public function fetchVirtualBusinessCardRequestsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1544,6 +1939,21 @@ public function fetchVirtualBusinessCardRequestsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1558,6 +1968,21 @@ public function fetchVirtualBusinessCardRequestsWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1611,13 +2036,14 @@ public function fetchVirtualBusinessCardRequestsWithHttpInfo($id) * Fetch requests * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVirtualBusinessCardRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchVirtualBusinessCardRequestsAsync($id) + public function fetchVirtualBusinessCardRequestsAsync($id, string $contentType = self::contentTypes['fetchVirtualBusinessCardRequests'][0]) { - return $this->fetchVirtualBusinessCardRequestsAsyncWithHttpInfo($id) + return $this->fetchVirtualBusinessCardRequestsAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1631,14 +2057,15 @@ function ($response) { * Fetch requests * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVirtualBusinessCardRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchVirtualBusinessCardRequestsAsyncWithHttpInfo($id) + public function fetchVirtualBusinessCardRequestsAsyncWithHttpInfo($id, string $contentType = self::contentTypes['fetchVirtualBusinessCardRequests'][0]) { $returnType = '\OpenAPI\Client\Model\WalletPageView[]'; - $request = $this->fetchVirtualBusinessCardRequestsRequest($id); + $request = $this->fetchVirtualBusinessCardRequestsRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1648,6 +2075,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1677,12 +2107,14 @@ function ($exception) { * Create request for operation 'fetchVirtualBusinessCardRequests' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchVirtualBusinessCardRequests'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchVirtualBusinessCardRequestsRequest($id) + public function fetchVirtualBusinessCardRequestsRequest($id, string $contentType = self::contentTypes['fetchVirtualBusinessCardRequests'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -1690,6 +2122,7 @@ public function fetchVirtualBusinessCardRequestsRequest($id) ); } + $resourcePath = '/v2/virtualBusinessCard/requests/{id}'; $formParams = []; $queryParams = []; @@ -1709,16 +2142,11 @@ public function fetchVirtualBusinessCardRequestsRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1736,12 +2164,12 @@ public function fetchVirtualBusinessCardRequestsRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1757,10 +2185,11 @@ public function fetchVirtualBusinessCardRequestsRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1772,14 +2201,15 @@ public function fetchVirtualBusinessCardRequestsRequest($id) * Restore VirtualBusinessCard * * @param mixed $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreVirtualBusinessCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\VirtualBusinessCard|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function restoreVirtualBusinessCard($id) + public function restoreVirtualBusinessCard($id, string $contentType = self::contentTypes['restoreVirtualBusinessCard'][0]) { - list($response) = $this->restoreVirtualBusinessCardWithHttpInfo($id); + list($response) = $this->restoreVirtualBusinessCardWithHttpInfo($id, $contentType); return $response; } @@ -1789,14 +2219,15 @@ public function restoreVirtualBusinessCard($id) * Restore VirtualBusinessCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreVirtualBusinessCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\VirtualBusinessCard|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function restoreVirtualBusinessCardWithHttpInfo($id) + public function restoreVirtualBusinessCardWithHttpInfo($id, string $contentType = self::contentTypes['restoreVirtualBusinessCard'][0]) { - $request = $this->restoreVirtualBusinessCardRequest($id); + $request = $this->restoreVirtualBusinessCardRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1839,6 +2270,21 @@ public function restoreVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\VirtualBusinessCard' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1851,6 +2297,21 @@ public function restoreVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1863,6 +2324,21 @@ public function restoreVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1875,6 +2351,21 @@ public function restoreVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1889,6 +2380,21 @@ public function restoreVirtualBusinessCardWithHttpInfo($id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -1942,13 +2448,14 @@ public function restoreVirtualBusinessCardWithHttpInfo($id) * Restore VirtualBusinessCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreVirtualBusinessCardAsync($id) + public function restoreVirtualBusinessCardAsync($id, string $contentType = self::contentTypes['restoreVirtualBusinessCard'][0]) { - return $this->restoreVirtualBusinessCardAsyncWithHttpInfo($id) + return $this->restoreVirtualBusinessCardAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -1962,14 +2469,15 @@ function ($response) { * Restore VirtualBusinessCard * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function restoreVirtualBusinessCardAsyncWithHttpInfo($id) + public function restoreVirtualBusinessCardAsyncWithHttpInfo($id, string $contentType = self::contentTypes['restoreVirtualBusinessCard'][0]) { $returnType = '\OpenAPI\Client\Model\VirtualBusinessCard'; - $request = $this->restoreVirtualBusinessCardRequest($id); + $request = $this->restoreVirtualBusinessCardRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1979,6 +2487,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2008,12 +2519,14 @@ function ($exception) { * Create request for operation 'restoreVirtualBusinessCard' * * @param mixed $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['restoreVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function restoreVirtualBusinessCardRequest($id) + public function restoreVirtualBusinessCardRequest($id, string $contentType = self::contentTypes['restoreVirtualBusinessCard'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( @@ -2021,6 +2534,7 @@ public function restoreVirtualBusinessCardRequest($id) ); } + $resourcePath = '/v2/virtualBusinessCard/{id}'; $formParams = []; $queryParams = []; @@ -2040,16 +2554,11 @@ public function restoreVirtualBusinessCardRequest($id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -2067,12 +2576,12 @@ public function restoreVirtualBusinessCardRequest($id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2088,10 +2597,11 @@ public function restoreVirtualBusinessCardRequest($id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2104,14 +2614,15 @@ public function restoreVirtualBusinessCardRequest($id) * * @param mixed $id id (required) * @param \OpenAPI\Client\Model\WTVirtualBusinessCardUpdateParams $wt_virtual_business_card_update_params wt_virtual_business_card_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateVirtualBusinessCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\VirtualBusinessCard|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function updateVirtualBusinessCard($id, $wt_virtual_business_card_update_params) + public function updateVirtualBusinessCard($id, $wt_virtual_business_card_update_params, string $contentType = self::contentTypes['updateVirtualBusinessCard'][0]) { - list($response) = $this->updateVirtualBusinessCardWithHttpInfo($id, $wt_virtual_business_card_update_params); + list($response) = $this->updateVirtualBusinessCardWithHttpInfo($id, $wt_virtual_business_card_update_params, $contentType); return $response; } @@ -2122,14 +2633,15 @@ public function updateVirtualBusinessCard($id, $wt_virtual_business_card_update_ * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTVirtualBusinessCardUpdateParams $wt_virtual_business_card_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateVirtualBusinessCard'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\VirtualBusinessCard|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function updateVirtualBusinessCardWithHttpInfo($id, $wt_virtual_business_card_update_params) + public function updateVirtualBusinessCardWithHttpInfo($id, $wt_virtual_business_card_update_params, string $contentType = self::contentTypes['updateVirtualBusinessCard'][0]) { - $request = $this->updateVirtualBusinessCardRequest($id, $wt_virtual_business_card_update_params); + $request = $this->updateVirtualBusinessCardRequest($id, $wt_virtual_business_card_update_params, $contentType); try { $options = $this->createHttpClientOption(); @@ -2172,6 +2684,21 @@ public function updateVirtualBusinessCardWithHttpInfo($id, $wt_virtual_business_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\VirtualBusinessCard' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2184,6 +2711,21 @@ public function updateVirtualBusinessCardWithHttpInfo($id, $wt_virtual_business_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2196,6 +2738,21 @@ public function updateVirtualBusinessCardWithHttpInfo($id, $wt_virtual_business_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2208,6 +2765,21 @@ public function updateVirtualBusinessCardWithHttpInfo($id, $wt_virtual_business_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2222,6 +2794,21 @@ public function updateVirtualBusinessCardWithHttpInfo($id, $wt_virtual_business_ $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -2276,13 +2863,14 @@ public function updateVirtualBusinessCardWithHttpInfo($id, $wt_virtual_business_ * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTVirtualBusinessCardUpdateParams $wt_virtual_business_card_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateVirtualBusinessCardAsync($id, $wt_virtual_business_card_update_params) + public function updateVirtualBusinessCardAsync($id, $wt_virtual_business_card_update_params, string $contentType = self::contentTypes['updateVirtualBusinessCard'][0]) { - return $this->updateVirtualBusinessCardAsyncWithHttpInfo($id, $wt_virtual_business_card_update_params) + return $this->updateVirtualBusinessCardAsyncWithHttpInfo($id, $wt_virtual_business_card_update_params, $contentType) ->then( function ($response) { return $response[0]; @@ -2297,14 +2885,15 @@ function ($response) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTVirtualBusinessCardUpdateParams $wt_virtual_business_card_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateVirtualBusinessCardAsyncWithHttpInfo($id, $wt_virtual_business_card_update_params) + public function updateVirtualBusinessCardAsyncWithHttpInfo($id, $wt_virtual_business_card_update_params, string $contentType = self::contentTypes['updateVirtualBusinessCard'][0]) { $returnType = '\OpenAPI\Client\Model\VirtualBusinessCard'; - $request = $this->updateVirtualBusinessCardRequest($id, $wt_virtual_business_card_update_params); + $request = $this->updateVirtualBusinessCardRequest($id, $wt_virtual_business_card_update_params, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2314,6 +2903,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -2344,18 +2936,21 @@ function ($exception) { * * @param mixed $id (required) * @param \OpenAPI\Client\Model\WTVirtualBusinessCardUpdateParams $wt_virtual_business_card_update_params (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateVirtualBusinessCard'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateVirtualBusinessCardRequest($id, $wt_virtual_business_card_update_params) + public function updateVirtualBusinessCardRequest($id, $wt_virtual_business_card_update_params, string $contentType = self::contentTypes['updateVirtualBusinessCard'][0]) { + // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling updateVirtualBusinessCard' ); } + // verify the required parameter 'wt_virtual_business_card_update_params' is set if ($wt_virtual_business_card_update_params === null || (is_array($wt_virtual_business_card_update_params) && count($wt_virtual_business_card_update_params) === 0)) { throw new \InvalidArgumentException( @@ -2363,6 +2958,7 @@ public function updateVirtualBusinessCardRequest($id, $wt_virtual_business_card_ ); } + $resourcePath = '/v2/virtualBusinessCard/{id}'; $formParams = []; $queryParams = []; @@ -2382,21 +2978,17 @@ public function updateVirtualBusinessCardRequest($id, $wt_virtual_business_card_ } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_virtual_business_card_update_params)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_virtual_business_card_update_params)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_virtual_business_card_update_params)); } else { $httpBody = $wt_virtual_business_card_update_params; } @@ -2415,12 +3007,12 @@ public function updateVirtualBusinessCardRequest($id, $wt_virtual_business_card_ // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -2436,10 +3028,11 @@ public function updateVirtualBusinessCardRequest($id, $wt_virtual_business_card_ $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/WebTerminalApi.php b/lib/Api/WebTerminalApi.php index 4ccb3aa..86d3f41 100644 --- a/lib/Api/WebTerminalApi.php +++ b/lib/Api/WebTerminalApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'redeemWalletItemFromWebTerminal' => [ + 'application/json', + ], + 'refundWalletItemFromWebTerminal' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +135,15 @@ public function getConfig() * Fetch item * * @param string $item_id item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWebTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchWalletItemFromWebTerminal($item_id) + public function fetchWalletItemFromWebTerminal($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWebTerminal'][0]) { - list($response) = $this->fetchWalletItemFromWebTerminalWithHttpInfo($item_id); + list($response) = $this->fetchWalletItemFromWebTerminalWithHttpInfo($item_id, $contentType); return $response; } @@ -139,14 +153,15 @@ public function fetchWalletItemFromWebTerminal($item_id) * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWebTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchWalletItemFromWebTerminalWithHttpInfo($item_id) + public function fetchWalletItemFromWebTerminalWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWebTerminal'][0]) { - $request = $this->fetchWalletItemFromWebTerminalRequest($item_id); + $request = $this->fetchWalletItemFromWebTerminalRequest($item_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +204,21 @@ public function fetchWalletItemFromWebTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +231,21 @@ public function fetchWalletItemFromWebTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +258,21 @@ public function fetchWalletItemFromWebTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +285,21 @@ public function fetchWalletItemFromWebTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +314,21 @@ public function fetchWalletItemFromWebTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +382,14 @@ public function fetchWalletItemFromWebTerminalWithHttpInfo($item_id) * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWebTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletItemFromWebTerminalAsync($item_id) + public function fetchWalletItemFromWebTerminalAsync($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWebTerminal'][0]) { - return $this->fetchWalletItemFromWebTerminalAsyncWithHttpInfo($item_id) + return $this->fetchWalletItemFromWebTerminalAsyncWithHttpInfo($item_id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +403,15 @@ function ($response) { * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWebTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletItemFromWebTerminalAsyncWithHttpInfo($item_id) + public function fetchWalletItemFromWebTerminalAsyncWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWebTerminal'][0]) { $returnType = 'mixed'; - $request = $this->fetchWalletItemFromWebTerminalRequest($item_id); + $request = $this->fetchWalletItemFromWebTerminalRequest($item_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +421,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +453,14 @@ function ($exception) { * Create request for operation 'fetchWalletItemFromWebTerminal' * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWebTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchWalletItemFromWebTerminalRequest($item_id) + public function fetchWalletItemFromWebTerminalRequest($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWebTerminal'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +468,7 @@ public function fetchWalletItemFromWebTerminalRequest($item_id) ); } + $resourcePath = '/v2/pos/web/item/{itemID}'; $formParams = []; $queryParams = []; @@ -390,16 +488,11 @@ public function fetchWalletItemFromWebTerminalRequest($item_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +510,12 @@ public function fetchWalletItemFromWebTerminalRequest($item_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +531,11 @@ public function fetchWalletItemFromWebTerminalRequest($item_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -454,14 +548,15 @@ public function fetchWalletItemFromWebTerminalRequest($item_id) * * @param string $item_id item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWebTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function redeemWalletItemFromWebTerminal($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWebTerminal($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWebTerminal'][0]) { - list($response) = $this->redeemWalletItemFromWebTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption); + list($response) = $this->redeemWalletItemFromWebTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption, $contentType); return $response; } @@ -472,14 +567,15 @@ public function redeemWalletItemFromWebTerminal($item_id, $wt_wallet_item_redemp * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWebTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function redeemWalletItemFromWebTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWebTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWebTerminal'][0]) { - $request = $this->redeemWalletItemFromWebTerminalRequest($item_id, $wt_wallet_item_redemption); + $request = $this->redeemWalletItemFromWebTerminalRequest($item_id, $wt_wallet_item_redemption, $contentType); try { $options = $this->createHttpClientOption(); @@ -522,6 +618,21 @@ public function redeemWalletItemFromWebTerminalWithHttpInfo($item_id, $wt_wallet $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -534,6 +645,21 @@ public function redeemWalletItemFromWebTerminalWithHttpInfo($item_id, $wt_wallet $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -546,6 +672,21 @@ public function redeemWalletItemFromWebTerminalWithHttpInfo($item_id, $wt_wallet $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -558,6 +699,21 @@ public function redeemWalletItemFromWebTerminalWithHttpInfo($item_id, $wt_wallet $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -572,6 +728,21 @@ public function redeemWalletItemFromWebTerminalWithHttpInfo($item_id, $wt_wallet $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -626,13 +797,14 @@ public function redeemWalletItemFromWebTerminalWithHttpInfo($item_id, $wt_wallet * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWebTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function redeemWalletItemFromWebTerminalAsync($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWebTerminalAsync($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWebTerminal'][0]) { - return $this->redeemWalletItemFromWebTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption) + return $this->redeemWalletItemFromWebTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption, $contentType) ->then( function ($response) { return $response[0]; @@ -647,14 +819,15 @@ function ($response) { * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWebTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function redeemWalletItemFromWebTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWebTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWebTerminal'][0]) { $returnType = 'mixed'; - $request = $this->redeemWalletItemFromWebTerminalRequest($item_id, $wt_wallet_item_redemption); + $request = $this->redeemWalletItemFromWebTerminalRequest($item_id, $wt_wallet_item_redemption, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -664,6 +837,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -694,18 +870,21 @@ function ($exception) { * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWebTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function redeemWalletItemFromWebTerminalRequest($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWebTerminalRequest($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWebTerminal'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $item_id when calling redeemWalletItemFromWebTerminal' ); } + // verify the required parameter 'wt_wallet_item_redemption' is set if ($wt_wallet_item_redemption === null || (is_array($wt_wallet_item_redemption) && count($wt_wallet_item_redemption) === 0)) { throw new \InvalidArgumentException( @@ -713,6 +892,7 @@ public function redeemWalletItemFromWebTerminalRequest($item_id, $wt_wallet_item ); } + $resourcePath = '/v2/pos/web/item/redeem/{itemID}'; $formParams = []; $queryParams = []; @@ -732,21 +912,17 @@ public function redeemWalletItemFromWebTerminalRequest($item_id, $wt_wallet_item } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_wallet_item_redemption)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_wallet_item_redemption)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_wallet_item_redemption)); } else { $httpBody = $wt_wallet_item_redemption; } @@ -765,12 +941,12 @@ public function redeemWalletItemFromWebTerminalRequest($item_id, $wt_wallet_item // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -786,10 +962,11 @@ public function redeemWalletItemFromWebTerminalRequest($item_id, $wt_wallet_item $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -801,14 +978,15 @@ public function redeemWalletItemFromWebTerminalRequest($item_id, $wt_wallet_item * Refund transaction * * @param string $ledger_entry_id ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWebTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function refundWalletItemFromWebTerminal($ledger_entry_id) + public function refundWalletItemFromWebTerminal($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWebTerminal'][0]) { - list($response) = $this->refundWalletItemFromWebTerminalWithHttpInfo($ledger_entry_id); + list($response) = $this->refundWalletItemFromWebTerminalWithHttpInfo($ledger_entry_id, $contentType); return $response; } @@ -818,14 +996,15 @@ public function refundWalletItemFromWebTerminal($ledger_entry_id) * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWebTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function refundWalletItemFromWebTerminalWithHttpInfo($ledger_entry_id) + public function refundWalletItemFromWebTerminalWithHttpInfo($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWebTerminal'][0]) { - $request = $this->refundWalletItemFromWebTerminalRequest($ledger_entry_id); + $request = $this->refundWalletItemFromWebTerminalRequest($ledger_entry_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -868,6 +1047,21 @@ public function refundWalletItemFromWebTerminalWithHttpInfo($ledger_entry_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -880,6 +1074,21 @@ public function refundWalletItemFromWebTerminalWithHttpInfo($ledger_entry_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -892,6 +1101,21 @@ public function refundWalletItemFromWebTerminalWithHttpInfo($ledger_entry_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -904,6 +1128,21 @@ public function refundWalletItemFromWebTerminalWithHttpInfo($ledger_entry_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -918,6 +1157,21 @@ public function refundWalletItemFromWebTerminalWithHttpInfo($ledger_entry_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -971,13 +1225,14 @@ public function refundWalletItemFromWebTerminalWithHttpInfo($ledger_entry_id) * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWebTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function refundWalletItemFromWebTerminalAsync($ledger_entry_id) + public function refundWalletItemFromWebTerminalAsync($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWebTerminal'][0]) { - return $this->refundWalletItemFromWebTerminalAsyncWithHttpInfo($ledger_entry_id) + return $this->refundWalletItemFromWebTerminalAsyncWithHttpInfo($ledger_entry_id, $contentType) ->then( function ($response) { return $response[0]; @@ -991,14 +1246,15 @@ function ($response) { * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWebTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function refundWalletItemFromWebTerminalAsyncWithHttpInfo($ledger_entry_id) + public function refundWalletItemFromWebTerminalAsyncWithHttpInfo($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWebTerminal'][0]) { $returnType = 'mixed'; - $request = $this->refundWalletItemFromWebTerminalRequest($ledger_entry_id); + $request = $this->refundWalletItemFromWebTerminalRequest($ledger_entry_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1008,6 +1264,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1037,12 +1296,14 @@ function ($exception) { * Create request for operation 'refundWalletItemFromWebTerminal' * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWebTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function refundWalletItemFromWebTerminalRequest($ledger_entry_id) + public function refundWalletItemFromWebTerminalRequest($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWebTerminal'][0]) { + // verify the required parameter 'ledger_entry_id' is set if ($ledger_entry_id === null || (is_array($ledger_entry_id) && count($ledger_entry_id) === 0)) { throw new \InvalidArgumentException( @@ -1058,7 +1319,7 @@ public function refundWalletItemFromWebTerminalRequest($ledger_entry_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $ledger_entry_id)) { throw new \InvalidArgumentException("invalid value for \"ledger_entry_id\" when calling WebTerminalApi.refundWalletItemFromWebTerminal, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/pos/web/item/refund/{ledgerEntryID}'; $formParams = []; @@ -1079,16 +1340,11 @@ public function refundWalletItemFromWebTerminalRequest($ledger_entry_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1106,12 +1362,12 @@ public function refundWalletItemFromWebTerminalRequest($ledger_entry_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1127,10 +1383,11 @@ public function refundWalletItemFromWebTerminalRequest($ledger_entry_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/WixTerminalApi.php b/lib/Api/WixTerminalApi.php index 2d424a3..44e878b 100644 --- a/lib/Api/WixTerminalApi.php +++ b/lib/Api/WixTerminalApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'redeemWalletItemFromWixTerminal' => [ + 'application/json', + ], + 'refundWalletItemFromWixTerminal' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +135,15 @@ public function getConfig() * Fetch item * * @param string $item_id item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWixTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchWalletItemFromWixTerminal($item_id) + public function fetchWalletItemFromWixTerminal($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWixTerminal'][0]) { - list($response) = $this->fetchWalletItemFromWixTerminalWithHttpInfo($item_id); + list($response) = $this->fetchWalletItemFromWixTerminalWithHttpInfo($item_id, $contentType); return $response; } @@ -139,14 +153,15 @@ public function fetchWalletItemFromWixTerminal($item_id) * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWixTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchWalletItemFromWixTerminalWithHttpInfo($item_id) + public function fetchWalletItemFromWixTerminalWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWixTerminal'][0]) { - $request = $this->fetchWalletItemFromWixTerminalRequest($item_id); + $request = $this->fetchWalletItemFromWixTerminalRequest($item_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +204,21 @@ public function fetchWalletItemFromWixTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +231,21 @@ public function fetchWalletItemFromWixTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +258,21 @@ public function fetchWalletItemFromWixTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +285,21 @@ public function fetchWalletItemFromWixTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +314,21 @@ public function fetchWalletItemFromWixTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +382,14 @@ public function fetchWalletItemFromWixTerminalWithHttpInfo($item_id) * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWixTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletItemFromWixTerminalAsync($item_id) + public function fetchWalletItemFromWixTerminalAsync($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWixTerminal'][0]) { - return $this->fetchWalletItemFromWixTerminalAsyncWithHttpInfo($item_id) + return $this->fetchWalletItemFromWixTerminalAsyncWithHttpInfo($item_id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +403,15 @@ function ($response) { * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWixTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletItemFromWixTerminalAsyncWithHttpInfo($item_id) + public function fetchWalletItemFromWixTerminalAsyncWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWixTerminal'][0]) { $returnType = 'mixed'; - $request = $this->fetchWalletItemFromWixTerminalRequest($item_id); + $request = $this->fetchWalletItemFromWixTerminalRequest($item_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +421,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +453,14 @@ function ($exception) { * Create request for operation 'fetchWalletItemFromWixTerminal' * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWixTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchWalletItemFromWixTerminalRequest($item_id) + public function fetchWalletItemFromWixTerminalRequest($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWixTerminal'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +468,7 @@ public function fetchWalletItemFromWixTerminalRequest($item_id) ); } + $resourcePath = '/v2/pos/wix/item/{itemID}'; $formParams = []; $queryParams = []; @@ -390,16 +488,11 @@ public function fetchWalletItemFromWixTerminalRequest($item_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +510,12 @@ public function fetchWalletItemFromWixTerminalRequest($item_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +531,11 @@ public function fetchWalletItemFromWixTerminalRequest($item_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -454,14 +548,15 @@ public function fetchWalletItemFromWixTerminalRequest($item_id) * * @param string $item_id item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWixTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function redeemWalletItemFromWixTerminal($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWixTerminal($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWixTerminal'][0]) { - list($response) = $this->redeemWalletItemFromWixTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption); + list($response) = $this->redeemWalletItemFromWixTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption, $contentType); return $response; } @@ -472,14 +567,15 @@ public function redeemWalletItemFromWixTerminal($item_id, $wt_wallet_item_redemp * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWixTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function redeemWalletItemFromWixTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWixTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWixTerminal'][0]) { - $request = $this->redeemWalletItemFromWixTerminalRequest($item_id, $wt_wallet_item_redemption); + $request = $this->redeemWalletItemFromWixTerminalRequest($item_id, $wt_wallet_item_redemption, $contentType); try { $options = $this->createHttpClientOption(); @@ -522,6 +618,21 @@ public function redeemWalletItemFromWixTerminalWithHttpInfo($item_id, $wt_wallet $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -534,6 +645,21 @@ public function redeemWalletItemFromWixTerminalWithHttpInfo($item_id, $wt_wallet $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -546,6 +672,21 @@ public function redeemWalletItemFromWixTerminalWithHttpInfo($item_id, $wt_wallet $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -558,6 +699,21 @@ public function redeemWalletItemFromWixTerminalWithHttpInfo($item_id, $wt_wallet $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -572,6 +728,21 @@ public function redeemWalletItemFromWixTerminalWithHttpInfo($item_id, $wt_wallet $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -626,13 +797,14 @@ public function redeemWalletItemFromWixTerminalWithHttpInfo($item_id, $wt_wallet * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWixTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function redeemWalletItemFromWixTerminalAsync($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWixTerminalAsync($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWixTerminal'][0]) { - return $this->redeemWalletItemFromWixTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption) + return $this->redeemWalletItemFromWixTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption, $contentType) ->then( function ($response) { return $response[0]; @@ -647,14 +819,15 @@ function ($response) { * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWixTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function redeemWalletItemFromWixTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWixTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWixTerminal'][0]) { $returnType = 'mixed'; - $request = $this->redeemWalletItemFromWixTerminalRequest($item_id, $wt_wallet_item_redemption); + $request = $this->redeemWalletItemFromWixTerminalRequest($item_id, $wt_wallet_item_redemption, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -664,6 +837,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -694,18 +870,21 @@ function ($exception) { * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWixTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function redeemWalletItemFromWixTerminalRequest($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWixTerminalRequest($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWixTerminal'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $item_id when calling redeemWalletItemFromWixTerminal' ); } + // verify the required parameter 'wt_wallet_item_redemption' is set if ($wt_wallet_item_redemption === null || (is_array($wt_wallet_item_redemption) && count($wt_wallet_item_redemption) === 0)) { throw new \InvalidArgumentException( @@ -713,6 +892,7 @@ public function redeemWalletItemFromWixTerminalRequest($item_id, $wt_wallet_item ); } + $resourcePath = '/v2/pos/wix/item/redeem/{itemID}'; $formParams = []; $queryParams = []; @@ -732,21 +912,17 @@ public function redeemWalletItemFromWixTerminalRequest($item_id, $wt_wallet_item } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_wallet_item_redemption)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_wallet_item_redemption)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_wallet_item_redemption)); } else { $httpBody = $wt_wallet_item_redemption; } @@ -765,12 +941,12 @@ public function redeemWalletItemFromWixTerminalRequest($item_id, $wt_wallet_item // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -786,10 +962,11 @@ public function redeemWalletItemFromWixTerminalRequest($item_id, $wt_wallet_item $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -801,14 +978,15 @@ public function redeemWalletItemFromWixTerminalRequest($item_id, $wt_wallet_item * Refund transaction * * @param string $ledger_entry_id ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWixTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function refundWalletItemFromWixTerminal($ledger_entry_id) + public function refundWalletItemFromWixTerminal($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWixTerminal'][0]) { - list($response) = $this->refundWalletItemFromWixTerminalWithHttpInfo($ledger_entry_id); + list($response) = $this->refundWalletItemFromWixTerminalWithHttpInfo($ledger_entry_id, $contentType); return $response; } @@ -818,14 +996,15 @@ public function refundWalletItemFromWixTerminal($ledger_entry_id) * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWixTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function refundWalletItemFromWixTerminalWithHttpInfo($ledger_entry_id) + public function refundWalletItemFromWixTerminalWithHttpInfo($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWixTerminal'][0]) { - $request = $this->refundWalletItemFromWixTerminalRequest($ledger_entry_id); + $request = $this->refundWalletItemFromWixTerminalRequest($ledger_entry_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -868,6 +1047,21 @@ public function refundWalletItemFromWixTerminalWithHttpInfo($ledger_entry_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -880,6 +1074,21 @@ public function refundWalletItemFromWixTerminalWithHttpInfo($ledger_entry_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -892,6 +1101,21 @@ public function refundWalletItemFromWixTerminalWithHttpInfo($ledger_entry_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -904,6 +1128,21 @@ public function refundWalletItemFromWixTerminalWithHttpInfo($ledger_entry_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -918,6 +1157,21 @@ public function refundWalletItemFromWixTerminalWithHttpInfo($ledger_entry_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -971,13 +1225,14 @@ public function refundWalletItemFromWixTerminalWithHttpInfo($ledger_entry_id) * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWixTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function refundWalletItemFromWixTerminalAsync($ledger_entry_id) + public function refundWalletItemFromWixTerminalAsync($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWixTerminal'][0]) { - return $this->refundWalletItemFromWixTerminalAsyncWithHttpInfo($ledger_entry_id) + return $this->refundWalletItemFromWixTerminalAsyncWithHttpInfo($ledger_entry_id, $contentType) ->then( function ($response) { return $response[0]; @@ -991,14 +1246,15 @@ function ($response) { * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWixTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function refundWalletItemFromWixTerminalAsyncWithHttpInfo($ledger_entry_id) + public function refundWalletItemFromWixTerminalAsyncWithHttpInfo($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWixTerminal'][0]) { $returnType = 'mixed'; - $request = $this->refundWalletItemFromWixTerminalRequest($ledger_entry_id); + $request = $this->refundWalletItemFromWixTerminalRequest($ledger_entry_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1008,6 +1264,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1037,12 +1296,14 @@ function ($exception) { * Create request for operation 'refundWalletItemFromWixTerminal' * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWixTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function refundWalletItemFromWixTerminalRequest($ledger_entry_id) + public function refundWalletItemFromWixTerminalRequest($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWixTerminal'][0]) { + // verify the required parameter 'ledger_entry_id' is set if ($ledger_entry_id === null || (is_array($ledger_entry_id) && count($ledger_entry_id) === 0)) { throw new \InvalidArgumentException( @@ -1058,7 +1319,7 @@ public function refundWalletItemFromWixTerminalRequest($ledger_entry_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $ledger_entry_id)) { throw new \InvalidArgumentException("invalid value for \"ledger_entry_id\" when calling WixTerminalApi.refundWalletItemFromWixTerminal, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/pos/wix/item/refund/{ledgerEntryID}'; $formParams = []; @@ -1079,16 +1340,11 @@ public function refundWalletItemFromWixTerminalRequest($ledger_entry_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1106,12 +1362,12 @@ public function refundWalletItemFromWixTerminalRequest($ledger_entry_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1127,10 +1383,11 @@ public function refundWalletItemFromWixTerminalRequest($ledger_entry_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/Api/WooCommerceTerminalApi.php b/lib/Api/WooCommerceTerminalApi.php index 7b64797..92ac6c1 100644 --- a/lib/Api/WooCommerceTerminalApi.php +++ b/lib/Api/WooCommerceTerminalApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], + 'redeemWalletItemFromWooCommerceTerminal' => [ + 'application/json', + ], + 'refundWalletItemFromWooCommerceTerminal' => [ + 'application/json', + ], + ]; + /** * @param ClientInterface $client * @param Configuration $config @@ -122,14 +135,15 @@ public function getConfig() * Fetch item * * @param string $item_id item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function fetchWalletItemFromWooCommerceTerminal($item_id) + public function fetchWalletItemFromWooCommerceTerminal($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWooCommerceTerminal'][0]) { - list($response) = $this->fetchWalletItemFromWooCommerceTerminalWithHttpInfo($item_id); + list($response) = $this->fetchWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, $contentType); return $response; } @@ -139,14 +153,15 @@ public function fetchWalletItemFromWooCommerceTerminal($item_id) * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function fetchWalletItemFromWooCommerceTerminalWithHttpInfo($item_id) + public function fetchWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWooCommerceTerminal'][0]) { - $request = $this->fetchWalletItemFromWooCommerceTerminalRequest($item_id); + $request = $this->fetchWalletItemFromWooCommerceTerminalRequest($item_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -189,6 +204,21 @@ public function fetchWalletItemFromWooCommerceTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -201,6 +231,21 @@ public function fetchWalletItemFromWooCommerceTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -213,6 +258,21 @@ public function fetchWalletItemFromWooCommerceTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -225,6 +285,21 @@ public function fetchWalletItemFromWooCommerceTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -239,6 +314,21 @@ public function fetchWalletItemFromWooCommerceTerminalWithHttpInfo($item_id) $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -292,13 +382,14 @@ public function fetchWalletItemFromWooCommerceTerminalWithHttpInfo($item_id) * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletItemFromWooCommerceTerminalAsync($item_id) + public function fetchWalletItemFromWooCommerceTerminalAsync($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWooCommerceTerminal'][0]) { - return $this->fetchWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($item_id) + return $this->fetchWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($item_id, $contentType) ->then( function ($response) { return $response[0]; @@ -312,14 +403,15 @@ function ($response) { * Fetch item * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fetchWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($item_id) + public function fetchWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWooCommerceTerminal'][0]) { $returnType = 'mixed'; - $request = $this->fetchWalletItemFromWooCommerceTerminalRequest($item_id); + $request = $this->fetchWalletItemFromWooCommerceTerminalRequest($item_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -329,6 +421,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -358,12 +453,14 @@ function ($exception) { * Create request for operation 'fetchWalletItemFromWooCommerceTerminal' * * @param string $item_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['fetchWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function fetchWalletItemFromWooCommerceTerminalRequest($item_id) + public function fetchWalletItemFromWooCommerceTerminalRequest($item_id, string $contentType = self::contentTypes['fetchWalletItemFromWooCommerceTerminal'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( @@ -371,6 +468,7 @@ public function fetchWalletItemFromWooCommerceTerminalRequest($item_id) ); } + $resourcePath = '/v2/pos/woocommerce/item/{itemID}'; $formParams = []; $queryParams = []; @@ -390,16 +488,11 @@ public function fetchWalletItemFromWooCommerceTerminalRequest($item_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -417,12 +510,12 @@ public function fetchWalletItemFromWooCommerceTerminalRequest($item_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -438,10 +531,11 @@ public function fetchWalletItemFromWooCommerceTerminalRequest($item_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -454,14 +548,15 @@ public function fetchWalletItemFromWooCommerceTerminalRequest($item_id) * * @param string $item_id item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function redeemWalletItemFromWooCommerceTerminal($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWooCommerceTerminal($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWooCommerceTerminal'][0]) { - list($response) = $this->redeemWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption); + list($response) = $this->redeemWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption, $contentType); return $response; } @@ -472,14 +567,15 @@ public function redeemWalletItemFromWooCommerceTerminal($item_id, $wt_wallet_ite * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function redeemWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWooCommerceTerminal'][0]) { - $request = $this->redeemWalletItemFromWooCommerceTerminalRequest($item_id, $wt_wallet_item_redemption); + $request = $this->redeemWalletItemFromWooCommerceTerminalRequest($item_id, $wt_wallet_item_redemption, $contentType); try { $options = $this->createHttpClientOption(); @@ -522,6 +618,21 @@ public function redeemWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, $w $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -534,6 +645,21 @@ public function redeemWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, $w $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -546,6 +672,21 @@ public function redeemWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, $w $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -558,6 +699,21 @@ public function redeemWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, $w $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -572,6 +728,21 @@ public function redeemWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, $w $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -626,13 +797,14 @@ public function redeemWalletItemFromWooCommerceTerminalWithHttpInfo($item_id, $w * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function redeemWalletItemFromWooCommerceTerminalAsync($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWooCommerceTerminalAsync($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWooCommerceTerminal'][0]) { - return $this->redeemWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption) + return $this->redeemWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption, $contentType) ->then( function ($response) { return $response[0]; @@ -647,14 +819,15 @@ function ($response) { * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function redeemWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWooCommerceTerminal'][0]) { $returnType = 'mixed'; - $request = $this->redeemWalletItemFromWooCommerceTerminalRequest($item_id, $wt_wallet_item_redemption); + $request = $this->redeemWalletItemFromWooCommerceTerminalRequest($item_id, $wt_wallet_item_redemption, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -664,6 +837,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -694,18 +870,21 @@ function ($exception) { * * @param string $item_id (required) * @param \OpenAPI\Client\Model\WTWalletItemRedemption $wt_wallet_item_redemption (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['redeemWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function redeemWalletItemFromWooCommerceTerminalRequest($item_id, $wt_wallet_item_redemption) + public function redeemWalletItemFromWooCommerceTerminalRequest($item_id, $wt_wallet_item_redemption, string $contentType = self::contentTypes['redeemWalletItemFromWooCommerceTerminal'][0]) { + // verify the required parameter 'item_id' is set if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $item_id when calling redeemWalletItemFromWooCommerceTerminal' ); } + // verify the required parameter 'wt_wallet_item_redemption' is set if ($wt_wallet_item_redemption === null || (is_array($wt_wallet_item_redemption) && count($wt_wallet_item_redemption) === 0)) { throw new \InvalidArgumentException( @@ -713,6 +892,7 @@ public function redeemWalletItemFromWooCommerceTerminalRequest($item_id, $wt_wal ); } + $resourcePath = '/v2/pos/woocommerce/item/redeem/{itemID}'; $formParams = []; $queryParams = []; @@ -732,21 +912,17 @@ public function redeemWalletItemFromWooCommerceTerminalRequest($item_id, $wt_wal } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (isset($wt_wallet_item_redemption)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($wt_wallet_item_redemption)); + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($wt_wallet_item_redemption)); } else { $httpBody = $wt_wallet_item_redemption; } @@ -765,12 +941,12 @@ public function redeemWalletItemFromWooCommerceTerminalRequest($item_id, $wt_wal // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -786,10 +962,11 @@ public function redeemWalletItemFromWooCommerceTerminalRequest($item_id, $wt_wal $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -801,14 +978,15 @@ public function redeemWalletItemFromWooCommerceTerminalRequest($item_id, $wt_wal * Refund transaction * * @param string $ledger_entry_id ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError */ - public function refundWalletItemFromWooCommerceTerminal($ledger_entry_id) + public function refundWalletItemFromWooCommerceTerminal($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWooCommerceTerminal'][0]) { - list($response) = $this->refundWalletItemFromWooCommerceTerminalWithHttpInfo($ledger_entry_id); + list($response) = $this->refundWalletItemFromWooCommerceTerminalWithHttpInfo($ledger_entry_id, $contentType); return $response; } @@ -818,14 +996,15 @@ public function refundWalletItemFromWooCommerceTerminal($ledger_entry_id) * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * - * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \OpenAPI\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of mixed|\OpenAPI\Client\Model\AuthError|\OpenAPI\Client\Model\FalsumError|\OpenAPI\Client\Model\InternalServerError, HTTP status code, HTTP response headers (array of strings) */ - public function refundWalletItemFromWooCommerceTerminalWithHttpInfo($ledger_entry_id) + public function refundWalletItemFromWooCommerceTerminalWithHttpInfo($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWooCommerceTerminal'][0]) { - $request = $this->refundWalletItemFromWooCommerceTerminalRequest($ledger_entry_id); + $request = $this->refundWalletItemFromWooCommerceTerminalRequest($ledger_entry_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -868,6 +1047,21 @@ public function refundWalletItemFromWooCommerceTerminalWithHttpInfo($ledger_entr $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('mixed' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -880,6 +1074,21 @@ public function refundWalletItemFromWooCommerceTerminalWithHttpInfo($ledger_entr $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\AuthError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -892,6 +1101,21 @@ public function refundWalletItemFromWooCommerceTerminalWithHttpInfo($ledger_entr $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\FalsumError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -904,6 +1128,21 @@ public function refundWalletItemFromWooCommerceTerminalWithHttpInfo($ledger_entr $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ('\OpenAPI\Client\Model\InternalServerError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -918,6 +1157,21 @@ public function refundWalletItemFromWooCommerceTerminalWithHttpInfo($ledger_entr $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } } return [ @@ -971,13 +1225,14 @@ public function refundWalletItemFromWooCommerceTerminalWithHttpInfo($ledger_entr * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function refundWalletItemFromWooCommerceTerminalAsync($ledger_entry_id) + public function refundWalletItemFromWooCommerceTerminalAsync($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWooCommerceTerminal'][0]) { - return $this->refundWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($ledger_entry_id) + return $this->refundWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($ledger_entry_id, $contentType) ->then( function ($response) { return $response[0]; @@ -991,14 +1246,15 @@ function ($response) { * Refund transaction * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function refundWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($ledger_entry_id) + public function refundWalletItemFromWooCommerceTerminalAsyncWithHttpInfo($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWooCommerceTerminal'][0]) { $returnType = 'mixed'; - $request = $this->refundWalletItemFromWooCommerceTerminalRequest($ledger_entry_id); + $request = $this->refundWalletItemFromWooCommerceTerminalRequest($ledger_entry_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1008,6 +1264,9 @@ function ($response) use ($returnType) { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } } return [ @@ -1037,12 +1296,14 @@ function ($exception) { * Create request for operation 'refundWalletItemFromWooCommerceTerminal' * * @param string $ledger_entry_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['refundWalletItemFromWooCommerceTerminal'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function refundWalletItemFromWooCommerceTerminalRequest($ledger_entry_id) + public function refundWalletItemFromWooCommerceTerminalRequest($ledger_entry_id, string $contentType = self::contentTypes['refundWalletItemFromWooCommerceTerminal'][0]) { + // verify the required parameter 'ledger_entry_id' is set if ($ledger_entry_id === null || (is_array($ledger_entry_id) && count($ledger_entry_id) === 0)) { throw new \InvalidArgumentException( @@ -1058,7 +1319,7 @@ public function refundWalletItemFromWooCommerceTerminalRequest($ledger_entry_id) if (!preg_match("/^[a-zA-Z0-9]+$/", $ledger_entry_id)) { throw new \InvalidArgumentException("invalid value for \"ledger_entry_id\" when calling WooCommerceTerminalApi.refundWalletItemFromWooCommerceTerminal, must conform to the pattern /^[a-zA-Z0-9]+$/."); } - + $resourcePath = '/v2/pos/woocommerce/item/refund/{ledgerEntryID}'; $formParams = []; @@ -1079,16 +1340,11 @@ public function refundWalletItemFromWooCommerceTerminalRequest($ledger_entry_id) } - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); - } + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); // for model (json/xml) if (count($formParams) > 0) { @@ -1106,12 +1362,12 @@ public function refundWalletItemFromWooCommerceTerminalRequest($ledger_entry_id) // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + $httpBody = ObjectSerializer::buildQuery($formParams); } } @@ -1127,10 +1383,11 @@ public function refundWalletItemFromWooCommerceTerminalRequest($ledger_entry_id) $headers ); - $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/lib/ApiException.php b/lib/ApiException.php index db13830..f26cca8 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -1,7 +1,7 @@ accessToken; } + /** + * Sets boolean format for query string. + * + * @param string $booleanFormat Boolean format for query string + * + * @return $this + */ + public function setBooleanFormatForQueryString(string $booleanFormat) + { + $this->booleanFormatForQueryString = $booleanFormat; + + return $this; + } + + /** + * Gets boolean format for query string. + * + * @return string Boolean format for query string + */ + public function getBooleanFormatForQueryString(): string + { + return $this->booleanFormatForQueryString; + } + /** * Sets the username for HTTP basic authentication * @@ -399,7 +433,7 @@ public static function toDebugReport() $report = 'PHP SDK (OpenAPI\Client) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 2.1.535' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 2.1.600' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; @@ -446,32 +480,31 @@ public function getHostSettings() } /** - * Returns URL based on the index and variables - * - * @param int $index index of the host settings - * @param array|null $variables hash of variable and the corresponding value (optional) - * @return string URL based on host settings - */ - public function getHostFromSettings($index, $variables = null) + * Returns URL based on host settings, index and variables + * + * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients + * @param int $hostIndex index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public static function getHostString(array $hostSettings, $hostIndex, array $variables = null) { if (null === $variables) { $variables = []; } - $hosts = $this->getHostSettings(); - // check array index out of bound - if ($index < 0 || $index >= sizeof($hosts)) { - throw new \InvalidArgumentException("Invalid index $index when selecting the host. Must be less than ".sizeof($hosts)); + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings)); } - $host = $hosts[$index]; + $host = $hostSettings[$hostIndex]; $url = $host["url"]; // go through variable and assign a value foreach ($host["variables"] ?? [] as $name => $variable) { if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum $url = str_replace("{".$name."}", $variables[$name], $url); } else { throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); @@ -484,4 +517,16 @@ public function getHostFromSettings($index, $variables = null) return $url; } + + /** + * Returns URL based on the index and variables + * + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public function getHostFromSettings($index, $variables = null) + { + return self::getHostString($this->getHostSettings(), $index, $variables); + } } diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index 63e5169..049f253 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -1,7 +1,7 @@ selectContentTypeHeader($contentTypes); - return $headers; - } + if (!$isMultipart) { + if($contentType === '') { + $contentType = 'application/json'; + } - /** - * @param string[] $accept - * @return array - */ - public function selectHeadersForMultipart($accept) - { - $headers = $this->selectHeaders($accept, []); + $headers['Content-Type'] = $contentType; + } - unset($headers['Content-Type']); return $headers; } /** - * Return the header 'Accept' based on an array of Accept provided + * Return the header 'Accept' based on an array of Accept provided. * * @param string[] $accept Array of header * * @return null|string Accept (e.g. application/json) */ - private function selectAcceptHeader($accept) + private function selectAcceptHeader(array $accept): ?string { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + # filter out empty entries + $accept = array_filter($accept); + + if (count($accept) === 0) { return null; - } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { - return implode(',', $jsonAccept); - } else { + } + + # If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + # If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept); + if (count($headersWithJson) === 0) { return implode(',', $accept); } + + # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + # to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); } /** - * Return the content type based on an array of content-type provided + * Create an Accept header string from the given "Accept" headers array, recalculating all weights + * + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" + * + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") + */ + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string + { + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } + } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); + } + + /** + * Given an Accept header, returns an associative array splitting the header and its weight * - * @param string[] $contentType Array fo content-type + * @param string $header "Accept" Header * - * @return string Content-Type (e.g. application/json) + * @return array with the header and its weight */ - private function selectContentTypeHeader($contentType) + private function getHeaderAndWeight(string $header): array { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $contentType)) { - return 'application/json'; + # matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; } else { - return implode(',', $contentType); + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; } + + return $headerData; + } + + /** + * @param array[] $headers + * @param float $currentWeight + * @param bool $hasMoreThan28Headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) + { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + /** + * @param string $header + * @param int $weight + * @return string + */ + private function buildAcceptHeader(string $header, int $weight): string + { + if($weight === 1000) { + return $header; + } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); + } + + /** + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) + * + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) + * + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int + */ + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int + { + if ($currentWeight <= 1) { + return 1; + } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor( log10($currentWeight - 1) ); } } diff --git a/lib/Model/A2PApplicationSubmission.php b/lib/Model/A2PApplicationSubmission.php index 4ff969c..d9ea7cc 100644 --- a/lib/Model/A2PApplicationSubmission.php +++ b/lib/Model/A2PApplicationSubmission.php @@ -2,7 +2,7 @@ /** * A2PApplicationSubmission * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class A2PApplicationSubmission implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -144,6 +142,57 @@ class A2PApplicationSubmission implements ModelInterface, ArrayAccess, \JsonSeri 'phone_number' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'is_twilio_terms_read' => false, + 'is_privacy_policy_on_website' => false, + 'is_tos_on_website' => false, + 'is_stop_understood' => false, + 'is_manual_read' => false, + 'is_ctia_short_code_read' => false, + 'is_standards_understood' => false, + 'is_short_code_understood' => false, + 'is_opt_in_out_understood' => false, + 'is_short_code_transfer_understood' => false, + 'is_pricing_understood' => false, + 'is_short_code_timeline_understood' => false, + 'business_name' => false, + 'business_type' => false, + 'business_classification' => false, + 'business_industry' => false, + 'tax_id_type' => false, + 'tax_id' => false, + 'website_url' => false, + 'social_media_url' => false, + 'regions_of_operation' => false, + 'stock_exchange' => false, + 'stock_ticker' => false, + 'messaging_volume_high' => false, + 'address1' => false, + 'address2' => false, + 'city' => false, + 'state' => false, + 'postal_code' => false, + 'country' => false, + 'first_name' => false, + 'last_name' => false, + 'email' => false, + 'job_title' => false, + 'job_position' => false, + 'phone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -164,6 +213,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -354,42 +455,60 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['is_twilio_terms_read'] = $data['is_twilio_terms_read'] ?? null; - $this->container['is_privacy_policy_on_website'] = $data['is_privacy_policy_on_website'] ?? null; - $this->container['is_tos_on_website'] = $data['is_tos_on_website'] ?? null; - $this->container['is_stop_understood'] = $data['is_stop_understood'] ?? null; - $this->container['is_manual_read'] = $data['is_manual_read'] ?? null; - $this->container['is_ctia_short_code_read'] = $data['is_ctia_short_code_read'] ?? null; - $this->container['is_standards_understood'] = $data['is_standards_understood'] ?? null; - $this->container['is_short_code_understood'] = $data['is_short_code_understood'] ?? null; - $this->container['is_opt_in_out_understood'] = $data['is_opt_in_out_understood'] ?? null; - $this->container['is_short_code_transfer_understood'] = $data['is_short_code_transfer_understood'] ?? null; - $this->container['is_pricing_understood'] = $data['is_pricing_understood'] ?? null; - $this->container['is_short_code_timeline_understood'] = $data['is_short_code_timeline_understood'] ?? null; - $this->container['business_name'] = $data['business_name'] ?? null; - $this->container['business_type'] = $data['business_type'] ?? null; - $this->container['business_classification'] = $data['business_classification'] ?? null; - $this->container['business_industry'] = $data['business_industry'] ?? null; - $this->container['tax_id_type'] = $data['tax_id_type'] ?? null; - $this->container['tax_id'] = $data['tax_id'] ?? null; - $this->container['website_url'] = $data['website_url'] ?? null; - $this->container['social_media_url'] = $data['social_media_url'] ?? null; - $this->container['regions_of_operation'] = $data['regions_of_operation'] ?? null; - $this->container['stock_exchange'] = $data['stock_exchange'] ?? null; - $this->container['stock_ticker'] = $data['stock_ticker'] ?? null; - $this->container['messaging_volume_high'] = $data['messaging_volume_high'] ?? null; - $this->container['address1'] = $data['address1'] ?? null; - $this->container['address2'] = $data['address2'] ?? null; - $this->container['city'] = $data['city'] ?? null; - $this->container['state'] = $data['state'] ?? null; - $this->container['postal_code'] = $data['postal_code'] ?? null; - $this->container['country'] = $data['country'] ?? null; - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['job_title'] = $data['job_title'] ?? null; - $this->container['job_position'] = $data['job_position'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; + $this->setIfExists('is_twilio_terms_read', $data ?? [], null); + $this->setIfExists('is_privacy_policy_on_website', $data ?? [], null); + $this->setIfExists('is_tos_on_website', $data ?? [], null); + $this->setIfExists('is_stop_understood', $data ?? [], null); + $this->setIfExists('is_manual_read', $data ?? [], null); + $this->setIfExists('is_ctia_short_code_read', $data ?? [], null); + $this->setIfExists('is_standards_understood', $data ?? [], null); + $this->setIfExists('is_short_code_understood', $data ?? [], null); + $this->setIfExists('is_opt_in_out_understood', $data ?? [], null); + $this->setIfExists('is_short_code_transfer_understood', $data ?? [], null); + $this->setIfExists('is_pricing_understood', $data ?? [], null); + $this->setIfExists('is_short_code_timeline_understood', $data ?? [], null); + $this->setIfExists('business_name', $data ?? [], null); + $this->setIfExists('business_type', $data ?? [], null); + $this->setIfExists('business_classification', $data ?? [], null); + $this->setIfExists('business_industry', $data ?? [], null); + $this->setIfExists('tax_id_type', $data ?? [], null); + $this->setIfExists('tax_id', $data ?? [], null); + $this->setIfExists('website_url', $data ?? [], null); + $this->setIfExists('social_media_url', $data ?? [], null); + $this->setIfExists('regions_of_operation', $data ?? [], null); + $this->setIfExists('stock_exchange', $data ?? [], null); + $this->setIfExists('stock_ticker', $data ?? [], null); + $this->setIfExists('messaging_volume_high', $data ?? [], null); + $this->setIfExists('address1', $data ?? [], null); + $this->setIfExists('address2', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('job_title', $data ?? [], null); + $this->setIfExists('job_position', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -598,6 +717,9 @@ public function getIsTwilioTermsRead() */ public function setIsTwilioTermsRead($is_twilio_terms_read) { + if (is_null($is_twilio_terms_read)) { + throw new \InvalidArgumentException('non-nullable is_twilio_terms_read cannot be null'); + } $this->container['is_twilio_terms_read'] = $is_twilio_terms_read; return $this; @@ -622,6 +744,9 @@ public function getIsPrivacyPolicyOnWebsite() */ public function setIsPrivacyPolicyOnWebsite($is_privacy_policy_on_website) { + if (is_null($is_privacy_policy_on_website)) { + throw new \InvalidArgumentException('non-nullable is_privacy_policy_on_website cannot be null'); + } $this->container['is_privacy_policy_on_website'] = $is_privacy_policy_on_website; return $this; @@ -646,6 +771,9 @@ public function getIsTosOnWebsite() */ public function setIsTosOnWebsite($is_tos_on_website) { + if (is_null($is_tos_on_website)) { + throw new \InvalidArgumentException('non-nullable is_tos_on_website cannot be null'); + } $this->container['is_tos_on_website'] = $is_tos_on_website; return $this; @@ -670,6 +798,9 @@ public function getIsStopUnderstood() */ public function setIsStopUnderstood($is_stop_understood) { + if (is_null($is_stop_understood)) { + throw new \InvalidArgumentException('non-nullable is_stop_understood cannot be null'); + } $this->container['is_stop_understood'] = $is_stop_understood; return $this; @@ -694,6 +825,9 @@ public function getIsManualRead() */ public function setIsManualRead($is_manual_read) { + if (is_null($is_manual_read)) { + throw new \InvalidArgumentException('non-nullable is_manual_read cannot be null'); + } $this->container['is_manual_read'] = $is_manual_read; return $this; @@ -718,6 +852,9 @@ public function getIsCtiaShortCodeRead() */ public function setIsCtiaShortCodeRead($is_ctia_short_code_read) { + if (is_null($is_ctia_short_code_read)) { + throw new \InvalidArgumentException('non-nullable is_ctia_short_code_read cannot be null'); + } $this->container['is_ctia_short_code_read'] = $is_ctia_short_code_read; return $this; @@ -742,6 +879,9 @@ public function getIsStandardsUnderstood() */ public function setIsStandardsUnderstood($is_standards_understood) { + if (is_null($is_standards_understood)) { + throw new \InvalidArgumentException('non-nullable is_standards_understood cannot be null'); + } $this->container['is_standards_understood'] = $is_standards_understood; return $this; @@ -766,6 +906,9 @@ public function getIsShortCodeUnderstood() */ public function setIsShortCodeUnderstood($is_short_code_understood) { + if (is_null($is_short_code_understood)) { + throw new \InvalidArgumentException('non-nullable is_short_code_understood cannot be null'); + } $this->container['is_short_code_understood'] = $is_short_code_understood; return $this; @@ -790,6 +933,9 @@ public function getIsOptInOutUnderstood() */ public function setIsOptInOutUnderstood($is_opt_in_out_understood) { + if (is_null($is_opt_in_out_understood)) { + throw new \InvalidArgumentException('non-nullable is_opt_in_out_understood cannot be null'); + } $this->container['is_opt_in_out_understood'] = $is_opt_in_out_understood; return $this; @@ -814,6 +960,9 @@ public function getIsShortCodeTransferUnderstood() */ public function setIsShortCodeTransferUnderstood($is_short_code_transfer_understood) { + if (is_null($is_short_code_transfer_understood)) { + throw new \InvalidArgumentException('non-nullable is_short_code_transfer_understood cannot be null'); + } $this->container['is_short_code_transfer_understood'] = $is_short_code_transfer_understood; return $this; @@ -838,6 +987,9 @@ public function getIsPricingUnderstood() */ public function setIsPricingUnderstood($is_pricing_understood) { + if (is_null($is_pricing_understood)) { + throw new \InvalidArgumentException('non-nullable is_pricing_understood cannot be null'); + } $this->container['is_pricing_understood'] = $is_pricing_understood; return $this; @@ -862,6 +1014,9 @@ public function getIsShortCodeTimelineUnderstood() */ public function setIsShortCodeTimelineUnderstood($is_short_code_timeline_understood) { + if (is_null($is_short_code_timeline_understood)) { + throw new \InvalidArgumentException('non-nullable is_short_code_timeline_understood cannot be null'); + } $this->container['is_short_code_timeline_understood'] = $is_short_code_timeline_understood; return $this; @@ -886,6 +1041,9 @@ public function getBusinessName() */ public function setBusinessName($business_name) { + if (is_null($business_name)) { + throw new \InvalidArgumentException('non-nullable business_name cannot be null'); + } if ((mb_strlen($business_name) < 1)) { throw new \InvalidArgumentException('invalid length for $business_name when calling A2PApplicationSubmission., must be bigger than or equal to 1.'); @@ -915,6 +1073,9 @@ public function getBusinessType() */ public function setBusinessType($business_type) { + if (is_null($business_type)) { + throw new \InvalidArgumentException('non-nullable business_type cannot be null'); + } $this->container['business_type'] = $business_type; return $this; @@ -939,6 +1100,9 @@ public function getBusinessClassification() */ public function setBusinessClassification($business_classification) { + if (is_null($business_classification)) { + throw new \InvalidArgumentException('non-nullable business_classification cannot be null'); + } $this->container['business_classification'] = $business_classification; return $this; @@ -963,6 +1127,9 @@ public function getBusinessIndustry() */ public function setBusinessIndustry($business_industry) { + if (is_null($business_industry)) { + throw new \InvalidArgumentException('non-nullable business_industry cannot be null'); + } $this->container['business_industry'] = $business_industry; return $this; @@ -987,6 +1154,9 @@ public function getTaxIdType() */ public function setTaxIdType($tax_id_type) { + if (is_null($tax_id_type)) { + throw new \InvalidArgumentException('non-nullable tax_id_type cannot be null'); + } $this->container['tax_id_type'] = $tax_id_type; return $this; @@ -1011,6 +1181,9 @@ public function getTaxId() */ public function setTaxId($tax_id) { + if (is_null($tax_id)) { + throw new \InvalidArgumentException('non-nullable tax_id cannot be null'); + } if ((mb_strlen($tax_id) < 1)) { throw new \InvalidArgumentException('invalid length for $tax_id when calling A2PApplicationSubmission., must be bigger than or equal to 1.'); @@ -1040,6 +1213,9 @@ public function getWebsiteUrl() */ public function setWebsiteUrl($website_url) { + if (is_null($website_url)) { + throw new \InvalidArgumentException('non-nullable website_url cannot be null'); + } if ((mb_strlen($website_url) < 1)) { throw new \InvalidArgumentException('invalid length for $website_url when calling A2PApplicationSubmission., must be bigger than or equal to 1.'); @@ -1069,6 +1245,9 @@ public function getSocialMediaUrl() */ public function setSocialMediaUrl($social_media_url) { + if (is_null($social_media_url)) { + throw new \InvalidArgumentException('non-nullable social_media_url cannot be null'); + } if ((mb_strlen($social_media_url) < 1)) { throw new \InvalidArgumentException('invalid length for $social_media_url when calling A2PApplicationSubmission., must be bigger than or equal to 1.'); @@ -1098,6 +1277,9 @@ public function getRegionsOfOperation() */ public function setRegionsOfOperation($regions_of_operation) { + if (is_null($regions_of_operation)) { + throw new \InvalidArgumentException('non-nullable regions_of_operation cannot be null'); + } $this->container['regions_of_operation'] = $regions_of_operation; @@ -1124,6 +1306,9 @@ public function getStockExchange() */ public function setStockExchange($stock_exchange) { + if (is_null($stock_exchange)) { + throw new \InvalidArgumentException('non-nullable stock_exchange cannot be null'); + } $this->container['stock_exchange'] = $stock_exchange; return $this; @@ -1148,8 +1333,11 @@ public function getStockTicker() */ public function setStockTicker($stock_ticker) { + if (is_null($stock_ticker)) { + throw new \InvalidArgumentException('non-nullable stock_ticker cannot be null'); + } - if (!is_null($stock_ticker) && (mb_strlen($stock_ticker) < 0)) { + if ((mb_strlen($stock_ticker) < 0)) { throw new \InvalidArgumentException('invalid length for $stock_ticker when calling A2PApplicationSubmission., must be bigger than or equal to 0.'); } @@ -1177,6 +1365,11 @@ public function getMessagingVolumeHigh() */ public function setMessagingVolumeHigh($messaging_volume_high) { + if (is_null($messaging_volume_high)) { + throw new \InvalidArgumentException('non-nullable messaging_volume_high cannot be null'); + } + + $this->container['messaging_volume_high'] = $messaging_volume_high; return $this; @@ -1201,6 +1394,9 @@ public function getAddress1() */ public function setAddress1($address1) { + if (is_null($address1)) { + throw new \InvalidArgumentException('non-nullable address1 cannot be null'); + } if ((mb_strlen($address1) < 1)) { throw new \InvalidArgumentException('invalid length for $address1 when calling A2PApplicationSubmission., must be bigger than or equal to 1.'); @@ -1230,8 +1426,11 @@ public function getAddress2() */ public function setAddress2($address2) { + if (is_null($address2)) { + throw new \InvalidArgumentException('non-nullable address2 cannot be null'); + } - if (!is_null($address2) && (mb_strlen($address2) < 0)) { + if ((mb_strlen($address2) < 0)) { throw new \InvalidArgumentException('invalid length for $address2 when calling A2PApplicationSubmission., must be bigger than or equal to 0.'); } @@ -1259,6 +1458,9 @@ public function getCity() */ public function setCity($city) { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } if ((mb_strlen($city) < 3)) { throw new \InvalidArgumentException('invalid length for $city when calling A2PApplicationSubmission., must be bigger than or equal to 3.'); @@ -1288,6 +1490,9 @@ public function getState() */ public function setState($state) { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } if ((mb_strlen($state) < 1)) { throw new \InvalidArgumentException('invalid length for $state when calling A2PApplicationSubmission., must be bigger than or equal to 1.'); @@ -1317,6 +1522,9 @@ public function getPostalCode() */ public function setPostalCode($postal_code) { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } if ((mb_strlen($postal_code) < 4)) { throw new \InvalidArgumentException('invalid length for $postal_code when calling A2PApplicationSubmission., must be bigger than or equal to 4.'); @@ -1346,6 +1554,9 @@ public function getCountry() */ public function setCountry($country) { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } if ((mb_strlen($country) < 2)) { throw new \InvalidArgumentException('invalid length for $country when calling A2PApplicationSubmission., must be bigger than or equal to 2.'); @@ -1375,6 +1586,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling A2PApplicationSubmission., must be bigger than or equal to 1.'); @@ -1404,6 +1618,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling A2PApplicationSubmission., must be bigger than or equal to 1.'); @@ -1433,6 +1650,9 @@ public function getEmail() */ public function setEmail($email) { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } if ((mb_strlen($email) < 6)) { throw new \InvalidArgumentException('invalid length for $email when calling A2PApplicationSubmission., must be bigger than or equal to 6.'); @@ -1462,6 +1682,9 @@ public function getJobTitle() */ public function setJobTitle($job_title) { + if (is_null($job_title)) { + throw new \InvalidArgumentException('non-nullable job_title cannot be null'); + } if ((mb_strlen($job_title) < 2)) { throw new \InvalidArgumentException('invalid length for $job_title when calling A2PApplicationSubmission., must be bigger than or equal to 2.'); @@ -1491,6 +1714,9 @@ public function getJobPosition() */ public function setJobPosition($job_position) { + if (is_null($job_position)) { + throw new \InvalidArgumentException('non-nullable job_position cannot be null'); + } $this->container['job_position'] = $job_position; return $this; @@ -1515,6 +1741,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } if ((mb_strlen($phone_number) < 7)) { throw new \InvalidArgumentException('invalid length for $phone_number when calling A2PApplicationSubmission., must be bigger than or equal to 7.'); @@ -1531,7 +1760,7 @@ public function setPhoneNumber($phone_number) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1543,6 +1772,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1556,7 +1786,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1572,7 +1802,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1584,6 +1814,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/AdvertisementCredit.php b/lib/Model/AdvertisementCredit.php index 43fe1c8..7057ffc 100644 --- a/lib/Model/AdvertisementCredit.php +++ b/lib/Model/AdvertisementCredit.php @@ -2,7 +2,7 @@ /** * AdvertisementCredit * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class AdvertisementCredit implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,12 +59,12 @@ class AdvertisementCredit implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPITypes = [ 'title' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'payment_design_id' => 'string', 'max_uses' => 'int', 'discount_value' => 'int', 'employee_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -98,6 +96,34 @@ class AdvertisementCredit implements ModelInterface, ArrayAccess, \JsonSerializa 'discount_value_string' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'value_type' => false, + 'payment_design_id' => false, + 'max_uses' => false, + 'discount_value' => false, + 'employee_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'discount_value_decimal' => false, + 'discount_value_string' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -118,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -239,19 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['max_uses'] = $data['max_uses'] ?? null; - $this->container['discount_value'] = $data['discount_value'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['discount_value_decimal'] = $data['discount_value_decimal'] ?? null; - $this->container['discount_value_string'] = $data['discount_value_string'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('max_uses', $data ?? [], null); + $this->setIfExists('discount_value', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('discount_value_decimal', $data ?? [], null); + $this->setIfExists('discount_value_string', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -320,14 +416,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -392,6 +480,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling AdvertisementCredit., must be bigger than or equal to 1.'); @@ -405,7 +496,7 @@ public function setTitle($title) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -415,12 +506,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -445,14 +539,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling AdvertisementCredit., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling AdvertisementCredit., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling AdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling AdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -479,6 +576,9 @@ public function getMaxUses() */ public function setMaxUses($max_uses) { + if (is_null($max_uses)) { + throw new \InvalidArgumentException('non-nullable max_uses cannot be null'); + } if (($max_uses < 0)) { throw new \InvalidArgumentException('invalid value for $max_uses when calling AdvertisementCredit., must be bigger than or equal to 0.'); @@ -508,6 +608,9 @@ public function getDiscountValue() */ public function setDiscountValue($discount_value) { + if (is_null($discount_value)) { + throw new \InvalidArgumentException('non-nullable discount_value cannot be null'); + } if (($discount_value < 0)) { throw new \InvalidArgumentException('invalid value for $discount_value when calling AdvertisementCredit., must be bigger than or equal to 0.'); @@ -537,14 +640,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling AdvertisementCredit., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling AdvertisementCredit., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling AdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling AdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -555,7 +661,7 @@ public function setEmployeeId($employee_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -565,19 +671,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling AdvertisementCredit., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling AdvertisementCredit., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -602,14 +704,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling AdvertisementCredit., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling AdvertisementCredit., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling AdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling AdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -636,6 +741,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -660,6 +768,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -684,6 +795,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -708,6 +822,9 @@ public function getDiscountValueDecimal() */ public function setDiscountValueDecimal($discount_value_decimal) { + if (is_null($discount_value_decimal)) { + throw new \InvalidArgumentException('non-nullable discount_value_decimal cannot be null'); + } $this->container['discount_value_decimal'] = $discount_value_decimal; return $this; @@ -732,6 +849,9 @@ public function getDiscountValueString() */ public function setDiscountValueString($discount_value_string) { + if (is_null($discount_value_string)) { + throw new \InvalidArgumentException('non-nullable discount_value_string cannot be null'); + } $this->container['discount_value_string'] = $discount_value_string; return $this; @@ -743,7 +863,7 @@ public function setDiscountValueString($discount_value_string) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -755,6 +875,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -768,7 +889,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -784,7 +905,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -796,6 +917,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/AdvertisementCreditBroadcast.php b/lib/Model/AdvertisementCreditBroadcast.php index 5105613..773926d 100644 --- a/lib/Model/AdvertisementCreditBroadcast.php +++ b/lib/Model/AdvertisementCreditBroadcast.php @@ -2,7 +2,7 @@ /** * AdvertisementCreditBroadcast * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class AdvertisementCreditBroadcast implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,22 +59,22 @@ class AdvertisementCreditBroadcast implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'phone_number_id' => 'string', - 'payment_object_prefix' => 'string', + 'payment_object_prefix' => '\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix', 'payment_object_id' => 'string', 'message_template' => 'string', 'media_urls' => 'string[]', 'employee_id' => 'string', 'broadcast_scheduled_at' => '\DateTime', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', - 'broadcast_status' => 'string', + 'broadcast_status' => '\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus', 'broadcast_queued_at' => '\DateTime', 'broadcast_started_at' => '\DateTime', 'broadcast_completed_at' => '\DateTime', - 'list_type' => 'string', + 'list_type' => '\OpenAPI\Client\Model\DynamicVoucherBroadcastListType', 'list_id' => 'string', 'opt_in_list' => '\OpenAPI\Client\Model\WTOptInList', 'imported_list' => '\OpenAPI\Client\Model\WTImportedList', @@ -114,6 +112,42 @@ class AdvertisementCreditBroadcast implements ModelInterface, ArrayAccess, \Json 'advertisement_credit' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_number_id' => false, + 'payment_object_prefix' => false, + 'payment_object_id' => false, + 'message_template' => false, + 'media_urls' => false, + 'employee_id' => false, + 'broadcast_scheduled_at' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'broadcast_status' => false, + 'broadcast_queued_at' => true, + 'broadcast_started_at' => true, + 'broadcast_completed_at' => true, + 'list_type' => false, + 'list_id' => false, + 'opt_in_list' => false, + 'imported_list' => false, + 'advertisement_credit' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -134,6 +168,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -279,27 +365,45 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['payment_object_prefix'] = $data['payment_object_prefix'] ?? null; - $this->container['payment_object_id'] = $data['payment_object_id'] ?? null; - $this->container['message_template'] = $data['message_template'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['broadcast_scheduled_at'] = $data['broadcast_scheduled_at'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['broadcast_status'] = $data['broadcast_status'] ?? null; - $this->container['broadcast_queued_at'] = $data['broadcast_queued_at'] ?? null; - $this->container['broadcast_started_at'] = $data['broadcast_started_at'] ?? null; - $this->container['broadcast_completed_at'] = $data['broadcast_completed_at'] ?? null; - $this->container['list_type'] = $data['list_type'] ?? null; - $this->container['list_id'] = $data['list_id'] ?? null; - $this->container['opt_in_list'] = $data['opt_in_list'] ?? null; - $this->container['imported_list'] = $data['imported_list'] ?? null; - $this->container['advertisement_credit'] = $data['advertisement_credit'] ?? null; + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('payment_object_prefix', $data ?? [], null); + $this->setIfExists('payment_object_id', $data ?? [], null); + $this->setIfExists('message_template', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('broadcast_scheduled_at', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('broadcast_status', $data ?? [], null); + $this->setIfExists('broadcast_queued_at', $data ?? [], null); + $this->setIfExists('broadcast_started_at', $data ?? [], null); + $this->setIfExists('broadcast_completed_at', $data ?? [], null); + $this->setIfExists('list_type', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('opt_in_list', $data ?? [], null); + $this->setIfExists('imported_list', $data ?? [], null); + $this->setIfExists('advertisement_credit', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -329,14 +433,6 @@ public function listInvalidProperties() if ($this->container['payment_object_prefix'] === null) { $invalidProperties[] = "'payment_object_prefix' can't be null"; } - if ((mb_strlen($this->container['payment_object_prefix']) > 2)) { - $invalidProperties[] = "invalid value for 'payment_object_prefix', the character length must be smaller than or equal to 2."; - } - - if ((mb_strlen($this->container['payment_object_prefix']) < 2)) { - $invalidProperties[] = "invalid value for 'payment_object_prefix', the character length must be bigger than or equal to 2."; - } - if ($this->container['payment_object_id'] === null) { $invalidProperties[] = "'payment_object_id' can't be null"; } @@ -379,14 +475,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -478,14 +566,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling AdvertisementCreditBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling AdvertisementCreditBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling AdvertisementCreditBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling AdvertisementCreditBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -496,7 +587,7 @@ public function setPhoneNumberId($phone_number_id) /** * Gets payment_object_prefix * - * @return string + * @return \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix */ public function getPaymentObjectPrefix() { @@ -506,19 +597,15 @@ public function getPaymentObjectPrefix() /** * Sets payment_object_prefix * - * @param string $payment_object_prefix payment_object_prefix + * @param \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix $payment_object_prefix payment_object_prefix * * @return self */ public function setPaymentObjectPrefix($payment_object_prefix) { - if ((mb_strlen($payment_object_prefix) > 2)) { - throw new \InvalidArgumentException('invalid length for $payment_object_prefix when calling AdvertisementCreditBroadcast., must be smaller than or equal to 2.'); - } - if ((mb_strlen($payment_object_prefix) < 2)) { - throw new \InvalidArgumentException('invalid length for $payment_object_prefix when calling AdvertisementCreditBroadcast., must be bigger than or equal to 2.'); + if (is_null($payment_object_prefix)) { + throw new \InvalidArgumentException('non-nullable payment_object_prefix cannot be null'); } - $this->container['payment_object_prefix'] = $payment_object_prefix; return $this; @@ -543,14 +630,17 @@ public function getPaymentObjectId() */ public function setPaymentObjectId($payment_object_id) { + if (is_null($payment_object_id)) { + throw new \InvalidArgumentException('non-nullable payment_object_id cannot be null'); + } if ((mb_strlen($payment_object_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling AdvertisementCreditBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_object_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling AdvertisementCreditBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_object_id))) { - throw new \InvalidArgumentException("invalid value for $payment_object_id when calling AdvertisementCreditBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_object_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_object_id when calling AdvertisementCreditBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_object_id'] = $payment_object_id; @@ -577,6 +667,9 @@ public function getMessageTemplate() */ public function setMessageTemplate($message_template) { + if (is_null($message_template)) { + throw new \InvalidArgumentException('non-nullable message_template cannot be null'); + } $this->container['message_template'] = $message_template; return $this; @@ -601,6 +694,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -625,14 +721,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling AdvertisementCreditBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling AdvertisementCreditBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling AdvertisementCreditBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling AdvertisementCreditBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -659,6 +758,9 @@ public function getBroadcastScheduledAt() */ public function setBroadcastScheduledAt($broadcast_scheduled_at) { + if (is_null($broadcast_scheduled_at)) { + throw new \InvalidArgumentException('non-nullable broadcast_scheduled_at cannot be null'); + } $this->container['broadcast_scheduled_at'] = $broadcast_scheduled_at; return $this; @@ -667,7 +769,7 @@ public function setBroadcastScheduledAt($broadcast_scheduled_at) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -677,19 +779,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling AdvertisementCreditBroadcast., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling AdvertisementCreditBroadcast., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -714,14 +812,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling AdvertisementCreditBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling AdvertisementCreditBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling AdvertisementCreditBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling AdvertisementCreditBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -748,6 +849,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -772,6 +876,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -796,6 +903,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -804,7 +914,7 @@ public function setIsActive($is_active) /** * Gets broadcast_status * - * @return string + * @return \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus */ public function getBroadcastStatus() { @@ -814,12 +924,15 @@ public function getBroadcastStatus() /** * Sets broadcast_status * - * @param string $broadcast_status broadcast_status + * @param \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus $broadcast_status broadcast_status * * @return self */ public function setBroadcastStatus($broadcast_status) { + if (is_null($broadcast_status)) { + throw new \InvalidArgumentException('non-nullable broadcast_status cannot be null'); + } $this->container['broadcast_status'] = $broadcast_status; return $this; @@ -844,6 +957,16 @@ public function getBroadcastQueuedAt() */ public function setBroadcastQueuedAt($broadcast_queued_at) { + if (is_null($broadcast_queued_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_queued_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_queued_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_queued_at'] = $broadcast_queued_at; return $this; @@ -868,6 +991,16 @@ public function getBroadcastStartedAt() */ public function setBroadcastStartedAt($broadcast_started_at) { + if (is_null($broadcast_started_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_started_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_started_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_started_at'] = $broadcast_started_at; return $this; @@ -892,6 +1025,16 @@ public function getBroadcastCompletedAt() */ public function setBroadcastCompletedAt($broadcast_completed_at) { + if (is_null($broadcast_completed_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_completed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_completed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_completed_at'] = $broadcast_completed_at; return $this; @@ -900,7 +1043,7 @@ public function setBroadcastCompletedAt($broadcast_completed_at) /** * Gets list_type * - * @return string + * @return \OpenAPI\Client\Model\DynamicVoucherBroadcastListType */ public function getListType() { @@ -910,12 +1053,15 @@ public function getListType() /** * Sets list_type * - * @param string $list_type list_type + * @param \OpenAPI\Client\Model\DynamicVoucherBroadcastListType $list_type list_type * * @return self */ public function setListType($list_type) { + if (is_null($list_type)) { + throw new \InvalidArgumentException('non-nullable list_type cannot be null'); + } $this->container['list_type'] = $list_type; return $this; @@ -940,14 +1086,17 @@ public function getListId() */ public function setListId($list_id) { + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + } if ((mb_strlen($list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling AdvertisementCreditBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling AdvertisementCreditBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $list_id))) { - throw new \InvalidArgumentException("invalid value for $list_id when calling AdvertisementCreditBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($list_id)))) { + throw new \InvalidArgumentException("invalid value for \$list_id when calling AdvertisementCreditBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['list_id'] = $list_id; @@ -974,6 +1123,9 @@ public function getOptInList() */ public function setOptInList($opt_in_list) { + if (is_null($opt_in_list)) { + throw new \InvalidArgumentException('non-nullable opt_in_list cannot be null'); + } $this->container['opt_in_list'] = $opt_in_list; return $this; @@ -998,6 +1150,9 @@ public function getImportedList() */ public function setImportedList($imported_list) { + if (is_null($imported_list)) { + throw new \InvalidArgumentException('non-nullable imported_list cannot be null'); + } $this->container['imported_list'] = $imported_list; return $this; @@ -1022,6 +1177,9 @@ public function getAdvertisementCredit() */ public function setAdvertisementCredit($advertisement_credit) { + if (is_null($advertisement_credit)) { + throw new \InvalidArgumentException('non-nullable advertisement_credit cannot be null'); + } $this->container['advertisement_credit'] = $advertisement_credit; return $this; @@ -1033,7 +1191,7 @@ public function setAdvertisementCredit($advertisement_credit) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1045,6 +1203,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1058,7 +1217,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1074,7 +1233,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1086,6 +1245,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/AdvertisementCreditScan.php b/lib/Model/AdvertisementCreditScan.php index 0bace8a..cdf2ac0 100644 --- a/lib/Model/AdvertisementCreditScan.php +++ b/lib/Model/AdvertisementCreditScan.php @@ -2,7 +2,7 @@ /** * AdvertisementCreditScan * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class AdvertisementCreditScan implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,9 +58,9 @@ class AdvertisementCreditScan implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', - 'transaction_type' => 'string', - 'register_id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', + 'transaction_type' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType', + 'register_id' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID', 'redeemed_source' => 'string', 'redeemed_transaction_id' => 'string', 'redeemed_amount' => 'int', @@ -118,6 +116,44 @@ class AdvertisementCreditScan implements ModelInterface, ArrayAccess, \JsonSeria 'date_time_refunded' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'transaction_type' => false, + 'register_id' => false, + 'redeemed_source' => false, + 'redeemed_transaction_id' => false, + 'redeemed_amount' => false, + 'is_redeemed' => false, + 'refunded_transaction_id' => false, + 'refunded_amount' => false, + 'status' => false, + 'authorized_against_check_number' => false, + 'authorized_amount' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'advertisement_credit_id' => false, + 'redeemed_amount_decimal' => false, + 'redeemed_amount_string' => false, + 'authorized_amount_decimal' => false, + 'authorized_amount_string' => false, + 'date_time_redeemed' => true, + 'date_time_refunded' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -138,6 +174,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -289,29 +377,47 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['redeemed_source'] = $data['redeemed_source'] ?? null; - $this->container['redeemed_transaction_id'] = $data['redeemed_transaction_id'] ?? null; - $this->container['redeemed_amount'] = $data['redeemed_amount'] ?? null; - $this->container['is_redeemed'] = $data['is_redeemed'] ?? null; - $this->container['refunded_transaction_id'] = $data['refunded_transaction_id'] ?? null; - $this->container['refunded_amount'] = $data['refunded_amount'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['authorized_against_check_number'] = $data['authorized_against_check_number'] ?? null; - $this->container['authorized_amount'] = $data['authorized_amount'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['advertisement_credit_id'] = $data['advertisement_credit_id'] ?? null; - $this->container['redeemed_amount_decimal'] = $data['redeemed_amount_decimal'] ?? null; - $this->container['redeemed_amount_string'] = $data['redeemed_amount_string'] ?? null; - $this->container['authorized_amount_decimal'] = $data['authorized_amount_decimal'] ?? null; - $this->container['authorized_amount_string'] = $data['authorized_amount_string'] ?? null; - $this->container['date_time_redeemed'] = $data['date_time_redeemed'] ?? null; - $this->container['date_time_refunded'] = $data['date_time_refunded'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('redeemed_source', $data ?? [], null); + $this->setIfExists('redeemed_transaction_id', $data ?? [], null); + $this->setIfExists('redeemed_amount', $data ?? [], null); + $this->setIfExists('is_redeemed', $data ?? [], null); + $this->setIfExists('refunded_transaction_id', $data ?? [], null); + $this->setIfExists('refunded_amount', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('authorized_against_check_number', $data ?? [], null); + $this->setIfExists('authorized_amount', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('advertisement_credit_id', $data ?? [], null); + $this->setIfExists('redeemed_amount_decimal', $data ?? [], null); + $this->setIfExists('redeemed_amount_string', $data ?? [], null); + $this->setIfExists('authorized_amount_decimal', $data ?? [], null); + $this->setIfExists('authorized_amount_string', $data ?? [], null); + $this->setIfExists('date_time_redeemed', $data ?? [], null); + $this->setIfExists('date_time_refunded', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -326,14 +432,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['transaction_type'] === null) { $invalidProperties[] = "'transaction_type' can't be null"; } @@ -454,7 +552,7 @@ public function valid() /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -464,19 +562,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling AdvertisementCreditScan., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling AdvertisementCreditScan., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -485,7 +579,7 @@ public function setId($id) /** * Gets transaction_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType */ public function getTransactionType() { @@ -495,12 +589,15 @@ public function getTransactionType() /** * Sets transaction_type * - * @param string $transaction_type The type of the transaction - only redemption at the moment + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType $transaction_type transaction_type * * @return self */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -509,7 +606,7 @@ public function setTransactionType($transaction_type) /** * Gets register_id * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID */ public function getRegisterId() { @@ -519,12 +616,15 @@ public function getRegisterId() /** * Sets register_id * - * @param string $register_id The ID of the register where the transaction occurred + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID $register_id register_id * * @return self */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -549,6 +649,9 @@ public function getRedeemedSource() */ public function setRedeemedSource($redeemed_source) { + if (is_null($redeemed_source)) { + throw new \InvalidArgumentException('non-nullable redeemed_source cannot be null'); + } $this->container['redeemed_source'] = $redeemed_source; return $this; @@ -573,6 +676,9 @@ public function getRedeemedTransactionId() */ public function setRedeemedTransactionId($redeemed_transaction_id) { + if (is_null($redeemed_transaction_id)) { + throw new \InvalidArgumentException('non-nullable redeemed_transaction_id cannot be null'); + } $this->container['redeemed_transaction_id'] = $redeemed_transaction_id; return $this; @@ -597,6 +703,9 @@ public function getRedeemedAmount() */ public function setRedeemedAmount($redeemed_amount) { + if (is_null($redeemed_amount)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount cannot be null'); + } if (($redeemed_amount < 0)) { throw new \InvalidArgumentException('invalid value for $redeemed_amount when calling AdvertisementCreditScan., must be bigger than or equal to 0.'); @@ -626,6 +735,9 @@ public function getIsRedeemed() */ public function setIsRedeemed($is_redeemed) { + if (is_null($is_redeemed)) { + throw new \InvalidArgumentException('non-nullable is_redeemed cannot be null'); + } $this->container['is_redeemed'] = $is_redeemed; return $this; @@ -650,6 +762,9 @@ public function getRefundedTransactionId() */ public function setRefundedTransactionId($refunded_transaction_id) { + if (is_null($refunded_transaction_id)) { + throw new \InvalidArgumentException('non-nullable refunded_transaction_id cannot be null'); + } $this->container['refunded_transaction_id'] = $refunded_transaction_id; return $this; @@ -674,6 +789,9 @@ public function getRefundedAmount() */ public function setRefundedAmount($refunded_amount) { + if (is_null($refunded_amount)) { + throw new \InvalidArgumentException('non-nullable refunded_amount cannot be null'); + } if (($refunded_amount < 0)) { throw new \InvalidArgumentException('invalid value for $refunded_amount when calling AdvertisementCreditScan., must be bigger than or equal to 0.'); @@ -703,6 +821,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -727,6 +848,9 @@ public function getAuthorizedAgainstCheckNumber() */ public function setAuthorizedAgainstCheckNumber($authorized_against_check_number) { + if (is_null($authorized_against_check_number)) { + throw new \InvalidArgumentException('non-nullable authorized_against_check_number cannot be null'); + } $this->container['authorized_against_check_number'] = $authorized_against_check_number; return $this; @@ -751,6 +875,9 @@ public function getAuthorizedAmount() */ public function setAuthorizedAmount($authorized_amount) { + if (is_null($authorized_amount)) { + throw new \InvalidArgumentException('non-nullable authorized_amount cannot be null'); + } if (($authorized_amount < 0)) { throw new \InvalidArgumentException('invalid value for $authorized_amount when calling AdvertisementCreditScan., must be bigger than or equal to 0.'); @@ -780,14 +907,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling AdvertisementCreditScan., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling AdvertisementCreditScan., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling AdvertisementCreditScan., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling AdvertisementCreditScan., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -814,6 +944,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -838,6 +971,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -862,6 +998,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -886,14 +1025,17 @@ public function getAdvertisementCreditId() */ public function setAdvertisementCreditId($advertisement_credit_id) { + if (is_null($advertisement_credit_id)) { + throw new \InvalidArgumentException('non-nullable advertisement_credit_id cannot be null'); + } if ((mb_strlen($advertisement_credit_id) > 10)) { throw new \InvalidArgumentException('invalid length for $advertisement_credit_id when calling AdvertisementCreditScan., must be smaller than or equal to 10.'); } if ((mb_strlen($advertisement_credit_id) < 10)) { throw new \InvalidArgumentException('invalid length for $advertisement_credit_id when calling AdvertisementCreditScan., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $advertisement_credit_id))) { - throw new \InvalidArgumentException("invalid value for $advertisement_credit_id when calling AdvertisementCreditScan., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($advertisement_credit_id)))) { + throw new \InvalidArgumentException("invalid value for \$advertisement_credit_id when calling AdvertisementCreditScan., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['advertisement_credit_id'] = $advertisement_credit_id; @@ -920,6 +1062,9 @@ public function getRedeemedAmountDecimal() */ public function setRedeemedAmountDecimal($redeemed_amount_decimal) { + if (is_null($redeemed_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount_decimal cannot be null'); + } $this->container['redeemed_amount_decimal'] = $redeemed_amount_decimal; return $this; @@ -944,6 +1089,9 @@ public function getRedeemedAmountString() */ public function setRedeemedAmountString($redeemed_amount_string) { + if (is_null($redeemed_amount_string)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount_string cannot be null'); + } $this->container['redeemed_amount_string'] = $redeemed_amount_string; return $this; @@ -968,6 +1116,9 @@ public function getAuthorizedAmountDecimal() */ public function setAuthorizedAmountDecimal($authorized_amount_decimal) { + if (is_null($authorized_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable authorized_amount_decimal cannot be null'); + } $this->container['authorized_amount_decimal'] = $authorized_amount_decimal; return $this; @@ -992,6 +1143,9 @@ public function getAuthorizedAmountString() */ public function setAuthorizedAmountString($authorized_amount_string) { + if (is_null($authorized_amount_string)) { + throw new \InvalidArgumentException('non-nullable authorized_amount_string cannot be null'); + } $this->container['authorized_amount_string'] = $authorized_amount_string; return $this; @@ -1016,6 +1170,16 @@ public function getDateTimeRedeemed() */ public function setDateTimeRedeemed($date_time_redeemed) { + if (is_null($date_time_redeemed)) { + array_push($this->openAPINullablesSetToNull, 'date_time_redeemed'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_time_redeemed', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['date_time_redeemed'] = $date_time_redeemed; return $this; @@ -1040,6 +1204,16 @@ public function getDateTimeRefunded() */ public function setDateTimeRefunded($date_time_refunded) { + if (is_null($date_time_refunded)) { + array_push($this->openAPINullablesSetToNull, 'date_time_refunded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_time_refunded', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['date_time_refunded'] = $date_time_refunded; return $this; @@ -1051,7 +1225,7 @@ public function setDateTimeRefunded($date_time_refunded) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1063,6 +1237,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1076,7 +1251,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1092,7 +1267,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1104,6 +1279,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Amenity.php b/lib/Model/Amenity.php index 00c16ec..f38ac62 100644 --- a/lib/Model/Amenity.php +++ b/lib/Model/Amenity.php @@ -2,7 +2,7 @@ /** * Amenity * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Amenity implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -66,7 +64,7 @@ class Amenity implements ModelInterface, ArrayAccess, \JsonSerializable 'order_number' => 'int', 'media_url' => 'string', 'additional_info_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -94,6 +92,32 @@ class Amenity implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -229,17 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -333,6 +427,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling Amenity., must be bigger than or equal to 1.'); @@ -362,6 +459,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling Amenity., must be bigger than or equal to 1.'); @@ -391,6 +491,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -415,6 +518,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling Amenity., must be bigger than or equal to 1.'); @@ -444,6 +550,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -468,6 +577,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -476,7 +588,7 @@ public function setAdditionalInfoUrl($additional_info_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -486,12 +598,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -516,6 +631,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -540,6 +658,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -564,6 +685,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -588,14 +712,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Amenity., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Amenity., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Amenity., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Amenity., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -609,7 +736,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -621,6 +748,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -634,7 +762,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -650,7 +778,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -662,6 +790,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Announcement.php b/lib/Model/Announcement.php index c192ee0..ff2b7ef 100644 --- a/lib/Model/Announcement.php +++ b/lib/Model/Announcement.php @@ -2,7 +2,7 @@ /** * Announcement * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Announcement implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -86,6 +84,28 @@ class Announcement implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'subject' => false, + 'body' => false, + 'severity' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +126,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -209,13 +281,31 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['body'] = $data['body'] ?? null; - $this->container['severity'] = $data['severity'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('severity', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -294,14 +384,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Announcement., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Announcement., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling Announcement., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling Announcement., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -328,6 +421,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -352,6 +448,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -376,6 +475,9 @@ public function getSubject() */ public function setSubject($subject) { + if (is_null($subject)) { + throw new \InvalidArgumentException('non-nullable subject cannot be null'); + } $this->container['subject'] = $subject; return $this; @@ -400,6 +502,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } $this->container['body'] = $body; return $this; @@ -424,6 +529,9 @@ public function getSeverity() */ public function setSeverity($severity) { + if (is_null($severity)) { + throw new \InvalidArgumentException('non-nullable severity cannot be null'); + } $this->container['severity'] = $severity; return $this; @@ -448,6 +556,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -459,7 +570,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -471,6 +582,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -484,7 +596,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -500,7 +612,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -512,6 +624,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ApplicableTerminals.php b/lib/Model/ApplicableTerminals.php index d067515..fc6c1cf 100644 --- a/lib/Model/ApplicableTerminals.php +++ b/lib/Model/ApplicableTerminals.php @@ -2,7 +2,7 @@ /** * ApplicableTerminals * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ApplicableTerminals implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class ApplicableTerminals implements ModelInterface, ArrayAccess, \JsonSerializa ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -181,6 +247,24 @@ public function __construct(array $data = null) { } + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + /** * Show all the invalid properties with reasons. * @@ -211,7 +295,7 @@ public function valid() * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -223,6 +307,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -236,7 +321,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -252,7 +337,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -264,6 +349,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/AuthError.php b/lib/Model/AuthError.php index 32b6e18..2830bc7 100644 --- a/lib/Model/AuthError.php +++ b/lib/Model/AuthError.php @@ -2,7 +2,7 @@ /** * AuthError * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class AuthError implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class AuthError implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => 'string', 'message' => 'string', 'stack' => 'string', - 'http_error_code' => 'double', + 'http_error_code' => 'float', 'tracking_code' => 'string' ]; @@ -82,6 +80,26 @@ class AuthError implements ModelInterface, ArrayAccess, \JsonSerializable 'tracking_code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'stack' => false, + 'http_error_code' => false, + 'tracking_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['stack'] = $data['stack'] ?? null; - $this->container['http_error_code'] = $data['http_error_code'] ?? null; - $this->container['tracking_code'] = $data['tracking_code'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('stack', $data ?? [], null); + $this->setIfExists('http_error_code', $data ?? [], null); + $this->setIfExists('tracking_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -261,6 +349,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -285,6 +376,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -309,6 +403,9 @@ public function getStack() */ public function setStack($stack) { + if (is_null($stack)) { + throw new \InvalidArgumentException('non-nullable stack cannot be null'); + } $this->container['stack'] = $stack; return $this; @@ -317,7 +414,7 @@ public function setStack($stack) /** * Gets http_error_code * - * @return double + * @return float */ public function getHttpErrorCode() { @@ -327,12 +424,15 @@ public function getHttpErrorCode() /** * Sets http_error_code * - * @param double $http_error_code http_error_code + * @param float $http_error_code http_error_code * * @return self */ public function setHttpErrorCode($http_error_code) { + if (is_null($http_error_code)) { + throw new \InvalidArgumentException('non-nullable http_error_code cannot be null'); + } $this->container['http_error_code'] = $http_error_code; return $this; @@ -357,6 +457,9 @@ public function getTrackingCode() */ public function setTrackingCode($tracking_code) { + if (is_null($tracking_code)) { + throw new \InvalidArgumentException('non-nullable tracking_code cannot be null'); + } $this->container['tracking_code'] = $tracking_code; return $this; @@ -368,7 +471,7 @@ public function setTrackingCode($tracking_code) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -380,6 +483,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -393,7 +497,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -409,7 +513,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -421,6 +525,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/AvailablePhoneNumbersRequest.php b/lib/Model/AvailablePhoneNumbersRequest.php index d483ef1..5b1e870 100644 --- a/lib/Model/AvailablePhoneNumbersRequest.php +++ b/lib/Model/AvailablePhoneNumbersRequest.php @@ -2,7 +2,7 @@ /** * AvailablePhoneNumbersRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class AvailablePhoneNumbersRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,7 +59,7 @@ class AvailablePhoneNumbersRequest implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'area_code' => 'int', - 'limit' => 'double' + 'limit' => 'float' ]; /** @@ -76,6 +74,23 @@ class AvailablePhoneNumbersRequest implements ModelInterface, ArrayAccess, \Json 'limit' => 'double' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'area_code' => false, + 'limit' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['area_code'] = $data['area_code'] ?? null; - $this->container['limit'] = $data['limit'] ?? null; + $this->setIfExists('area_code', $data ?? [], null); + $this->setIfExists('limit', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -234,6 +319,9 @@ public function getAreaCode() */ public function setAreaCode($area_code) { + if (is_null($area_code)) { + throw new \InvalidArgumentException('non-nullable area_code cannot be null'); + } $this->container['area_code'] = $area_code; return $this; @@ -242,7 +330,7 @@ public function setAreaCode($area_code) /** * Gets limit * - * @return double|null + * @return float|null */ public function getLimit() { @@ -252,12 +340,15 @@ public function getLimit() /** * Sets limit * - * @param double|null $limit The number of available phone numbers to be returned in a single request + * @param float|null $limit The number of available phone numbers to be returned in a single request * * @return self */ public function setLimit($limit) { + if (is_null($limit)) { + throw new \InvalidArgumentException('non-nullable limit cannot be null'); + } $this->container['limit'] = $limit; return $this; @@ -269,7 +360,7 @@ public function setLimit($limit) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -281,6 +372,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -294,7 +386,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -310,7 +402,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -322,6 +414,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/BrowserDetails.php b/lib/Model/BrowserDetails.php index ff86a9f..ddb7f00 100644 --- a/lib/Model/BrowserDetails.php +++ b/lib/Model/BrowserDetails.php @@ -2,7 +2,7 @@ /** * BrowserDetails * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class BrowserDetails implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -82,6 +80,26 @@ class BrowserDetails implements ModelInterface, ArrayAccess, \JsonSerializable 'referrer' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ip' => false, + 'phone_verification_token' => false, + 'session_id' => false, + 'navigator_agent' => false, + 'referrer' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['ip'] = $data['ip'] ?? null; - $this->container['phone_verification_token'] = $data['phone_verification_token'] ?? null; - $this->container['session_id'] = $data['session_id'] ?? null; - $this->container['navigator_agent'] = $data['navigator_agent'] ?? null; - $this->container['referrer'] = $data['referrer'] ?? null; + $this->setIfExists('ip', $data ?? [], null); + $this->setIfExists('phone_verification_token', $data ?? [], null); + $this->setIfExists('session_id', $data ?? [], null); + $this->setIfExists('navigator_agent', $data ?? [], null); + $this->setIfExists('referrer', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -252,6 +340,9 @@ public function getIp() */ public function setIp($ip) { + if (is_null($ip)) { + throw new \InvalidArgumentException('non-nullable ip cannot be null'); + } $this->container['ip'] = $ip; return $this; @@ -276,6 +367,9 @@ public function getPhoneVerificationToken() */ public function setPhoneVerificationToken($phone_verification_token) { + if (is_null($phone_verification_token)) { + throw new \InvalidArgumentException('non-nullable phone_verification_token cannot be null'); + } $this->container['phone_verification_token'] = $phone_verification_token; return $this; @@ -300,6 +394,9 @@ public function getSessionId() */ public function setSessionId($session_id) { + if (is_null($session_id)) { + throw new \InvalidArgumentException('non-nullable session_id cannot be null'); + } $this->container['session_id'] = $session_id; return $this; @@ -324,6 +421,9 @@ public function getNavigatorAgent() */ public function setNavigatorAgent($navigator_agent) { + if (is_null($navigator_agent)) { + throw new \InvalidArgumentException('non-nullable navigator_agent cannot be null'); + } $this->container['navigator_agent'] = $navigator_agent; return $this; @@ -348,6 +448,9 @@ public function getReferrer() */ public function setReferrer($referrer) { + if (is_null($referrer)) { + throw new \InvalidArgumentException('non-nullable referrer cannot be null'); + } $this->container['referrer'] = $referrer; return $this; @@ -359,7 +462,7 @@ public function setReferrer($referrer) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -371,6 +474,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -384,7 +488,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -400,7 +504,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -412,6 +516,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/BusinessClassification.php b/lib/Model/BusinessClassification.php index 8341d33..aa59825 100644 --- a/lib/Model/BusinessClassification.php +++ b/lib/Model/BusinessClassification.php @@ -2,7 +2,7 @@ /** * BusinessClassification * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -43,13 +43,13 @@ class BusinessClassification /** * Possible values of this enum */ - const _PUBLIC = 'public'; + public const _PUBLIC = 'public'; - const _PRIVATE = 'private'; + public const _PRIVATE = 'private'; - const NON_PROFIT = 'non-profit'; + public const NON_PROFIT = 'non-profit'; - const GOVERNMENT = 'government'; + public const GOVERNMENT = 'government'; /** * Gets allowable values of the enum diff --git a/lib/Model/BusinessIndustry.php b/lib/Model/BusinessIndustry.php index 61df67c..3fb6423 100644 --- a/lib/Model/BusinessIndustry.php +++ b/lib/Model/BusinessIndustry.php @@ -2,7 +2,7 @@ /** * BusinessIndustry * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -43,71 +43,71 @@ class BusinessIndustry /** * Possible values of this enum */ - const AUTOMOTIVE = 'AUTOMOTIVE'; + public const AUTOMOTIVE = 'AUTOMOTIVE'; - const AGRICULTURE = 'AGRICULTURE'; + public const AGRICULTURE = 'AGRICULTURE'; - const BANKING = 'BANKING'; + public const BANKING = 'BANKING'; - const CONSTRUCTION = 'CONSTRUCTION'; + public const CONSTRUCTION = 'CONSTRUCTION'; - const CONSUMER = 'CONSUMER'; + public const CONSUMER = 'CONSUMER'; - const EDUCATION = 'EDUCATION'; + public const EDUCATION = 'EDUCATION'; - const ENGINEERING = 'ENGINEERING'; + public const ENGINEERING = 'ENGINEERING'; - const ENERGY = 'ENERGY'; + public const ENERGY = 'ENERGY'; - const OIL_AND_GAS = 'OIL_AND_GAS'; + public const OIL_AND_GAS = 'OIL_AND_GAS'; - const FAST_MOVING_CONSUMER_GOODS = 'FAST_MOVING_CONSUMER_GOODS'; + public const FAST_MOVING_CONSUMER_GOODS = 'FAST_MOVING_CONSUMER_GOODS'; - const FINANCIAL = 'FINANCIAL'; + public const FINANCIAL = 'FINANCIAL'; - const FINTECH = 'FINTECH'; + public const FINTECH = 'FINTECH'; - const FOOD_AND_BEVERAGE = 'FOOD_AND_BEVERAGE'; + public const FOOD_AND_BEVERAGE = 'FOOD_AND_BEVERAGE'; - const GOVERNMENT = 'GOVERNMENT'; + public const GOVERNMENT = 'GOVERNMENT'; - const HEALTHCARE = 'HEALTHCARE'; + public const HEALTHCARE = 'HEALTHCARE'; - const HOSPITALITY = 'HOSPITALITY'; + public const HOSPITALITY = 'HOSPITALITY'; - const INSURANCE = 'INSURANCE'; + public const INSURANCE = 'INSURANCE'; - const LEGAL = 'LEGAL'; + public const LEGAL = 'LEGAL'; - const MANUFACTURING = 'MANUFACTURING'; + public const MANUFACTURING = 'MANUFACTURING'; - const MEDIA = 'MEDIA'; + public const MEDIA = 'MEDIA'; - const ONLINE = 'ONLINE'; + public const ONLINE = 'ONLINE'; - const PROFESSIONAL_SERVICES = 'PROFESSIONAL_SERVICES'; + public const PROFESSIONAL_SERVICES = 'PROFESSIONAL_SERVICES'; - const RAW_MATERIALS = 'RAW_MATERIALS'; + public const RAW_MATERIALS = 'RAW_MATERIALS'; - const REAL_ESTATE = 'REAL_ESTATE'; + public const REAL_ESTATE = 'REAL_ESTATE'; - const RELIGION = 'RELIGION'; + public const RELIGION = 'RELIGION'; - const RETAIL = 'RETAIL'; + public const RETAIL = 'RETAIL'; - const JEWELRY = 'JEWELRY'; + public const JEWELRY = 'JEWELRY'; - const TECHNOLOGY = 'TECHNOLOGY'; + public const TECHNOLOGY = 'TECHNOLOGY'; - const TELECOMMUNICATIONS = 'TELECOMMUNICATIONS'; + public const TELECOMMUNICATIONS = 'TELECOMMUNICATIONS'; - const TRANSPORTATION = 'TRANSPORTATION'; + public const TRANSPORTATION = 'TRANSPORTATION'; - const TRAVEL = 'TRAVEL'; + public const TRAVEL = 'TRAVEL'; - const ELECTRONICS = 'ELECTRONICS'; + public const ELECTRONICS = 'ELECTRONICS'; - const NOT_FOR_PROFIT = 'NOT_FOR_PROFIT'; + public const NOT_FOR_PROFIT = 'NOT_FOR_PROFIT'; /** * Gets allowable values of the enum diff --git a/lib/Model/BusinessRegionsOfOperation.php b/lib/Model/BusinessRegionsOfOperation.php index b4e7344..358fc2e 100644 --- a/lib/Model/BusinessRegionsOfOperation.php +++ b/lib/Model/BusinessRegionsOfOperation.php @@ -2,7 +2,7 @@ /** * BusinessRegionsOfOperation * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -43,17 +43,17 @@ class BusinessRegionsOfOperation /** * Possible values of this enum */ - const AFRICA = 'AFRICA'; + public const AFRICA = 'AFRICA'; - const ASIA = 'ASIA'; + public const ASIA = 'ASIA'; - const EUROPE = 'EUROPE'; + public const EUROPE = 'EUROPE'; - const LATIN_AMERICA = 'LATIN_AMERICA'; + public const LATIN_AMERICA = 'LATIN_AMERICA'; - const USA_AND_CANADA = 'USA_AND_CANADA'; + public const USA_AND_CANADA = 'USA_AND_CANADA'; - const AUSTRALIA = 'AUSTRALIA'; + public const AUSTRALIA = 'AUSTRALIA'; /** * Gets allowable values of the enum diff --git a/lib/Model/BusinessRegistrationIdentifier.php b/lib/Model/BusinessRegistrationIdentifier.php index 2a7cd3d..358477b 100644 --- a/lib/Model/BusinessRegistrationIdentifier.php +++ b/lib/Model/BusinessRegistrationIdentifier.php @@ -2,7 +2,7 @@ /** * BusinessRegistrationIdentifier * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -43,25 +43,25 @@ class BusinessRegistrationIdentifier /** * Possible values of this enum */ - const EIN = 'EIN'; + public const EIN = 'EIN'; - const DUNS = 'DUNS'; + public const DUNS = 'DUNS'; - const CBN = 'CBN'; + public const CBN = 'CBN'; - const CN = 'CN'; + public const CN = 'CN'; - const ACN = 'ACN'; + public const ACN = 'ACN'; - const CIN = 'CIN'; + public const CIN = 'CIN'; - const VAT = 'VAT'; + public const VAT = 'VAT'; - const VATRN = 'VATRN'; + public const VATRN = 'VATRN'; - const RN = 'RN'; + public const RN = 'RN'; - const OTHER = 'Other'; + public const OTHER = 'Other'; /** * Gets allowable values of the enum diff --git a/lib/Model/BusinessStockExchanges.php b/lib/Model/BusinessStockExchanges.php index 497ceec..9db10bf 100644 --- a/lib/Model/BusinessStockExchanges.php +++ b/lib/Model/BusinessStockExchanges.php @@ -2,7 +2,7 @@ /** * BusinessStockExchanges * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -43,59 +43,59 @@ class BusinessStockExchanges /** * Possible values of this enum */ - const NONE = 'NONE'; + public const NONE = 'NONE'; - const NASDAQ = 'NASDAQ'; + public const NASDAQ = 'NASDAQ'; - const NYSE = 'NYSE'; + public const NYSE = 'NYSE'; - const AMEX = 'AMEX'; + public const AMEX = 'AMEX'; - const AMX = 'AMX'; + public const AMX = 'AMX'; - const ASX = 'ASX'; + public const ASX = 'ASX'; - const B3 = 'B3'; + public const B3 = 'B3'; - const BME = 'BME'; + public const BME = 'BME'; - const BSE = 'BSE'; + public const BSE = 'BSE'; - const FRA = 'FRA'; + public const FRA = 'FRA'; - const ICEX = 'ICEX'; + public const ICEX = 'ICEX'; - const JPX = 'JPX'; + public const JPX = 'JPX'; - const JSE = 'JSE'; + public const JSE = 'JSE'; - const KRX = 'KRX'; + public const KRX = 'KRX'; - const LON = 'LON'; + public const LON = 'LON'; - const NSE = 'NSE'; + public const NSE = 'NSE'; - const OMX = 'OMX'; + public const OMX = 'OMX'; - const SEHK = 'SEHK'; + public const SEHK = 'SEHK'; - const SGX = 'SGX'; + public const SGX = 'SGX'; - const SSE = 'SSE'; + public const SSE = 'SSE'; - const STO = 'STO'; + public const STO = 'STO'; - const SWX = 'SWX'; + public const SWX = 'SWX'; - const SZSE = 'SZSE'; + public const SZSE = 'SZSE'; - const TSX = 'TSX'; + public const TSX = 'TSX'; - const TWSE = 'TWSE'; + public const TWSE = 'TWSE'; - const VSE = 'VSE'; + public const VSE = 'VSE'; - const OTHER = 'OTHER'; + public const OTHER = 'OTHER'; /** * Gets allowable values of the enum diff --git a/lib/Model/BusinessType.php b/lib/Model/BusinessType.php index b22b5c9..2f2c97b 100644 --- a/lib/Model/BusinessType.php +++ b/lib/Model/BusinessType.php @@ -2,7 +2,7 @@ /** * BusinessType * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -43,17 +43,17 @@ class BusinessType /** * Possible values of this enum */ - const PARTNERSHIP = 'Partnership'; + public const PARTNERSHIP = 'Partnership'; - const LIMITED_LIABILITY_CORPORATION = 'Limited Liability Corporation'; + public const LIMITED_LIABILITY_CORPORATION = 'Limited Liability Corporation'; - const CO_OPERATIVE = 'Co-operative'; + public const CO_OPERATIVE = 'Co-operative'; - const NON_PROFIT_CORPORATION = 'Non-profit Corporation'; + public const NON_PROFIT_CORPORATION = 'Non-profit Corporation'; - const CORPORATION = 'Corporation'; + public const CORPORATION = 'Corporation'; - const SOLE_PROPRIETORSHIP = 'Sole Proprietorship'; + public const SOLE_PROPRIETORSHIP = 'Sole Proprietorship'; /** * Gets allowable values of the enum diff --git a/lib/Model/ClaimTicketRequest.php b/lib/Model/ClaimTicketRequest.php new file mode 100644 index 0000000..7081a04 --- /dev/null +++ b/lib/Model/ClaimTicketRequest.php @@ -0,0 +1,413 @@ + + */ +class ClaimTicketRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'claimTicket_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'claimed_by_phone_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'claimed_by_phone_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'claimed_by_phone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'claimed_by_phone_number' => 'claimedByPhoneNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'claimed_by_phone_number' => 'setClaimedByPhoneNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'claimed_by_phone_number' => 'getClaimedByPhoneNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('claimed_by_phone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['claimed_by_phone_number'] === null) { + $invalidProperties[] = "'claimed_by_phone_number' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets claimed_by_phone_number + * + * @return string + */ + public function getClaimedByPhoneNumber() + { + return $this->container['claimed_by_phone_number']; + } + + /** + * Sets claimed_by_phone_number + * + * @param string $claimed_by_phone_number claimed_by_phone_number + * + * @return self + */ + public function setClaimedByPhoneNumber($claimed_by_phone_number) + { + if (is_null($claimed_by_phone_number)) { + throw new \InvalidArgumentException('non-nullable claimed_by_phone_number cannot be null'); + } + $this->container['claimed_by_phone_number'] = $claimed_by_phone_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ClickFunnelAmount.php b/lib/Model/ClickFunnelAmount.php index 8ba4818..67afab2 100644 --- a/lib/Model/ClickFunnelAmount.php +++ b/lib/Model/ClickFunnelAmount.php @@ -2,7 +2,7 @@ /** * ClickFunnelAmount * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ClickFunnelAmount implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class ClickFunnelAmount implements ModelInterface, ArrayAccess, \JsonSerializabl * @var string[] */ protected static $openAPITypes = [ - 'cents' => 'double', + 'cents' => 'float', 'currency_iso' => 'string' ]; @@ -76,6 +74,23 @@ class ClickFunnelAmount implements ModelInterface, ArrayAccess, \JsonSerializabl 'currency_iso' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cents' => false, + 'currency_iso' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['cents'] = $data['cents'] ?? null; - $this->container['currency_iso'] = $data['currency_iso'] ?? null; + $this->setIfExists('cents', $data ?? [], null); + $this->setIfExists('currency_iso', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -221,7 +306,7 @@ public function valid() /** * Gets cents * - * @return double + * @return float */ public function getCents() { @@ -231,12 +316,15 @@ public function getCents() /** * Sets cents * - * @param double $cents cents + * @param float $cents cents * * @return self */ public function setCents($cents) { + if (is_null($cents)) { + throw new \InvalidArgumentException('non-nullable cents cannot be null'); + } $this->container['cents'] = $cents; return $this; @@ -261,6 +349,9 @@ public function getCurrencyIso() */ public function setCurrencyIso($currency_iso) { + if (is_null($currency_iso)) { + throw new \InvalidArgumentException('non-nullable currency_iso cannot be null'); + } $this->container['currency_iso'] = $currency_iso; return $this; @@ -272,7 +363,7 @@ public function setCurrencyIso($currency_iso) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -284,6 +375,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -297,7 +389,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -313,7 +405,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -325,6 +417,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ClickFunnelContact.php b/lib/Model/ClickFunnelContact.php index baac907..fed0883 100644 --- a/lib/Model/ClickFunnelContact.php +++ b/lib/Model/ClickFunnelContact.php @@ -2,7 +2,7 @@ /** * ClickFunnelContact * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ClickFunnelContact implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,8 +58,8 @@ class ClickFunnelContact implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'id' => 'double', - 'page_id' => 'double', + 'id' => 'float', + 'page_id' => 'float', 'first_name' => 'string', 'last_name' => 'string', 'name' => 'string', @@ -78,8 +76,8 @@ class ClickFunnelContact implements ModelInterface, ArrayAccess, \JsonSerializab 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'ip' => 'string', - 'funnel_id' => 'double', - 'funnel_step_id' => 'double', + 'funnel_id' => 'float', + 'funnel_step_id' => 'float', 'unsubscribed_at' => 'mixed', 'cf_uvid' => 'string', 'cart_affiliate_id' => 'string', @@ -97,7 +95,9 @@ class ClickFunnelContact implements ModelInterface, ArrayAccess, \JsonSerializab 'time_zone' => 'string', 'company_name' => 'string', 'company_industry' => 'string', - 'additional_info' => 'mixed' + 'additional_info' => 'mixed', + 'ga_client_id' => 'string', + 'ga_measurement_id' => 'string' ]; /** @@ -145,9 +145,66 @@ class ClickFunnelContact implements ModelInterface, ArrayAccess, \JsonSerializab 'time_zone' => null, 'company_name' => null, 'company_industry' => null, - 'additional_info' => null + 'additional_info' => null, + 'ga_client_id' => null, + 'ga_measurement_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'page_id' => false, + 'first_name' => false, + 'last_name' => false, + 'name' => false, + 'address' => false, + 'city' => false, + 'country' => false, + 'state' => false, + 'zip' => false, + 'email' => false, + 'phone' => false, + 'webinar_at' => true, + 'webinar_last_time' => true, + 'webinar_ext' => false, + 'created_at' => false, + 'updated_at' => false, + 'ip' => false, + 'funnel_id' => false, + 'funnel_step_id' => false, + 'unsubscribed_at' => true, + 'cf_uvid' => false, + 'cart_affiliate_id' => false, + 'shipping_address' => false, + 'shipping_city' => false, + 'shipping_country' => false, + 'shipping_state' => false, + 'shipping_zip' => false, + 'vat_number' => false, + 'affiliate_id' => true, + 'aff_sub' => false, + 'aff_sub2' => false, + 'cf_affiliate_id' => true, + 'contact_profile' => false, + 'time_zone' => true, + 'company_name' => false, + 'company_industry' => false, + 'additional_info' => true, + 'ga_client_id' => false, + 'ga_measurement_id' => false ]; + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -168,6 +225,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -212,7 +321,9 @@ public static function openAPIFormats() 'time_zone' => 'time_zone', 'company_name' => 'company_name', 'company_industry' => 'company_industry', - 'additional_info' => 'additional_info' + 'additional_info' => 'additional_info', + 'ga_client_id' => 'ga_client_id', + 'ga_measurement_id' => 'ga_measurement_id' ]; /** @@ -258,7 +369,9 @@ public static function openAPIFormats() 'time_zone' => 'setTimeZone', 'company_name' => 'setCompanyName', 'company_industry' => 'setCompanyIndustry', - 'additional_info' => 'setAdditionalInfo' + 'additional_info' => 'setAdditionalInfo', + 'ga_client_id' => 'setGaClientId', + 'ga_measurement_id' => 'setGaMeasurementId' ]; /** @@ -304,7 +417,9 @@ public static function openAPIFormats() 'time_zone' => 'getTimeZone', 'company_name' => 'getCompanyName', 'company_industry' => 'getCompanyIndustry', - 'additional_info' => 'getAdditionalInfo' + 'additional_info' => 'getAdditionalInfo', + 'ga_client_id' => 'getGaClientId', + 'ga_measurement_id' => 'getGaMeasurementId' ]; /** @@ -364,44 +479,64 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['page_id'] = $data['page_id'] ?? null; - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['address'] = $data['address'] ?? null; - $this->container['city'] = $data['city'] ?? null; - $this->container['country'] = $data['country'] ?? null; - $this->container['state'] = $data['state'] ?? null; - $this->container['zip'] = $data['zip'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['phone'] = $data['phone'] ?? null; - $this->container['webinar_at'] = $data['webinar_at'] ?? null; - $this->container['webinar_last_time'] = $data['webinar_last_time'] ?? null; - $this->container['webinar_ext'] = $data['webinar_ext'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['ip'] = $data['ip'] ?? null; - $this->container['funnel_id'] = $data['funnel_id'] ?? null; - $this->container['funnel_step_id'] = $data['funnel_step_id'] ?? null; - $this->container['unsubscribed_at'] = $data['unsubscribed_at'] ?? null; - $this->container['cf_uvid'] = $data['cf_uvid'] ?? null; - $this->container['cart_affiliate_id'] = $data['cart_affiliate_id'] ?? null; - $this->container['shipping_address'] = $data['shipping_address'] ?? null; - $this->container['shipping_city'] = $data['shipping_city'] ?? null; - $this->container['shipping_country'] = $data['shipping_country'] ?? null; - $this->container['shipping_state'] = $data['shipping_state'] ?? null; - $this->container['shipping_zip'] = $data['shipping_zip'] ?? null; - $this->container['vat_number'] = $data['vat_number'] ?? null; - $this->container['affiliate_id'] = $data['affiliate_id'] ?? null; - $this->container['aff_sub'] = $data['aff_sub'] ?? null; - $this->container['aff_sub2'] = $data['aff_sub2'] ?? null; - $this->container['cf_affiliate_id'] = $data['cf_affiliate_id'] ?? null; - $this->container['contact_profile'] = $data['contact_profile'] ?? null; - $this->container['time_zone'] = $data['time_zone'] ?? null; - $this->container['company_name'] = $data['company_name'] ?? null; - $this->container['company_industry'] = $data['company_industry'] ?? null; - $this->container['additional_info'] = $data['additional_info'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('page_id', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('zip', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('phone', $data ?? [], null); + $this->setIfExists('webinar_at', $data ?? [], null); + $this->setIfExists('webinar_last_time', $data ?? [], null); + $this->setIfExists('webinar_ext', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('ip', $data ?? [], null); + $this->setIfExists('funnel_id', $data ?? [], null); + $this->setIfExists('funnel_step_id', $data ?? [], null); + $this->setIfExists('unsubscribed_at', $data ?? [], null); + $this->setIfExists('cf_uvid', $data ?? [], null); + $this->setIfExists('cart_affiliate_id', $data ?? [], null); + $this->setIfExists('shipping_address', $data ?? [], null); + $this->setIfExists('shipping_city', $data ?? [], null); + $this->setIfExists('shipping_country', $data ?? [], null); + $this->setIfExists('shipping_state', $data ?? [], null); + $this->setIfExists('shipping_zip', $data ?? [], null); + $this->setIfExists('vat_number', $data ?? [], null); + $this->setIfExists('affiliate_id', $data ?? [], null); + $this->setIfExists('aff_sub', $data ?? [], null); + $this->setIfExists('aff_sub2', $data ?? [], null); + $this->setIfExists('cf_affiliate_id', $data ?? [], null); + $this->setIfExists('contact_profile', $data ?? [], null); + $this->setIfExists('time_zone', $data ?? [], null); + $this->setIfExists('company_name', $data ?? [], null); + $this->setIfExists('company_industry', $data ?? [], null); + $this->setIfExists('additional_info', $data ?? [], null); + $this->setIfExists('ga_client_id', $data ?? [], null); + $this->setIfExists('ga_measurement_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -518,7 +653,7 @@ public function valid() /** * Gets id * - * @return double + * @return float */ public function getId() { @@ -528,12 +663,15 @@ public function getId() /** * Sets id * - * @param double $id id + * @param float $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -542,7 +680,7 @@ public function setId($id) /** * Gets page_id * - * @return double + * @return float */ public function getPageId() { @@ -552,12 +690,15 @@ public function getPageId() /** * Sets page_id * - * @param double $page_id page_id + * @param float $page_id page_id * * @return self */ public function setPageId($page_id) { + if (is_null($page_id)) { + throw new \InvalidArgumentException('non-nullable page_id cannot be null'); + } $this->container['page_id'] = $page_id; return $this; @@ -582,6 +723,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } $this->container['first_name'] = $first_name; return $this; @@ -606,6 +750,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } $this->container['last_name'] = $last_name; return $this; @@ -630,6 +777,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -654,6 +804,9 @@ public function getAddress() */ public function setAddress($address) { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } $this->container['address'] = $address; return $this; @@ -678,6 +831,9 @@ public function getCity() */ public function setCity($city) { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } $this->container['city'] = $city; return $this; @@ -702,6 +858,9 @@ public function getCountry() */ public function setCountry($country) { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } $this->container['country'] = $country; return $this; @@ -726,6 +885,9 @@ public function getState() */ public function setState($state) { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } $this->container['state'] = $state; return $this; @@ -750,6 +912,9 @@ public function getZip() */ public function setZip($zip) { + if (is_null($zip)) { + throw new \InvalidArgumentException('non-nullable zip cannot be null'); + } $this->container['zip'] = $zip; return $this; @@ -774,6 +939,9 @@ public function getEmail() */ public function setEmail($email) { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } $this->container['email'] = $email; return $this; @@ -798,6 +966,9 @@ public function getPhone() */ public function setPhone($phone) { + if (is_null($phone)) { + throw new \InvalidArgumentException('non-nullable phone cannot be null'); + } $this->container['phone'] = $phone; return $this; @@ -822,6 +993,16 @@ public function getWebinarAt() */ public function setWebinarAt($webinar_at) { + if (is_null($webinar_at)) { + array_push($this->openAPINullablesSetToNull, 'webinar_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('webinar_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['webinar_at'] = $webinar_at; return $this; @@ -846,6 +1027,16 @@ public function getWebinarLastTime() */ public function setWebinarLastTime($webinar_last_time) { + if (is_null($webinar_last_time)) { + array_push($this->openAPINullablesSetToNull, 'webinar_last_time'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('webinar_last_time', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['webinar_last_time'] = $webinar_last_time; return $this; @@ -870,6 +1061,9 @@ public function getWebinarExt() */ public function setWebinarExt($webinar_ext) { + if (is_null($webinar_ext)) { + throw new \InvalidArgumentException('non-nullable webinar_ext cannot be null'); + } $this->container['webinar_ext'] = $webinar_ext; return $this; @@ -894,6 +1088,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -918,6 +1115,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -942,6 +1142,9 @@ public function getIp() */ public function setIp($ip) { + if (is_null($ip)) { + throw new \InvalidArgumentException('non-nullable ip cannot be null'); + } $this->container['ip'] = $ip; return $this; @@ -950,7 +1153,7 @@ public function setIp($ip) /** * Gets funnel_id * - * @return double + * @return float */ public function getFunnelId() { @@ -960,12 +1163,15 @@ public function getFunnelId() /** * Sets funnel_id * - * @param double $funnel_id funnel_id + * @param float $funnel_id funnel_id * * @return self */ public function setFunnelId($funnel_id) { + if (is_null($funnel_id)) { + throw new \InvalidArgumentException('non-nullable funnel_id cannot be null'); + } $this->container['funnel_id'] = $funnel_id; return $this; @@ -974,7 +1180,7 @@ public function setFunnelId($funnel_id) /** * Gets funnel_step_id * - * @return double + * @return float */ public function getFunnelStepId() { @@ -984,12 +1190,15 @@ public function getFunnelStepId() /** * Sets funnel_step_id * - * @param double $funnel_step_id funnel_step_id + * @param float $funnel_step_id funnel_step_id * * @return self */ public function setFunnelStepId($funnel_step_id) { + if (is_null($funnel_step_id)) { + throw new \InvalidArgumentException('non-nullable funnel_step_id cannot be null'); + } $this->container['funnel_step_id'] = $funnel_step_id; return $this; @@ -1014,6 +1223,16 @@ public function getUnsubscribedAt() */ public function setUnsubscribedAt($unsubscribed_at) { + if (is_null($unsubscribed_at)) { + array_push($this->openAPINullablesSetToNull, 'unsubscribed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('unsubscribed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['unsubscribed_at'] = $unsubscribed_at; return $this; @@ -1038,6 +1257,9 @@ public function getCfUvid() */ public function setCfUvid($cf_uvid) { + if (is_null($cf_uvid)) { + throw new \InvalidArgumentException('non-nullable cf_uvid cannot be null'); + } $this->container['cf_uvid'] = $cf_uvid; return $this; @@ -1062,6 +1284,9 @@ public function getCartAffiliateId() */ public function setCartAffiliateId($cart_affiliate_id) { + if (is_null($cart_affiliate_id)) { + throw new \InvalidArgumentException('non-nullable cart_affiliate_id cannot be null'); + } $this->container['cart_affiliate_id'] = $cart_affiliate_id; return $this; @@ -1086,6 +1311,9 @@ public function getShippingAddress() */ public function setShippingAddress($shipping_address) { + if (is_null($shipping_address)) { + throw new \InvalidArgumentException('non-nullable shipping_address cannot be null'); + } $this->container['shipping_address'] = $shipping_address; return $this; @@ -1110,6 +1338,9 @@ public function getShippingCity() */ public function setShippingCity($shipping_city) { + if (is_null($shipping_city)) { + throw new \InvalidArgumentException('non-nullable shipping_city cannot be null'); + } $this->container['shipping_city'] = $shipping_city; return $this; @@ -1134,6 +1365,9 @@ public function getShippingCountry() */ public function setShippingCountry($shipping_country) { + if (is_null($shipping_country)) { + throw new \InvalidArgumentException('non-nullable shipping_country cannot be null'); + } $this->container['shipping_country'] = $shipping_country; return $this; @@ -1158,6 +1392,9 @@ public function getShippingState() */ public function setShippingState($shipping_state) { + if (is_null($shipping_state)) { + throw new \InvalidArgumentException('non-nullable shipping_state cannot be null'); + } $this->container['shipping_state'] = $shipping_state; return $this; @@ -1182,6 +1419,9 @@ public function getShippingZip() */ public function setShippingZip($shipping_zip) { + if (is_null($shipping_zip)) { + throw new \InvalidArgumentException('non-nullable shipping_zip cannot be null'); + } $this->container['shipping_zip'] = $shipping_zip; return $this; @@ -1206,6 +1446,9 @@ public function getVatNumber() */ public function setVatNumber($vat_number) { + if (is_null($vat_number)) { + throw new \InvalidArgumentException('non-nullable vat_number cannot be null'); + } $this->container['vat_number'] = $vat_number; return $this; @@ -1230,6 +1473,16 @@ public function getAffiliateId() */ public function setAffiliateId($affiliate_id) { + if (is_null($affiliate_id)) { + array_push($this->openAPINullablesSetToNull, 'affiliate_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('affiliate_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['affiliate_id'] = $affiliate_id; return $this; @@ -1254,6 +1507,9 @@ public function getAffSub() */ public function setAffSub($aff_sub) { + if (is_null($aff_sub)) { + throw new \InvalidArgumentException('non-nullable aff_sub cannot be null'); + } $this->container['aff_sub'] = $aff_sub; return $this; @@ -1278,6 +1534,9 @@ public function getAffSub2() */ public function setAffSub2($aff_sub2) { + if (is_null($aff_sub2)) { + throw new \InvalidArgumentException('non-nullable aff_sub2 cannot be null'); + } $this->container['aff_sub2'] = $aff_sub2; return $this; @@ -1302,6 +1561,16 @@ public function getCfAffiliateId() */ public function setCfAffiliateId($cf_affiliate_id) { + if (is_null($cf_affiliate_id)) { + array_push($this->openAPINullablesSetToNull, 'cf_affiliate_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cf_affiliate_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['cf_affiliate_id'] = $cf_affiliate_id; return $this; @@ -1326,6 +1595,9 @@ public function getContactProfile() */ public function setContactProfile($contact_profile) { + if (is_null($contact_profile)) { + throw new \InvalidArgumentException('non-nullable contact_profile cannot be null'); + } $this->container['contact_profile'] = $contact_profile; return $this; @@ -1350,6 +1622,16 @@ public function getTimeZone() */ public function setTimeZone($time_zone) { + if (is_null($time_zone)) { + array_push($this->openAPINullablesSetToNull, 'time_zone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('time_zone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['time_zone'] = $time_zone; return $this; @@ -1374,6 +1656,9 @@ public function getCompanyName() */ public function setCompanyName($company_name) { + if (is_null($company_name)) { + throw new \InvalidArgumentException('non-nullable company_name cannot be null'); + } $this->container['company_name'] = $company_name; return $this; @@ -1398,6 +1683,9 @@ public function getCompanyIndustry() */ public function setCompanyIndustry($company_industry) { + if (is_null($company_industry)) { + throw new \InvalidArgumentException('non-nullable company_industry cannot be null'); + } $this->container['company_industry'] = $company_industry; return $this; @@ -1422,10 +1710,74 @@ public function getAdditionalInfo() */ public function setAdditionalInfo($additional_info) { + if (is_null($additional_info)) { + array_push($this->openAPINullablesSetToNull, 'additional_info'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('additional_info', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['additional_info'] = $additional_info; return $this; } + + /** + * Gets ga_client_id + * + * @return string|null + */ + public function getGaClientId() + { + return $this->container['ga_client_id']; + } + + /** + * Sets ga_client_id + * + * @param string|null $ga_client_id ga_client_id + * + * @return self + */ + public function setGaClientId($ga_client_id) + { + if (is_null($ga_client_id)) { + throw new \InvalidArgumentException('non-nullable ga_client_id cannot be null'); + } + $this->container['ga_client_id'] = $ga_client_id; + + return $this; + } + + /** + * Gets ga_measurement_id + * + * @return string|null + */ + public function getGaMeasurementId() + { + return $this->container['ga_measurement_id']; + } + + /** + * Sets ga_measurement_id + * + * @param string|null $ga_measurement_id ga_measurement_id + * + * @return self + */ + public function setGaMeasurementId($ga_measurement_id) + { + if (is_null($ga_measurement_id)) { + throw new \InvalidArgumentException('non-nullable ga_measurement_id cannot be null'); + } + $this->container['ga_measurement_id'] = $ga_measurement_id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -1433,7 +1785,7 @@ public function setAdditionalInfo($additional_info) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1445,6 +1797,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1458,7 +1811,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1474,7 +1827,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1486,6 +1839,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ClickFunnelContactProfile.php b/lib/Model/ClickFunnelContactProfile.php index a0befae..bf0462a 100644 --- a/lib/Model/ClickFunnelContactProfile.php +++ b/lib/Model/ClickFunnelContactProfile.php @@ -2,7 +2,7 @@ /** * ClickFunnelContactProfile * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ClickFunnelContactProfile implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class ClickFunnelContactProfile implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'id' => 'double', + 'id' => 'float', 'first_name' => 'string', 'last_name' => 'string', 'address' => 'string', @@ -142,6 +140,56 @@ class ClickFunnelContactProfile implements ModelInterface, ArrayAccess, \JsonSer 'globally_unsubscribed' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'first_name' => false, + 'last_name' => false, + 'address' => false, + 'city' => false, + 'country' => true, + 'state' => true, + 'zip' => false, + 'email' => false, + 'phone' => false, + 'created_at' => false, + 'updated_at' => false, + 'unsubscribed_at' => true, + 'cf_uvid' => false, + 'shipping_address' => false, + 'shipping_country' => true, + 'shipping_city' => true, + 'shipping_state' => true, + 'shipping_zip' => true, + 'vat_number' => true, + 'middle_name' => true, + 'websites' => true, + 'location_general' => true, + 'normalized_location' => true, + 'deduced_location' => true, + 'age' => true, + 'gender' => true, + 'age_range_lower' => true, + 'age_range_upper' => true, + 'action_score' => true, + 'known_ltv' => false, + 'tags' => false, + 'time_zone' => true, + 'lists_names' => false, + 'globally_unsubscribed' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -162,6 +210,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -349,41 +449,59 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['address'] = $data['address'] ?? null; - $this->container['city'] = $data['city'] ?? null; - $this->container['country'] = $data['country'] ?? null; - $this->container['state'] = $data['state'] ?? null; - $this->container['zip'] = $data['zip'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['phone'] = $data['phone'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['unsubscribed_at'] = $data['unsubscribed_at'] ?? null; - $this->container['cf_uvid'] = $data['cf_uvid'] ?? null; - $this->container['shipping_address'] = $data['shipping_address'] ?? null; - $this->container['shipping_country'] = $data['shipping_country'] ?? null; - $this->container['shipping_city'] = $data['shipping_city'] ?? null; - $this->container['shipping_state'] = $data['shipping_state'] ?? null; - $this->container['shipping_zip'] = $data['shipping_zip'] ?? null; - $this->container['vat_number'] = $data['vat_number'] ?? null; - $this->container['middle_name'] = $data['middle_name'] ?? null; - $this->container['websites'] = $data['websites'] ?? null; - $this->container['location_general'] = $data['location_general'] ?? null; - $this->container['normalized_location'] = $data['normalized_location'] ?? null; - $this->container['deduced_location'] = $data['deduced_location'] ?? null; - $this->container['age'] = $data['age'] ?? null; - $this->container['gender'] = $data['gender'] ?? null; - $this->container['age_range_lower'] = $data['age_range_lower'] ?? null; - $this->container['age_range_upper'] = $data['age_range_upper'] ?? null; - $this->container['action_score'] = $data['action_score'] ?? null; - $this->container['known_ltv'] = $data['known_ltv'] ?? null; - $this->container['tags'] = $data['tags'] ?? null; - $this->container['time_zone'] = $data['time_zone'] ?? null; - $this->container['lists_names'] = $data['lists_names'] ?? null; - $this->container['globally_unsubscribed'] = $data['globally_unsubscribed'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('address', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('zip', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('phone', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('unsubscribed_at', $data ?? [], null); + $this->setIfExists('cf_uvid', $data ?? [], null); + $this->setIfExists('shipping_address', $data ?? [], null); + $this->setIfExists('shipping_country', $data ?? [], null); + $this->setIfExists('shipping_city', $data ?? [], null); + $this->setIfExists('shipping_state', $data ?? [], null); + $this->setIfExists('shipping_zip', $data ?? [], null); + $this->setIfExists('vat_number', $data ?? [], null); + $this->setIfExists('middle_name', $data ?? [], null); + $this->setIfExists('websites', $data ?? [], null); + $this->setIfExists('location_general', $data ?? [], null); + $this->setIfExists('normalized_location', $data ?? [], null); + $this->setIfExists('deduced_location', $data ?? [], null); + $this->setIfExists('age', $data ?? [], null); + $this->setIfExists('gender', $data ?? [], null); + $this->setIfExists('age_range_lower', $data ?? [], null); + $this->setIfExists('age_range_upper', $data ?? [], null); + $this->setIfExists('action_score', $data ?? [], null); + $this->setIfExists('known_ltv', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('time_zone', $data ?? [], null); + $this->setIfExists('lists_names', $data ?? [], null); + $this->setIfExists('globally_unsubscribed', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -455,7 +573,7 @@ public function valid() /** * Gets id * - * @return double + * @return float */ public function getId() { @@ -465,12 +583,15 @@ public function getId() /** * Sets id * - * @param double $id id + * @param float $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -495,6 +616,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } $this->container['first_name'] = $first_name; return $this; @@ -519,6 +643,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } $this->container['last_name'] = $last_name; return $this; @@ -543,6 +670,9 @@ public function getAddress() */ public function setAddress($address) { + if (is_null($address)) { + throw new \InvalidArgumentException('non-nullable address cannot be null'); + } $this->container['address'] = $address; return $this; @@ -567,6 +697,9 @@ public function getCity() */ public function setCity($city) { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } $this->container['city'] = $city; return $this; @@ -591,6 +724,16 @@ public function getCountry() */ public function setCountry($country) { + if (is_null($country)) { + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['country'] = $country; return $this; @@ -615,6 +758,16 @@ public function getState() */ public function setState($state) { + if (is_null($state)) { + array_push($this->openAPINullablesSetToNull, 'state'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('state', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['state'] = $state; return $this; @@ -639,6 +792,9 @@ public function getZip() */ public function setZip($zip) { + if (is_null($zip)) { + throw new \InvalidArgumentException('non-nullable zip cannot be null'); + } $this->container['zip'] = $zip; return $this; @@ -663,6 +819,9 @@ public function getEmail() */ public function setEmail($email) { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } $this->container['email'] = $email; return $this; @@ -687,6 +846,9 @@ public function getPhone() */ public function setPhone($phone) { + if (is_null($phone)) { + throw new \InvalidArgumentException('non-nullable phone cannot be null'); + } $this->container['phone'] = $phone; return $this; @@ -711,6 +873,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -735,6 +900,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -759,6 +927,16 @@ public function getUnsubscribedAt() */ public function setUnsubscribedAt($unsubscribed_at) { + if (is_null($unsubscribed_at)) { + array_push($this->openAPINullablesSetToNull, 'unsubscribed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('unsubscribed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['unsubscribed_at'] = $unsubscribed_at; return $this; @@ -783,6 +961,9 @@ public function getCfUvid() */ public function setCfUvid($cf_uvid) { + if (is_null($cf_uvid)) { + throw new \InvalidArgumentException('non-nullable cf_uvid cannot be null'); + } $this->container['cf_uvid'] = $cf_uvid; return $this; @@ -807,6 +988,9 @@ public function getShippingAddress() */ public function setShippingAddress($shipping_address) { + if (is_null($shipping_address)) { + throw new \InvalidArgumentException('non-nullable shipping_address cannot be null'); + } $this->container['shipping_address'] = $shipping_address; return $this; @@ -831,6 +1015,16 @@ public function getShippingCountry() */ public function setShippingCountry($shipping_country) { + if (is_null($shipping_country)) { + array_push($this->openAPINullablesSetToNull, 'shipping_country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shipping_country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['shipping_country'] = $shipping_country; return $this; @@ -855,6 +1049,16 @@ public function getShippingCity() */ public function setShippingCity($shipping_city) { + if (is_null($shipping_city)) { + array_push($this->openAPINullablesSetToNull, 'shipping_city'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shipping_city', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['shipping_city'] = $shipping_city; return $this; @@ -879,6 +1083,16 @@ public function getShippingState() */ public function setShippingState($shipping_state) { + if (is_null($shipping_state)) { + array_push($this->openAPINullablesSetToNull, 'shipping_state'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shipping_state', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['shipping_state'] = $shipping_state; return $this; @@ -903,6 +1117,16 @@ public function getShippingZip() */ public function setShippingZip($shipping_zip) { + if (is_null($shipping_zip)) { + array_push($this->openAPINullablesSetToNull, 'shipping_zip'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shipping_zip', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['shipping_zip'] = $shipping_zip; return $this; @@ -927,6 +1151,16 @@ public function getVatNumber() */ public function setVatNumber($vat_number) { + if (is_null($vat_number)) { + array_push($this->openAPINullablesSetToNull, 'vat_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('vat_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['vat_number'] = $vat_number; return $this; @@ -951,6 +1185,16 @@ public function getMiddleName() */ public function setMiddleName($middle_name) { + if (is_null($middle_name)) { + array_push($this->openAPINullablesSetToNull, 'middle_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('middle_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['middle_name'] = $middle_name; return $this; @@ -975,6 +1219,16 @@ public function getWebsites() */ public function setWebsites($websites) { + if (is_null($websites)) { + array_push($this->openAPINullablesSetToNull, 'websites'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('websites', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['websites'] = $websites; return $this; @@ -999,6 +1253,16 @@ public function getLocationGeneral() */ public function setLocationGeneral($location_general) { + if (is_null($location_general)) { + array_push($this->openAPINullablesSetToNull, 'location_general'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('location_general', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['location_general'] = $location_general; return $this; @@ -1023,6 +1287,16 @@ public function getNormalizedLocation() */ public function setNormalizedLocation($normalized_location) { + if (is_null($normalized_location)) { + array_push($this->openAPINullablesSetToNull, 'normalized_location'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('normalized_location', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['normalized_location'] = $normalized_location; return $this; @@ -1047,6 +1321,16 @@ public function getDeducedLocation() */ public function setDeducedLocation($deduced_location) { + if (is_null($deduced_location)) { + array_push($this->openAPINullablesSetToNull, 'deduced_location'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('deduced_location', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['deduced_location'] = $deduced_location; return $this; @@ -1071,6 +1355,16 @@ public function getAge() */ public function setAge($age) { + if (is_null($age)) { + array_push($this->openAPINullablesSetToNull, 'age'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('age', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['age'] = $age; return $this; @@ -1095,6 +1389,16 @@ public function getGender() */ public function setGender($gender) { + if (is_null($gender)) { + array_push($this->openAPINullablesSetToNull, 'gender'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('gender', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['gender'] = $gender; return $this; @@ -1119,6 +1423,16 @@ public function getAgeRangeLower() */ public function setAgeRangeLower($age_range_lower) { + if (is_null($age_range_lower)) { + array_push($this->openAPINullablesSetToNull, 'age_range_lower'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('age_range_lower', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['age_range_lower'] = $age_range_lower; return $this; @@ -1143,6 +1457,16 @@ public function getAgeRangeUpper() */ public function setAgeRangeUpper($age_range_upper) { + if (is_null($age_range_upper)) { + array_push($this->openAPINullablesSetToNull, 'age_range_upper'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('age_range_upper', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['age_range_upper'] = $age_range_upper; return $this; @@ -1167,6 +1491,16 @@ public function getActionScore() */ public function setActionScore($action_score) { + if (is_null($action_score)) { + array_push($this->openAPINullablesSetToNull, 'action_score'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('action_score', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['action_score'] = $action_score; return $this; @@ -1191,6 +1525,9 @@ public function getKnownLtv() */ public function setKnownLtv($known_ltv) { + if (is_null($known_ltv)) { + throw new \InvalidArgumentException('non-nullable known_ltv cannot be null'); + } $this->container['known_ltv'] = $known_ltv; return $this; @@ -1215,6 +1552,9 @@ public function getTags() */ public function setTags($tags) { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } $this->container['tags'] = $tags; return $this; @@ -1239,6 +1579,16 @@ public function getTimeZone() */ public function setTimeZone($time_zone) { + if (is_null($time_zone)) { + array_push($this->openAPINullablesSetToNull, 'time_zone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('time_zone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['time_zone'] = $time_zone; return $this; @@ -1263,6 +1613,9 @@ public function getListsNames() */ public function setListsNames($lists_names) { + if (is_null($lists_names)) { + throw new \InvalidArgumentException('non-nullable lists_names cannot be null'); + } $this->container['lists_names'] = $lists_names; return $this; @@ -1287,6 +1640,9 @@ public function getGloballyUnsubscribed() */ public function setGloballyUnsubscribed($globally_unsubscribed) { + if (is_null($globally_unsubscribed)) { + throw new \InvalidArgumentException('non-nullable globally_unsubscribed cannot be null'); + } $this->container['globally_unsubscribed'] = $globally_unsubscribed; return $this; @@ -1298,7 +1654,7 @@ public function setGloballyUnsubscribed($globally_unsubscribed) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1310,6 +1666,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1323,7 +1680,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1339,7 +1696,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1351,6 +1708,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ClickFunnelEvent.php b/lib/Model/ClickFunnelEvent.php index ae6040d..081465a 100644 --- a/lib/Model/ClickFunnelEvent.php +++ b/lib/Model/ClickFunnelEvent.php @@ -2,7 +2,7 @@ /** * ClickFunnelEvent * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ClickFunnelEvent implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class ClickFunnelEvent implements ModelInterface, ArrayAccess, \JsonSerializable 'event' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'purchase' => false, + 'event' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['purchase'] = $data['purchase'] ?? null; - $this->container['event'] = $data['event'] ?? null; + $this->setIfExists('purchase', $data ?? [], null); + $this->setIfExists('event', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -237,6 +322,9 @@ public function getPurchase() */ public function setPurchase($purchase) { + if (is_null($purchase)) { + throw new \InvalidArgumentException('non-nullable purchase cannot be null'); + } $this->container['purchase'] = $purchase; return $this; @@ -261,6 +349,9 @@ public function getEvent() */ public function setEvent($event) { + if (is_null($event)) { + throw new \InvalidArgumentException('non-nullable event cannot be null'); + } $this->container['event'] = $event; return $this; @@ -272,7 +363,7 @@ public function setEvent($event) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -284,6 +375,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -297,7 +389,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -313,7 +405,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -325,6 +417,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ClickFunnelOriginalAmount.php b/lib/Model/ClickFunnelOriginalAmount.php index 81e1c69..416cb54 100644 --- a/lib/Model/ClickFunnelOriginalAmount.php +++ b/lib/Model/ClickFunnelOriginalAmount.php @@ -2,7 +2,7 @@ /** * ClickFunnelOriginalAmount * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ClickFunnelOriginalAmount implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class ClickFunnelOriginalAmount implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'cents' => 'double', + 'cents' => 'float', 'currency_iso' => 'string' ]; @@ -76,6 +74,23 @@ class ClickFunnelOriginalAmount implements ModelInterface, ArrayAccess, \JsonSer 'currency_iso' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cents' => false, + 'currency_iso' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['cents'] = $data['cents'] ?? null; - $this->container['currency_iso'] = $data['currency_iso'] ?? null; + $this->setIfExists('cents', $data ?? [], null); + $this->setIfExists('currency_iso', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -221,7 +306,7 @@ public function valid() /** * Gets cents * - * @return double + * @return float */ public function getCents() { @@ -231,12 +316,15 @@ public function getCents() /** * Sets cents * - * @param double $cents cents + * @param float $cents cents * * @return self */ public function setCents($cents) { + if (is_null($cents)) { + throw new \InvalidArgumentException('non-nullable cents cannot be null'); + } $this->container['cents'] = $cents; return $this; @@ -261,6 +349,9 @@ public function getCurrencyIso() */ public function setCurrencyIso($currency_iso) { + if (is_null($currency_iso)) { + throw new \InvalidArgumentException('non-nullable currency_iso cannot be null'); + } $this->container['currency_iso'] = $currency_iso; return $this; @@ -272,7 +363,7 @@ public function setCurrencyIso($currency_iso) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -284,6 +375,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -297,7 +389,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -313,7 +405,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -325,6 +417,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ClickFunnelProduct.php b/lib/Model/ClickFunnelProduct.php index 6c75ff5..b9a9689 100644 --- a/lib/Model/ClickFunnelProduct.php +++ b/lib/Model/ClickFunnelProduct.php @@ -2,7 +2,7 @@ /** * ClickFunnelProduct * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ClickFunnelProduct implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class ClickFunnelProduct implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'id' => 'double', + 'id' => 'float', 'name' => 'string', 'stripe_plan' => 'string', 'amount' => '\OpenAPI\Client\Model\ClickFunnelAmount', @@ -69,7 +67,7 @@ class ClickFunnelProduct implements ModelInterface, ArrayAccess, \JsonSerializab 'updated_at' => '\DateTime', 'subject' => 'string', 'html_body' => 'string', - 'thank_you_page_id' => 'double', + 'thank_you_page_id' => 'float', 'stripe_cancel_after_payments' => 'mixed', 'bump' => 'bool', 'cart_product_id' => 'mixed', @@ -128,6 +126,49 @@ class ClickFunnelProduct implements ModelInterface, ArrayAccess, \JsonSerializab 'description' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'stripe_plan' => false, + 'amount' => false, + 'amount_currency' => false, + 'created_at' => false, + 'updated_at' => false, + 'subject' => false, + 'html_body' => false, + 'thank_you_page_id' => false, + 'stripe_cancel_after_payments' => true, + 'bump' => false, + 'cart_product_id' => true, + 'billing_integration' => false, + 'infusionsoft_product_id' => true, + 'infusionsoft_subscription_id' => true, + 'ontraport_product_id' => true, + 'ontraport_payment_count' => true, + 'ontraport_payment_type' => true, + 'ontraport_unit' => true, + 'ontraport_gateway_id' => true, + 'ontraport_invoice_id' => true, + 'commissionable' => false, + 'statement_descriptor' => false, + 'netsuite_id' => true, + 'netsuite_tag' => true, + 'netsuite_class' => true, + 'description' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -148,6 +189,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -314,34 +407,52 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['stripe_plan'] = $data['stripe_plan'] ?? null; - $this->container['amount'] = $data['amount'] ?? null; - $this->container['amount_currency'] = $data['amount_currency'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['html_body'] = $data['html_body'] ?? null; - $this->container['thank_you_page_id'] = $data['thank_you_page_id'] ?? null; - $this->container['stripe_cancel_after_payments'] = $data['stripe_cancel_after_payments'] ?? null; - $this->container['bump'] = $data['bump'] ?? null; - $this->container['cart_product_id'] = $data['cart_product_id'] ?? null; - $this->container['billing_integration'] = $data['billing_integration'] ?? null; - $this->container['infusionsoft_product_id'] = $data['infusionsoft_product_id'] ?? null; - $this->container['infusionsoft_subscription_id'] = $data['infusionsoft_subscription_id'] ?? null; - $this->container['ontraport_product_id'] = $data['ontraport_product_id'] ?? null; - $this->container['ontraport_payment_count'] = $data['ontraport_payment_count'] ?? null; - $this->container['ontraport_payment_type'] = $data['ontraport_payment_type'] ?? null; - $this->container['ontraport_unit'] = $data['ontraport_unit'] ?? null; - $this->container['ontraport_gateway_id'] = $data['ontraport_gateway_id'] ?? null; - $this->container['ontraport_invoice_id'] = $data['ontraport_invoice_id'] ?? null; - $this->container['commissionable'] = $data['commissionable'] ?? null; - $this->container['statement_descriptor'] = $data['statement_descriptor'] ?? null; - $this->container['netsuite_id'] = $data['netsuite_id'] ?? null; - $this->container['netsuite_tag'] = $data['netsuite_tag'] ?? null; - $this->container['netsuite_class'] = $data['netsuite_class'] ?? null; - $this->container['description'] = $data['description'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('stripe_plan', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('amount_currency', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('html_body', $data ?? [], null); + $this->setIfExists('thank_you_page_id', $data ?? [], null); + $this->setIfExists('stripe_cancel_after_payments', $data ?? [], null); + $this->setIfExists('bump', $data ?? [], null); + $this->setIfExists('cart_product_id', $data ?? [], null); + $this->setIfExists('billing_integration', $data ?? [], null); + $this->setIfExists('infusionsoft_product_id', $data ?? [], null); + $this->setIfExists('infusionsoft_subscription_id', $data ?? [], null); + $this->setIfExists('ontraport_product_id', $data ?? [], null); + $this->setIfExists('ontraport_payment_count', $data ?? [], null); + $this->setIfExists('ontraport_payment_type', $data ?? [], null); + $this->setIfExists('ontraport_unit', $data ?? [], null); + $this->setIfExists('ontraport_gateway_id', $data ?? [], null); + $this->setIfExists('ontraport_invoice_id', $data ?? [], null); + $this->setIfExists('commissionable', $data ?? [], null); + $this->setIfExists('statement_descriptor', $data ?? [], null); + $this->setIfExists('netsuite_id', $data ?? [], null); + $this->setIfExists('netsuite_tag', $data ?? [], null); + $this->setIfExists('netsuite_class', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -416,7 +527,7 @@ public function valid() /** * Gets id * - * @return double + * @return float */ public function getId() { @@ -426,12 +537,15 @@ public function getId() /** * Sets id * - * @param double $id id + * @param float $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -456,6 +570,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -480,6 +597,9 @@ public function getStripePlan() */ public function setStripePlan($stripe_plan) { + if (is_null($stripe_plan)) { + throw new \InvalidArgumentException('non-nullable stripe_plan cannot be null'); + } $this->container['stripe_plan'] = $stripe_plan; return $this; @@ -504,6 +624,9 @@ public function getAmount() */ public function setAmount($amount) { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } $this->container['amount'] = $amount; return $this; @@ -528,6 +651,9 @@ public function getAmountCurrency() */ public function setAmountCurrency($amount_currency) { + if (is_null($amount_currency)) { + throw new \InvalidArgumentException('non-nullable amount_currency cannot be null'); + } $this->container['amount_currency'] = $amount_currency; return $this; @@ -552,6 +678,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -576,6 +705,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -600,6 +732,9 @@ public function getSubject() */ public function setSubject($subject) { + if (is_null($subject)) { + throw new \InvalidArgumentException('non-nullable subject cannot be null'); + } $this->container['subject'] = $subject; return $this; @@ -624,6 +759,9 @@ public function getHtmlBody() */ public function setHtmlBody($html_body) { + if (is_null($html_body)) { + throw new \InvalidArgumentException('non-nullable html_body cannot be null'); + } $this->container['html_body'] = $html_body; return $this; @@ -632,7 +770,7 @@ public function setHtmlBody($html_body) /** * Gets thank_you_page_id * - * @return double + * @return float */ public function getThankYouPageId() { @@ -642,12 +780,15 @@ public function getThankYouPageId() /** * Sets thank_you_page_id * - * @param double $thank_you_page_id thank_you_page_id + * @param float $thank_you_page_id thank_you_page_id * * @return self */ public function setThankYouPageId($thank_you_page_id) { + if (is_null($thank_you_page_id)) { + throw new \InvalidArgumentException('non-nullable thank_you_page_id cannot be null'); + } $this->container['thank_you_page_id'] = $thank_you_page_id; return $this; @@ -672,6 +813,16 @@ public function getStripeCancelAfterPayments() */ public function setStripeCancelAfterPayments($stripe_cancel_after_payments) { + if (is_null($stripe_cancel_after_payments)) { + array_push($this->openAPINullablesSetToNull, 'stripe_cancel_after_payments'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stripe_cancel_after_payments', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['stripe_cancel_after_payments'] = $stripe_cancel_after_payments; return $this; @@ -696,6 +847,9 @@ public function getBump() */ public function setBump($bump) { + if (is_null($bump)) { + throw new \InvalidArgumentException('non-nullable bump cannot be null'); + } $this->container['bump'] = $bump; return $this; @@ -720,6 +874,16 @@ public function getCartProductId() */ public function setCartProductId($cart_product_id) { + if (is_null($cart_product_id)) { + array_push($this->openAPINullablesSetToNull, 'cart_product_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('cart_product_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['cart_product_id'] = $cart_product_id; return $this; @@ -744,6 +908,9 @@ public function getBillingIntegration() */ public function setBillingIntegration($billing_integration) { + if (is_null($billing_integration)) { + throw new \InvalidArgumentException('non-nullable billing_integration cannot be null'); + } $this->container['billing_integration'] = $billing_integration; return $this; @@ -768,6 +935,16 @@ public function getInfusionsoftProductId() */ public function setInfusionsoftProductId($infusionsoft_product_id) { + if (is_null($infusionsoft_product_id)) { + array_push($this->openAPINullablesSetToNull, 'infusionsoft_product_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('infusionsoft_product_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['infusionsoft_product_id'] = $infusionsoft_product_id; return $this; @@ -792,6 +969,16 @@ public function getInfusionsoftSubscriptionId() */ public function setInfusionsoftSubscriptionId($infusionsoft_subscription_id) { + if (is_null($infusionsoft_subscription_id)) { + array_push($this->openAPINullablesSetToNull, 'infusionsoft_subscription_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('infusionsoft_subscription_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['infusionsoft_subscription_id'] = $infusionsoft_subscription_id; return $this; @@ -816,6 +1003,16 @@ public function getOntraportProductId() */ public function setOntraportProductId($ontraport_product_id) { + if (is_null($ontraport_product_id)) { + array_push($this->openAPINullablesSetToNull, 'ontraport_product_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ontraport_product_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['ontraport_product_id'] = $ontraport_product_id; return $this; @@ -840,6 +1037,16 @@ public function getOntraportPaymentCount() */ public function setOntraportPaymentCount($ontraport_payment_count) { + if (is_null($ontraport_payment_count)) { + array_push($this->openAPINullablesSetToNull, 'ontraport_payment_count'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ontraport_payment_count', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['ontraport_payment_count'] = $ontraport_payment_count; return $this; @@ -864,6 +1071,16 @@ public function getOntraportPaymentType() */ public function setOntraportPaymentType($ontraport_payment_type) { + if (is_null($ontraport_payment_type)) { + array_push($this->openAPINullablesSetToNull, 'ontraport_payment_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ontraport_payment_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['ontraport_payment_type'] = $ontraport_payment_type; return $this; @@ -888,6 +1105,16 @@ public function getOntraportUnit() */ public function setOntraportUnit($ontraport_unit) { + if (is_null($ontraport_unit)) { + array_push($this->openAPINullablesSetToNull, 'ontraport_unit'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ontraport_unit', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['ontraport_unit'] = $ontraport_unit; return $this; @@ -912,6 +1139,16 @@ public function getOntraportGatewayId() */ public function setOntraportGatewayId($ontraport_gateway_id) { + if (is_null($ontraport_gateway_id)) { + array_push($this->openAPINullablesSetToNull, 'ontraport_gateway_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ontraport_gateway_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['ontraport_gateway_id'] = $ontraport_gateway_id; return $this; @@ -936,6 +1173,16 @@ public function getOntraportInvoiceId() */ public function setOntraportInvoiceId($ontraport_invoice_id) { + if (is_null($ontraport_invoice_id)) { + array_push($this->openAPINullablesSetToNull, 'ontraport_invoice_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ontraport_invoice_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['ontraport_invoice_id'] = $ontraport_invoice_id; return $this; @@ -960,6 +1207,9 @@ public function getCommissionable() */ public function setCommissionable($commissionable) { + if (is_null($commissionable)) { + throw new \InvalidArgumentException('non-nullable commissionable cannot be null'); + } $this->container['commissionable'] = $commissionable; return $this; @@ -984,6 +1234,9 @@ public function getStatementDescriptor() */ public function setStatementDescriptor($statement_descriptor) { + if (is_null($statement_descriptor)) { + throw new \InvalidArgumentException('non-nullable statement_descriptor cannot be null'); + } $this->container['statement_descriptor'] = $statement_descriptor; return $this; @@ -1008,6 +1261,16 @@ public function getNetsuiteId() */ public function setNetsuiteId($netsuite_id) { + if (is_null($netsuite_id)) { + array_push($this->openAPINullablesSetToNull, 'netsuite_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netsuite_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['netsuite_id'] = $netsuite_id; return $this; @@ -1032,6 +1295,16 @@ public function getNetsuiteTag() */ public function setNetsuiteTag($netsuite_tag) { + if (is_null($netsuite_tag)) { + array_push($this->openAPINullablesSetToNull, 'netsuite_tag'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netsuite_tag', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['netsuite_tag'] = $netsuite_tag; return $this; @@ -1056,6 +1329,16 @@ public function getNetsuiteClass() */ public function setNetsuiteClass($netsuite_class) { + if (is_null($netsuite_class)) { + array_push($this->openAPINullablesSetToNull, 'netsuite_class'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('netsuite_class', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['netsuite_class'] = $netsuite_class; return $this; @@ -1080,6 +1363,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } $this->container['description'] = $description; return $this; @@ -1091,7 +1377,7 @@ public function setDescription($description) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1103,6 +1389,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1116,7 +1403,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1132,7 +1419,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1144,6 +1431,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ClickFunnelPurchase.php b/lib/Model/ClickFunnelPurchase.php index 5d1a6fc..fdcdb23 100644 --- a/lib/Model/ClickFunnelPurchase.php +++ b/lib/Model/ClickFunnelPurchase.php @@ -2,7 +2,7 @@ /** * ClickFunnelPurchase * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ClickFunnelPurchase implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,11 +58,11 @@ class ClickFunnelPurchase implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'id' => 'double', + 'id' => 'float', 'products' => '\OpenAPI\Client\Model\ClickFunnelProduct[]', 'member_id' => 'mixed', 'contact' => '\OpenAPI\Client\Model\ClickFunnelContact', - 'funnel_id' => 'double', + 'funnel_id' => 'float', 'stripe_customer_token' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -79,7 +77,7 @@ class ClickFunnelPurchase implements ModelInterface, ArrayAccess, \JsonSerializa 'infusionsoft_ccid' => 'mixed', 'oap_customer_id' => 'mixed', 'payment_instrument_type' => 'mixed', - 'original_amount_cents' => 'double', + 'original_amount_cents' => 'float', 'original_amount' => '\OpenAPI\Client\Model\ClickFunnelOriginalAmount', 'original_amount_currency' => 'string', 'manual' => 'bool', @@ -122,6 +120,46 @@ class ClickFunnelPurchase implements ModelInterface, ArrayAccess, \JsonSerializa 'nmi_customer_vault_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'products' => false, + 'member_id' => true, + 'contact' => false, + 'funnel_id' => false, + 'stripe_customer_token' => false, + 'created_at' => false, + 'updated_at' => false, + 'subscription_id' => true, + 'charge_id' => true, + 'ctransreceipt' => true, + 'status' => false, + 'fulfillment_status' => true, + 'fulfillment_id' => true, + 'fulfillments' => false, + 'payments_count' => true, + 'infusionsoft_ccid' => true, + 'oap_customer_id' => true, + 'payment_instrument_type' => true, + 'original_amount_cents' => false, + 'original_amount' => false, + 'original_amount_currency' => false, + 'manual' => false, + 'error_message' => true, + 'nmi_customer_vault_id' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -142,6 +180,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -299,31 +389,49 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['products'] = $data['products'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['contact'] = $data['contact'] ?? null; - $this->container['funnel_id'] = $data['funnel_id'] ?? null; - $this->container['stripe_customer_token'] = $data['stripe_customer_token'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['subscription_id'] = $data['subscription_id'] ?? null; - $this->container['charge_id'] = $data['charge_id'] ?? null; - $this->container['ctransreceipt'] = $data['ctransreceipt'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['fulfillment_status'] = $data['fulfillment_status'] ?? null; - $this->container['fulfillment_id'] = $data['fulfillment_id'] ?? null; - $this->container['fulfillments'] = $data['fulfillments'] ?? null; - $this->container['payments_count'] = $data['payments_count'] ?? null; - $this->container['infusionsoft_ccid'] = $data['infusionsoft_ccid'] ?? null; - $this->container['oap_customer_id'] = $data['oap_customer_id'] ?? null; - $this->container['payment_instrument_type'] = $data['payment_instrument_type'] ?? null; - $this->container['original_amount_cents'] = $data['original_amount_cents'] ?? null; - $this->container['original_amount'] = $data['original_amount'] ?? null; - $this->container['original_amount_currency'] = $data['original_amount_currency'] ?? null; - $this->container['manual'] = $data['manual'] ?? null; - $this->container['error_message'] = $data['error_message'] ?? null; - $this->container['nmi_customer_vault_id'] = $data['nmi_customer_vault_id'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('products', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('contact', $data ?? [], null); + $this->setIfExists('funnel_id', $data ?? [], null); + $this->setIfExists('stripe_customer_token', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('subscription_id', $data ?? [], null); + $this->setIfExists('charge_id', $data ?? [], null); + $this->setIfExists('ctransreceipt', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('fulfillment_status', $data ?? [], null); + $this->setIfExists('fulfillment_id', $data ?? [], null); + $this->setIfExists('fulfillments', $data ?? [], null); + $this->setIfExists('payments_count', $data ?? [], null); + $this->setIfExists('infusionsoft_ccid', $data ?? [], null); + $this->setIfExists('oap_customer_id', $data ?? [], null); + $this->setIfExists('payment_instrument_type', $data ?? [], null); + $this->setIfExists('original_amount_cents', $data ?? [], null); + $this->setIfExists('original_amount', $data ?? [], null); + $this->setIfExists('original_amount_currency', $data ?? [], null); + $this->setIfExists('manual', $data ?? [], null); + $this->setIfExists('error_message', $data ?? [], null); + $this->setIfExists('nmi_customer_vault_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -392,7 +500,7 @@ public function valid() /** * Gets id * - * @return double + * @return float */ public function getId() { @@ -402,12 +510,15 @@ public function getId() /** * Sets id * - * @param double $id id + * @param float $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -432,6 +543,9 @@ public function getProducts() */ public function setProducts($products) { + if (is_null($products)) { + throw new \InvalidArgumentException('non-nullable products cannot be null'); + } $this->container['products'] = $products; return $this; @@ -456,6 +570,16 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + array_push($this->openAPINullablesSetToNull, 'member_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('member_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['member_id'] = $member_id; return $this; @@ -480,6 +604,9 @@ public function getContact() */ public function setContact($contact) { + if (is_null($contact)) { + throw new \InvalidArgumentException('non-nullable contact cannot be null'); + } $this->container['contact'] = $contact; return $this; @@ -488,7 +615,7 @@ public function setContact($contact) /** * Gets funnel_id * - * @return double + * @return float */ public function getFunnelId() { @@ -498,12 +625,15 @@ public function getFunnelId() /** * Sets funnel_id * - * @param double $funnel_id funnel_id + * @param float $funnel_id funnel_id * * @return self */ public function setFunnelId($funnel_id) { + if (is_null($funnel_id)) { + throw new \InvalidArgumentException('non-nullable funnel_id cannot be null'); + } $this->container['funnel_id'] = $funnel_id; return $this; @@ -528,6 +658,9 @@ public function getStripeCustomerToken() */ public function setStripeCustomerToken($stripe_customer_token) { + if (is_null($stripe_customer_token)) { + throw new \InvalidArgumentException('non-nullable stripe_customer_token cannot be null'); + } $this->container['stripe_customer_token'] = $stripe_customer_token; return $this; @@ -552,6 +685,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -576,6 +712,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -600,6 +739,16 @@ public function getSubscriptionId() */ public function setSubscriptionId($subscription_id) { + if (is_null($subscription_id)) { + array_push($this->openAPINullablesSetToNull, 'subscription_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subscription_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['subscription_id'] = $subscription_id; return $this; @@ -624,6 +773,16 @@ public function getChargeId() */ public function setChargeId($charge_id) { + if (is_null($charge_id)) { + array_push($this->openAPINullablesSetToNull, 'charge_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('charge_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['charge_id'] = $charge_id; return $this; @@ -648,6 +807,16 @@ public function getCtransreceipt() */ public function setCtransreceipt($ctransreceipt) { + if (is_null($ctransreceipt)) { + array_push($this->openAPINullablesSetToNull, 'ctransreceipt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ctransreceipt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['ctransreceipt'] = $ctransreceipt; return $this; @@ -672,6 +841,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -696,6 +868,16 @@ public function getFulfillmentStatus() */ public function setFulfillmentStatus($fulfillment_status) { + if (is_null($fulfillment_status)) { + array_push($this->openAPINullablesSetToNull, 'fulfillment_status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fulfillment_status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['fulfillment_status'] = $fulfillment_status; return $this; @@ -720,6 +902,16 @@ public function getFulfillmentId() */ public function setFulfillmentId($fulfillment_id) { + if (is_null($fulfillment_id)) { + array_push($this->openAPINullablesSetToNull, 'fulfillment_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('fulfillment_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['fulfillment_id'] = $fulfillment_id; return $this; @@ -744,6 +936,9 @@ public function getFulfillments() */ public function setFulfillments($fulfillments) { + if (is_null($fulfillments)) { + throw new \InvalidArgumentException('non-nullable fulfillments cannot be null'); + } $this->container['fulfillments'] = $fulfillments; return $this; @@ -768,6 +963,16 @@ public function getPaymentsCount() */ public function setPaymentsCount($payments_count) { + if (is_null($payments_count)) { + array_push($this->openAPINullablesSetToNull, 'payments_count'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payments_count', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['payments_count'] = $payments_count; return $this; @@ -792,6 +997,16 @@ public function getInfusionsoftCcid() */ public function setInfusionsoftCcid($infusionsoft_ccid) { + if (is_null($infusionsoft_ccid)) { + array_push($this->openAPINullablesSetToNull, 'infusionsoft_ccid'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('infusionsoft_ccid', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['infusionsoft_ccid'] = $infusionsoft_ccid; return $this; @@ -816,6 +1031,16 @@ public function getOapCustomerId() */ public function setOapCustomerId($oap_customer_id) { + if (is_null($oap_customer_id)) { + array_push($this->openAPINullablesSetToNull, 'oap_customer_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('oap_customer_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['oap_customer_id'] = $oap_customer_id; return $this; @@ -840,6 +1065,16 @@ public function getPaymentInstrumentType() */ public function setPaymentInstrumentType($payment_instrument_type) { + if (is_null($payment_instrument_type)) { + array_push($this->openAPINullablesSetToNull, 'payment_instrument_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payment_instrument_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['payment_instrument_type'] = $payment_instrument_type; return $this; @@ -848,7 +1083,7 @@ public function setPaymentInstrumentType($payment_instrument_type) /** * Gets original_amount_cents * - * @return double + * @return float */ public function getOriginalAmountCents() { @@ -858,12 +1093,15 @@ public function getOriginalAmountCents() /** * Sets original_amount_cents * - * @param double $original_amount_cents original_amount_cents + * @param float $original_amount_cents original_amount_cents * * @return self */ public function setOriginalAmountCents($original_amount_cents) { + if (is_null($original_amount_cents)) { + throw new \InvalidArgumentException('non-nullable original_amount_cents cannot be null'); + } $this->container['original_amount_cents'] = $original_amount_cents; return $this; @@ -888,6 +1126,9 @@ public function getOriginalAmount() */ public function setOriginalAmount($original_amount) { + if (is_null($original_amount)) { + throw new \InvalidArgumentException('non-nullable original_amount cannot be null'); + } $this->container['original_amount'] = $original_amount; return $this; @@ -912,6 +1153,9 @@ public function getOriginalAmountCurrency() */ public function setOriginalAmountCurrency($original_amount_currency) { + if (is_null($original_amount_currency)) { + throw new \InvalidArgumentException('non-nullable original_amount_currency cannot be null'); + } $this->container['original_amount_currency'] = $original_amount_currency; return $this; @@ -936,6 +1180,9 @@ public function getManual() */ public function setManual($manual) { + if (is_null($manual)) { + throw new \InvalidArgumentException('non-nullable manual cannot be null'); + } $this->container['manual'] = $manual; return $this; @@ -960,6 +1207,16 @@ public function getErrorMessage() */ public function setErrorMessage($error_message) { + if (is_null($error_message)) { + array_push($this->openAPINullablesSetToNull, 'error_message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('error_message', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['error_message'] = $error_message; return $this; @@ -984,6 +1241,16 @@ public function getNmiCustomerVaultId() */ public function setNmiCustomerVaultId($nmi_customer_vault_id) { + if (is_null($nmi_customer_vault_id)) { + array_push($this->openAPINullablesSetToNull, 'nmi_customer_vault_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('nmi_customer_vault_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['nmi_customer_vault_id'] = $nmi_customer_vault_id; return $this; @@ -995,7 +1262,7 @@ public function setNmiCustomerVaultId($nmi_customer_vault_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1007,6 +1274,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1020,7 +1288,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1036,7 +1304,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1048,6 +1316,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ClickFunnelRegistration.php b/lib/Model/ClickFunnelRegistration.php index 2892a8a..8ccdafc 100644 --- a/lib/Model/ClickFunnelRegistration.php +++ b/lib/Model/ClickFunnelRegistration.php @@ -2,7 +2,7 @@ /** * ClickFunnelRegistration * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ClickFunnelRegistration implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class ClickFunnelRegistration implements ModelInterface, ArrayAccess, \JsonSeria 'event' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'contact' => false, + 'event' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['contact'] = $data['contact'] ?? null; - $this->container['event'] = $data['event'] ?? null; + $this->setIfExists('contact', $data ?? [], null); + $this->setIfExists('event', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -237,6 +322,9 @@ public function getContact() */ public function setContact($contact) { + if (is_null($contact)) { + throw new \InvalidArgumentException('non-nullable contact cannot be null'); + } $this->container['contact'] = $contact; return $this; @@ -261,6 +349,9 @@ public function getEvent() */ public function setEvent($event) { + if (is_null($event)) { + throw new \InvalidArgumentException('non-nullable event cannot be null'); + } $this->container['event'] = $event; return $this; @@ -272,7 +363,7 @@ public function setEvent($event) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -284,6 +375,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -297,7 +389,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -313,7 +405,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -325,6 +417,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/CountClaimedComps200Response.php b/lib/Model/CountClaimedComps200Response.php new file mode 100644 index 0000000..1b30120 --- /dev/null +++ b/lib/Model/CountClaimedComps200Response.php @@ -0,0 +1,450 @@ + + */ +class CountClaimedComps200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'countClaimedComps_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'seats' => 'float', + 'count' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'seats' => 'double', + 'count' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'seats' => false, + 'count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'seats' => 'seats', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'seats' => 'setSeats', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'seats' => 'getSeats', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('seats', $data ?? [], null); + $this->setIfExists('count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['seats'] === null) { + $invalidProperties[] = "'seats' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets seats + * + * @return float + */ + public function getSeats() + { + return $this->container['seats']; + } + + /** + * Sets seats + * + * @param float $seats seats + * + * @return self + */ + public function setSeats($seats) + { + if (is_null($seats)) { + throw new \InvalidArgumentException('non-nullable seats cannot be null'); + } + $this->container['seats'] = $seats; + + return $this; + } + + /** + * Gets count + * + * @return float + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param float $count count + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateFile200Response.php b/lib/Model/CreateFile200Response.php new file mode 100644 index 0000000..289ea77 --- /dev/null +++ b/lib/Model/CreateFile200Response.php @@ -0,0 +1,487 @@ + + */ +class CreateFile200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createFile_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'size' => 'float', + 'name' => 'string', + 'url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'size' => 'double', + 'name' => null, + 'url' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'size' => false, + 'name' => false, + 'url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'size' => 'size', + 'name' => 'name', + 'url' => 'url' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'size' => 'setSize', + 'name' => 'setName', + 'url' => 'setUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'size' => 'getSize', + 'name' => 'getName', + 'url' => 'getUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['size'] === null) { + $invalidProperties[] = "'size' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets size + * + * @return float + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param float $size size + * + * @return self + */ + public function setSize($size) + { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } + $this->container['size'] = $size; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url url + * + * @return self + */ + public function setUrl($url) + { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } + $this->container['url'] = $url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateStaticVoucherCampaign.php b/lib/Model/CreateStaticVoucherCampaign.php index dbf29af..00f733e 100644 --- a/lib/Model/CreateStaticVoucherCampaign.php +++ b/lib/Model/CreateStaticVoucherCampaign.php @@ -2,7 +2,7 @@ /** * CreateStaticVoucherCampaign * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class CreateStaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class CreateStaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonS 'expiration_date_time' => '\DateTime', 'title' => 'string', 'notes' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'display_value' => 'string', 'merchants_reference_id' => 'string', 'valid_only_at_pos_register_ids' => 'string[]', @@ -72,7 +70,7 @@ class CreateStaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonS 'bucket' => 'string', 'file_name' => 'string', 'source_id' => 'int', - 'campaign_group_id' => 'string' + 'campaign_group_id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID' ]; /** @@ -98,6 +96,34 @@ class CreateStaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonS 'campaign_group_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'start_date_time' => false, + 'expiration_date_time' => false, + 'title' => false, + 'notes' => false, + 'value_type' => false, + 'display_value' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'bucket' => false, + 'file_name' => false, + 'source_id' => false, + 'campaign_group_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -118,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -239,19 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['start_date_time'] = $data['start_date_time'] ?? null; - $this->container['expiration_date_time'] = $data['expiration_date_time'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['bucket'] = $data['bucket'] ?? null; - $this->container['file_name'] = $data['file_name'] ?? null; - $this->container['source_id'] = $data['source_id'] ?? null; - $this->container['campaign_group_id'] = $data['campaign_group_id'] ?? null; + $this->setIfExists('start_date_time', $data ?? [], null); + $this->setIfExists('expiration_date_time', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('bucket', $data ?? [], null); + $this->setIfExists('file_name', $data ?? [], null); + $this->setIfExists('source_id', $data ?? [], null); + $this->setIfExists('campaign_group_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -342,6 +438,9 @@ public function getStartDateTime() */ public function setStartDateTime($start_date_time) { + if (is_null($start_date_time)) { + throw new \InvalidArgumentException('non-nullable start_date_time cannot be null'); + } $this->container['start_date_time'] = $start_date_time; return $this; @@ -366,6 +465,9 @@ public function getExpirationDateTime() */ public function setExpirationDateTime($expiration_date_time) { + if (is_null($expiration_date_time)) { + throw new \InvalidArgumentException('non-nullable expiration_date_time cannot be null'); + } $this->container['expiration_date_time'] = $expiration_date_time; return $this; @@ -390,6 +492,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling CreateStaticVoucherCampaign., must be bigger than or equal to 1.'); @@ -419,6 +524,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -427,7 +535,7 @@ public function setNotes($notes) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -437,12 +545,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -467,6 +578,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } $this->container['display_value'] = $display_value; return $this; @@ -491,6 +605,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -515,6 +632,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -539,14 +659,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling CreateStaticVoucherCampaign., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling CreateStaticVoucherCampaign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling CreateStaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling CreateStaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -573,8 +696,11 @@ public function getBucket() */ public function setBucket($bucket) { + if (is_null($bucket)) { + throw new \InvalidArgumentException('non-nullable bucket cannot be null'); + } - if (!is_null($bucket) && (mb_strlen($bucket) < 1)) { + if ((mb_strlen($bucket) < 1)) { throw new \InvalidArgumentException('invalid length for $bucket when calling CreateStaticVoucherCampaign., must be bigger than or equal to 1.'); } @@ -602,8 +728,11 @@ public function getFileName() */ public function setFileName($file_name) { + if (is_null($file_name)) { + throw new \InvalidArgumentException('non-nullable file_name cannot be null'); + } - if (!is_null($file_name) && (mb_strlen($file_name) < 1)) { + if ((mb_strlen($file_name) < 1)) { throw new \InvalidArgumentException('invalid length for $file_name when calling CreateStaticVoucherCampaign., must be bigger than or equal to 1.'); } @@ -631,6 +760,9 @@ public function getSourceId() */ public function setSourceId($source_id) { + if (is_null($source_id)) { + throw new \InvalidArgumentException('non-nullable source_id cannot be null'); + } $this->container['source_id'] = $source_id; return $this; @@ -639,7 +771,7 @@ public function setSourceId($source_id) /** * Gets campaign_group_id * - * @return string|null + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID|null */ public function getCampaignGroupId() { @@ -649,12 +781,15 @@ public function getCampaignGroupId() /** * Sets campaign_group_id * - * @param string|null $campaign_group_id campaign_group_id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID|null $campaign_group_id campaign_group_id * * @return self */ public function setCampaignGroupId($campaign_group_id) { + if (is_null($campaign_group_id)) { + throw new \InvalidArgumentException('non-nullable campaign_group_id cannot be null'); + } $this->container['campaign_group_id'] = $campaign_group_id; return $this; @@ -666,7 +801,7 @@ public function setCampaignGroupId($campaign_group_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -678,6 +813,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -691,7 +827,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -707,7 +843,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -719,6 +855,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/CreateStaticVoucherCampaignWithVoucherWithCSV.php b/lib/Model/CreateStaticVoucherCampaignWithVoucherWithCSV.php index c414f65..00f7846 100644 --- a/lib/Model/CreateStaticVoucherCampaignWithVoucherWithCSV.php +++ b/lib/Model/CreateStaticVoucherCampaignWithVoucherWithCSV.php @@ -2,7 +2,7 @@ /** * CreateStaticVoucherCampaignWithVoucherWithCSV * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class CreateStaticVoucherCampaignWithVoucherWithCSV implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class CreateStaticVoucherCampaignWithVoucherWithCSV implements ModelInterface, A 'expiration_date_time' => '\DateTime', 'title' => 'string', 'notes' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'display_value' => 'string', 'merchants_reference_id' => 'string', 'valid_only_at_pos_register_ids' => 'string[]', @@ -72,7 +70,7 @@ class CreateStaticVoucherCampaignWithVoucherWithCSV implements ModelInterface, A 'bucket' => 'string', 'file_name' => 'string', 'source_id' => 'int', - 'campaign_group_id' => 'string' + 'campaign_group_id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID' ]; /** @@ -98,6 +96,34 @@ class CreateStaticVoucherCampaignWithVoucherWithCSV implements ModelInterface, A 'campaign_group_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'start_date_time' => false, + 'expiration_date_time' => false, + 'title' => false, + 'notes' => false, + 'value_type' => false, + 'display_value' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'bucket' => false, + 'file_name' => false, + 'source_id' => false, + 'campaign_group_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -118,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -239,19 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['start_date_time'] = $data['start_date_time'] ?? null; - $this->container['expiration_date_time'] = $data['expiration_date_time'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['bucket'] = $data['bucket'] ?? null; - $this->container['file_name'] = $data['file_name'] ?? null; - $this->container['source_id'] = $data['source_id'] ?? null; - $this->container['campaign_group_id'] = $data['campaign_group_id'] ?? null; + $this->setIfExists('start_date_time', $data ?? [], null); + $this->setIfExists('expiration_date_time', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('bucket', $data ?? [], null); + $this->setIfExists('file_name', $data ?? [], null); + $this->setIfExists('source_id', $data ?? [], null); + $this->setIfExists('campaign_group_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -348,6 +444,9 @@ public function getStartDateTime() */ public function setStartDateTime($start_date_time) { + if (is_null($start_date_time)) { + throw new \InvalidArgumentException('non-nullable start_date_time cannot be null'); + } $this->container['start_date_time'] = $start_date_time; return $this; @@ -372,6 +471,9 @@ public function getExpirationDateTime() */ public function setExpirationDateTime($expiration_date_time) { + if (is_null($expiration_date_time)) { + throw new \InvalidArgumentException('non-nullable expiration_date_time cannot be null'); + } $this->container['expiration_date_time'] = $expiration_date_time; return $this; @@ -396,6 +498,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling CreateStaticVoucherCampaignWithVoucherWithCSV., must be bigger than or equal to 1.'); @@ -425,6 +530,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -433,7 +541,7 @@ public function setNotes($notes) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -443,12 +551,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -473,6 +584,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } $this->container['display_value'] = $display_value; return $this; @@ -497,6 +611,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -521,6 +638,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -545,14 +665,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling CreateStaticVoucherCampaignWithVoucherWithCSV., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling CreateStaticVoucherCampaignWithVoucherWithCSV., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling CreateStaticVoucherCampaignWithVoucherWithCSV., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling CreateStaticVoucherCampaignWithVoucherWithCSV., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -579,6 +702,9 @@ public function getBucket() */ public function setBucket($bucket) { + if (is_null($bucket)) { + throw new \InvalidArgumentException('non-nullable bucket cannot be null'); + } if ((mb_strlen($bucket) < 1)) { throw new \InvalidArgumentException('invalid length for $bucket when calling CreateStaticVoucherCampaignWithVoucherWithCSV., must be bigger than or equal to 1.'); @@ -608,6 +734,9 @@ public function getFileName() */ public function setFileName($file_name) { + if (is_null($file_name)) { + throw new \InvalidArgumentException('non-nullable file_name cannot be null'); + } if ((mb_strlen($file_name) < 1)) { throw new \InvalidArgumentException('invalid length for $file_name when calling CreateStaticVoucherCampaignWithVoucherWithCSV., must be bigger than or equal to 1.'); @@ -637,6 +766,9 @@ public function getSourceId() */ public function setSourceId($source_id) { + if (is_null($source_id)) { + throw new \InvalidArgumentException('non-nullable source_id cannot be null'); + } $this->container['source_id'] = $source_id; return $this; @@ -645,7 +777,7 @@ public function setSourceId($source_id) /** * Gets campaign_group_id * - * @return string|null + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID|null */ public function getCampaignGroupId() { @@ -655,12 +787,15 @@ public function getCampaignGroupId() /** * Sets campaign_group_id * - * @param string|null $campaign_group_id campaign_group_id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID|null $campaign_group_id campaign_group_id * * @return self */ public function setCampaignGroupId($campaign_group_id) { + if (is_null($campaign_group_id)) { + throw new \InvalidArgumentException('non-nullable campaign_group_id cannot be null'); + } $this->container['campaign_group_id'] = $campaign_group_id; return $this; @@ -672,7 +807,7 @@ public function setCampaignGroupId($campaign_group_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -684,6 +819,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -697,7 +833,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -713,7 +849,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -725,6 +861,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/DashboardWidget.php b/lib/Model/DashboardWidget.php index 3859838..4c64dfc 100644 --- a/lib/Model/DashboardWidget.php +++ b/lib/Model/DashboardWidget.php @@ -2,7 +2,7 @@ /** * DashboardWidget * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class DashboardWidget implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -70,11 +68,11 @@ class DashboardWidget implements ModelInterface, ArrayAccess, \JsonSerializable 'icon' => 'string', 'route' => 'string', 'type' => 'string', - 'order_number' => 'double', + 'order_number' => 'float', 'is_default' => 'bool', 'category' => 'string', 'category_icon' => 'string', - 'category_order_number' => 'double', + 'category_order_number' => 'float', 'page_name' => 'string' ]; @@ -104,6 +102,37 @@ class DashboardWidget implements ModelInterface, ArrayAccess, \JsonSerializable 'page_name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'div_id' => false, + 'title' => false, + 'subtitle' => false, + 'css_class' => false, + 'icon' => false, + 'route' => false, + 'type' => false, + 'order_number' => false, + 'is_default' => false, + 'category' => false, + 'category_icon' => false, + 'category_order_number' => false, + 'page_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -124,6 +153,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -254,22 +335,40 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['div_id'] = $data['div_id'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['subtitle'] = $data['subtitle'] ?? null; - $this->container['css_class'] = $data['css_class'] ?? null; - $this->container['icon'] = $data['icon'] ?? null; - $this->container['route'] = $data['route'] ?? null; - $this->container['type'] = $data['type'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['is_default'] = $data['is_default'] ?? null; - $this->container['category'] = $data['category'] ?? null; - $this->container['category_icon'] = $data['category_icon'] ?? null; - $this->container['category_order_number'] = $data['category_order_number'] ?? null; - $this->container['page_name'] = $data['page_name'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('div_id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('subtitle', $data ?? [], null); + $this->setIfExists('css_class', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('route', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('is_default', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('category_icon', $data ?? [], null); + $this->setIfExists('category_order_number', $data ?? [], null); + $this->setIfExists('page_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -375,14 +474,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling DashboardWidget., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling DashboardWidget., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling DashboardWidget., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling DashboardWidget., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -409,6 +511,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -433,6 +538,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -457,6 +565,9 @@ public function getDivId() */ public function setDivId($div_id) { + if (is_null($div_id)) { + throw new \InvalidArgumentException('non-nullable div_id cannot be null'); + } $this->container['div_id'] = $div_id; return $this; @@ -481,6 +592,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } $this->container['title'] = $title; return $this; @@ -505,6 +619,9 @@ public function getSubtitle() */ public function setSubtitle($subtitle) { + if (is_null($subtitle)) { + throw new \InvalidArgumentException('non-nullable subtitle cannot be null'); + } $this->container['subtitle'] = $subtitle; return $this; @@ -529,6 +646,9 @@ public function getCssClass() */ public function setCssClass($css_class) { + if (is_null($css_class)) { + throw new \InvalidArgumentException('non-nullable css_class cannot be null'); + } $this->container['css_class'] = $css_class; return $this; @@ -553,6 +673,9 @@ public function getIcon() */ public function setIcon($icon) { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } $this->container['icon'] = $icon; return $this; @@ -577,6 +700,9 @@ public function getRoute() */ public function setRoute($route) { + if (is_null($route)) { + throw new \InvalidArgumentException('non-nullable route cannot be null'); + } $this->container['route'] = $route; return $this; @@ -601,6 +727,9 @@ public function getType() */ public function setType($type) { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -609,7 +738,7 @@ public function setType($type) /** * Gets order_number * - * @return double + * @return float */ public function getOrderNumber() { @@ -619,12 +748,15 @@ public function getOrderNumber() /** * Sets order_number * - * @param double $order_number order_number + * @param float $order_number order_number * * @return self */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } $this->container['order_number'] = $order_number; return $this; @@ -649,6 +781,9 @@ public function getIsDefault() */ public function setIsDefault($is_default) { + if (is_null($is_default)) { + throw new \InvalidArgumentException('non-nullable is_default cannot be null'); + } $this->container['is_default'] = $is_default; return $this; @@ -673,6 +808,9 @@ public function getCategory() */ public function setCategory($category) { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } $this->container['category'] = $category; return $this; @@ -697,6 +835,9 @@ public function getCategoryIcon() */ public function setCategoryIcon($category_icon) { + if (is_null($category_icon)) { + throw new \InvalidArgumentException('non-nullable category_icon cannot be null'); + } $this->container['category_icon'] = $category_icon; return $this; @@ -705,7 +846,7 @@ public function setCategoryIcon($category_icon) /** * Gets category_order_number * - * @return double + * @return float */ public function getCategoryOrderNumber() { @@ -715,12 +856,15 @@ public function getCategoryOrderNumber() /** * Sets category_order_number * - * @param double $category_order_number category_order_number + * @param float $category_order_number category_order_number * * @return self */ public function setCategoryOrderNumber($category_order_number) { + if (is_null($category_order_number)) { + throw new \InvalidArgumentException('non-nullable category_order_number cannot be null'); + } $this->container['category_order_number'] = $category_order_number; return $this; @@ -745,6 +889,9 @@ public function getPageName() */ public function setPageName($page_name) { + if (is_null($page_name)) { + throw new \InvalidArgumentException('non-nullable page_name cannot be null'); + } $this->container['page_name'] = $page_name; return $this; @@ -756,7 +903,7 @@ public function setPageName($page_name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -768,6 +915,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -781,7 +929,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -797,7 +945,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -809,6 +957,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Dining.php b/lib/Model/Dining.php index e3bcf0b..0294a5c 100644 --- a/lib/Model/Dining.php +++ b/lib/Model/Dining.php @@ -2,7 +2,7 @@ /** * Dining * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Dining implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -66,7 +64,7 @@ class Dining implements ModelInterface, ArrayAccess, \JsonSerializable 'order_number' => 'int', 'media_url' => 'string', 'additional_info_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -94,6 +92,32 @@ class Dining implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -229,17 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -333,6 +427,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling Dining., must be bigger than or equal to 1.'); @@ -362,6 +459,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling Dining., must be bigger than or equal to 1.'); @@ -391,6 +491,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -415,6 +518,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling Dining., must be bigger than or equal to 1.'); @@ -444,6 +550,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -468,6 +577,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -476,7 +588,7 @@ public function setAdditionalInfoUrl($additional_info_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -486,12 +598,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -516,6 +631,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -540,6 +658,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -564,6 +685,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -588,14 +712,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Dining., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Dining., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Dining., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Dining., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -609,7 +736,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -621,6 +748,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -634,7 +762,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -650,7 +778,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -662,6 +790,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Document.php b/lib/Model/Document.php index 15ca6b0..60c9657 100644 --- a/lib/Model/Document.php +++ b/lib/Model/Document.php @@ -2,7 +2,7 @@ /** * Document * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Document implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -67,7 +65,7 @@ class Document implements ModelInterface, ArrayAccess, \JsonSerializable 'file_url' => 'string', 'file_type' => 'string', 'file_name' => 'string', - 'file_size' => 'double', + 'file_size' => 'float', 'folder' => 'string', 'employee_id' => 'string' ]; @@ -92,6 +90,31 @@ class Document implements ModelInterface, ArrayAccess, \JsonSerializable 'employee_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'merchant_id' => false, + 'file_url' => false, + 'file_type' => false, + 'file_name' => false, + 'file_size' => false, + 'folder' => false, + 'employee_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['file_url'] = $data['file_url'] ?? null; - $this->container['file_type'] = $data['file_type'] ?? null; - $this->container['file_name'] = $data['file_name'] ?? null; - $this->container['file_size'] = $data['file_size'] ?? null; - $this->container['folder'] = $data['folder'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('file_url', $data ?? [], null); + $this->setIfExists('file_type', $data ?? [], null); + $this->setIfExists('file_name', $data ?? [], null); + $this->setIfExists('file_size', $data ?? [], null); + $this->setIfExists('folder', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -345,14 +438,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Document., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Document., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling Document., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling Document., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -379,6 +475,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -403,6 +502,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -427,14 +529,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Document., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Document., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Document., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Document., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -461,6 +566,9 @@ public function getFileUrl() */ public function setFileUrl($file_url) { + if (is_null($file_url)) { + throw new \InvalidArgumentException('non-nullable file_url cannot be null'); + } $this->container['file_url'] = $file_url; return $this; @@ -485,6 +593,9 @@ public function getFileType() */ public function setFileType($file_type) { + if (is_null($file_type)) { + throw new \InvalidArgumentException('non-nullable file_type cannot be null'); + } $this->container['file_type'] = $file_type; return $this; @@ -509,6 +620,9 @@ public function getFileName() */ public function setFileName($file_name) { + if (is_null($file_name)) { + throw new \InvalidArgumentException('non-nullable file_name cannot be null'); + } $this->container['file_name'] = $file_name; return $this; @@ -517,7 +631,7 @@ public function setFileName($file_name) /** * Gets file_size * - * @return double + * @return float */ public function getFileSize() { @@ -527,12 +641,15 @@ public function getFileSize() /** * Sets file_size * - * @param double $file_size The size of the file + * @param float $file_size The size of the file * * @return self */ public function setFileSize($file_size) { + if (is_null($file_size)) { + throw new \InvalidArgumentException('non-nullable file_size cannot be null'); + } $this->container['file_size'] = $file_size; return $this; @@ -557,6 +674,9 @@ public function getFolder() */ public function setFolder($folder) { + if (is_null($folder)) { + throw new \InvalidArgumentException('non-nullable folder cannot be null'); + } $this->container['folder'] = $folder; return $this; @@ -581,14 +701,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling Document., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling Document., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling Document., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling Document., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -602,7 +725,7 @@ public function setEmployeeId($employee_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -614,6 +737,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -627,7 +751,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -643,7 +767,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -655,6 +779,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/DuplicateRowFound.php b/lib/Model/DuplicateRowFound.php index 46f9a00..f7da1a1 100644 --- a/lib/Model/DuplicateRowFound.php +++ b/lib/Model/DuplicateRowFound.php @@ -2,7 +2,7 @@ /** * DuplicateRowFound * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class DuplicateRowFound implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class DuplicateRowFound implements ModelInterface, ArrayAccess, \JsonSerializabl 'name' => 'string', 'message' => 'string', 'stack' => 'string', - 'http_error_code' => 'double', + 'http_error_code' => 'float', 'tracking_code' => 'string' ]; @@ -82,6 +80,26 @@ class DuplicateRowFound implements ModelInterface, ArrayAccess, \JsonSerializabl 'tracking_code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'stack' => false, + 'http_error_code' => false, + 'tracking_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['stack'] = $data['stack'] ?? null; - $this->container['http_error_code'] = $data['http_error_code'] ?? null; - $this->container['tracking_code'] = $data['tracking_code'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('stack', $data ?? [], null); + $this->setIfExists('http_error_code', $data ?? [], null); + $this->setIfExists('tracking_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -261,6 +349,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -285,6 +376,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -309,6 +403,9 @@ public function getStack() */ public function setStack($stack) { + if (is_null($stack)) { + throw new \InvalidArgumentException('non-nullable stack cannot be null'); + } $this->container['stack'] = $stack; return $this; @@ -317,7 +414,7 @@ public function setStack($stack) /** * Gets http_error_code * - * @return double + * @return float */ public function getHttpErrorCode() { @@ -327,12 +424,15 @@ public function getHttpErrorCode() /** * Sets http_error_code * - * @param double $http_error_code http_error_code + * @param float $http_error_code http_error_code * * @return self */ public function setHttpErrorCode($http_error_code) { + if (is_null($http_error_code)) { + throw new \InvalidArgumentException('non-nullable http_error_code cannot be null'); + } $this->container['http_error_code'] = $http_error_code; return $this; @@ -357,6 +457,9 @@ public function getTrackingCode() */ public function setTrackingCode($tracking_code) { + if (is_null($tracking_code)) { + throw new \InvalidArgumentException('non-nullable tracking_code cannot be null'); + } $this->container['tracking_code'] = $tracking_code; return $this; @@ -368,7 +471,7 @@ public function setTrackingCode($tracking_code) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -380,6 +483,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -393,7 +497,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -409,7 +513,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -421,6 +525,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/DynamicVoucher.php b/lib/Model/DynamicVoucher.php index 99be13a..8a6fd2b 100644 --- a/lib/Model/DynamicVoucher.php +++ b/lib/Model/DynamicVoucher.php @@ -2,7 +2,7 @@ /** * DynamicVoucher * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class DynamicVoucher implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class DynamicVoucher implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'start_date' => '\DateTime', 'expiration_date' => '\DateTime', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'title' => 'string', 'notes' => 'string', 'merchants_reference_id' => 'string', @@ -87,11 +85,11 @@ class DynamicVoucher implements ModelInterface, ArrayAccess, \JsonSerializable 'starting_value_string' => 'string', 'max_budget_decimal' => 'string', 'max_budget_string' => 'string', - 'current_value' => 'double', + 'current_value' => 'float', 'current_value_decimal' => 'string', 'current_value_string' => 'string', - 'status' => 'string', - 'temporal_decrease_frequency_type' => 'string', + 'status' => '\OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus', + 'temporal_decrease_frequency_type' => '\OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType', 'summary' => '\OpenAPI\Client\Model\WTDynamicVoucherSummary' ]; @@ -138,6 +136,54 @@ class DynamicVoucher implements ModelInterface, ArrayAccess, \JsonSerializable 'summary' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'start_date' => false, + 'expiration_date' => false, + 'id' => false, + 'title' => false, + 'notes' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'employee_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'starting_value' => false, + 'max_budget' => false, + 'temporal_decrease_amount' => false, + 'temporal_decrease_frequency' => false, + 'numerical_decrease_amount' => false, + 'numerical_decrease_frequency' => false, + 'temporal_decrease_amount_decimal' => false, + 'temporal_decrease_amount_string' => false, + 'numerical_decrease_amount_decimal' => false, + 'numerical_decrease_amount_string' => false, + 'starting_value_decimal' => false, + 'starting_value_string' => false, + 'max_budget_decimal' => false, + 'max_budget_string' => false, + 'current_value' => false, + 'current_value_decimal' => false, + 'current_value_string' => false, + 'status' => false, + 'temporal_decrease_frequency_type' => false, + 'summary' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -158,6 +204,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -339,39 +437,57 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['start_date'] = $data['start_date'] ?? null; - $this->container['expiration_date'] = $data['expiration_date'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['starting_value'] = $data['starting_value'] ?? null; - $this->container['max_budget'] = $data['max_budget'] ?? null; - $this->container['temporal_decrease_amount'] = $data['temporal_decrease_amount'] ?? null; - $this->container['temporal_decrease_frequency'] = $data['temporal_decrease_frequency'] ?? null; - $this->container['numerical_decrease_amount'] = $data['numerical_decrease_amount'] ?? null; - $this->container['numerical_decrease_frequency'] = $data['numerical_decrease_frequency'] ?? null; - $this->container['temporal_decrease_amount_decimal'] = $data['temporal_decrease_amount_decimal'] ?? null; - $this->container['temporal_decrease_amount_string'] = $data['temporal_decrease_amount_string'] ?? null; - $this->container['numerical_decrease_amount_decimal'] = $data['numerical_decrease_amount_decimal'] ?? null; - $this->container['numerical_decrease_amount_string'] = $data['numerical_decrease_amount_string'] ?? null; - $this->container['starting_value_decimal'] = $data['starting_value_decimal'] ?? null; - $this->container['starting_value_string'] = $data['starting_value_string'] ?? null; - $this->container['max_budget_decimal'] = $data['max_budget_decimal'] ?? null; - $this->container['max_budget_string'] = $data['max_budget_string'] ?? null; - $this->container['current_value'] = $data['current_value'] ?? null; - $this->container['current_value_decimal'] = $data['current_value_decimal'] ?? null; - $this->container['current_value_string'] = $data['current_value_string'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['temporal_decrease_frequency_type'] = $data['temporal_decrease_frequency_type'] ?? null; - $this->container['summary'] = $data['summary'] ?? null; + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('starting_value', $data ?? [], null); + $this->setIfExists('max_budget', $data ?? [], null); + $this->setIfExists('temporal_decrease_amount', $data ?? [], null); + $this->setIfExists('temporal_decrease_frequency', $data ?? [], null); + $this->setIfExists('numerical_decrease_amount', $data ?? [], null); + $this->setIfExists('numerical_decrease_frequency', $data ?? [], null); + $this->setIfExists('temporal_decrease_amount_decimal', $data ?? [], null); + $this->setIfExists('temporal_decrease_amount_string', $data ?? [], null); + $this->setIfExists('numerical_decrease_amount_decimal', $data ?? [], null); + $this->setIfExists('numerical_decrease_amount_string', $data ?? [], null); + $this->setIfExists('starting_value_decimal', $data ?? [], null); + $this->setIfExists('starting_value_string', $data ?? [], null); + $this->setIfExists('max_budget_decimal', $data ?? [], null); + $this->setIfExists('max_budget_string', $data ?? [], null); + $this->setIfExists('current_value', $data ?? [], null); + $this->setIfExists('current_value_decimal', $data ?? [], null); + $this->setIfExists('current_value_string', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('temporal_decrease_frequency_type', $data ?? [], null); + $this->setIfExists('summary', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -392,14 +508,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['title'] === null) { $invalidProperties[] = "'title' can't be null"; } @@ -576,6 +684,9 @@ public function getStartDate() */ public function setStartDate($start_date) { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } $this->container['start_date'] = $start_date; return $this; @@ -600,6 +711,9 @@ public function getExpirationDate() */ public function setExpirationDate($expiration_date) { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } $this->container['expiration_date'] = $expiration_date; return $this; @@ -608,7 +722,7 @@ public function setExpirationDate($expiration_date) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -618,19 +732,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling DynamicVoucher., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling DynamicVoucher., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -655,6 +765,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling DynamicVoucher., must be bigger than or equal to 1.'); @@ -684,6 +797,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -708,6 +824,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -732,6 +851,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -756,14 +878,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling DynamicVoucher., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling DynamicVoucher., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling DynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling DynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -790,14 +915,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling DynamicVoucher., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling DynamicVoucher., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling DynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling DynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -824,14 +952,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling DynamicVoucher., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling DynamicVoucher., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling DynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling DynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -858,6 +989,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -882,6 +1016,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -906,6 +1043,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -930,6 +1070,9 @@ public function getStartingValue() */ public function setStartingValue($starting_value) { + if (is_null($starting_value)) { + throw new \InvalidArgumentException('non-nullable starting_value cannot be null'); + } if (($starting_value < 0)) { throw new \InvalidArgumentException('invalid value for $starting_value when calling DynamicVoucher., must be bigger than or equal to 0.'); @@ -959,6 +1102,9 @@ public function getMaxBudget() */ public function setMaxBudget($max_budget) { + if (is_null($max_budget)) { + throw new \InvalidArgumentException('non-nullable max_budget cannot be null'); + } if (($max_budget < 0)) { throw new \InvalidArgumentException('invalid value for $max_budget when calling DynamicVoucher., must be bigger than or equal to 0.'); @@ -988,6 +1134,9 @@ public function getTemporalDecreaseAmount() */ public function setTemporalDecreaseAmount($temporal_decrease_amount) { + if (is_null($temporal_decrease_amount)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_amount cannot be null'); + } if (($temporal_decrease_amount < 0)) { throw new \InvalidArgumentException('invalid value for $temporal_decrease_amount when calling DynamicVoucher., must be bigger than or equal to 0.'); @@ -1017,6 +1166,9 @@ public function getTemporalDecreaseFrequency() */ public function setTemporalDecreaseFrequency($temporal_decrease_frequency) { + if (is_null($temporal_decrease_frequency)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_frequency cannot be null'); + } if (($temporal_decrease_frequency < 0)) { throw new \InvalidArgumentException('invalid value for $temporal_decrease_frequency when calling DynamicVoucher., must be bigger than or equal to 0.'); @@ -1046,8 +1198,11 @@ public function getNumericalDecreaseAmount() */ public function setNumericalDecreaseAmount($numerical_decrease_amount) { + if (is_null($numerical_decrease_amount)) { + throw new \InvalidArgumentException('non-nullable numerical_decrease_amount cannot be null'); + } - if (!is_null($numerical_decrease_amount) && ($numerical_decrease_amount < 0)) { + if (($numerical_decrease_amount < 0)) { throw new \InvalidArgumentException('invalid value for $numerical_decrease_amount when calling DynamicVoucher., must be bigger than or equal to 0.'); } @@ -1075,8 +1230,11 @@ public function getNumericalDecreaseFrequency() */ public function setNumericalDecreaseFrequency($numerical_decrease_frequency) { + if (is_null($numerical_decrease_frequency)) { + throw new \InvalidArgumentException('non-nullable numerical_decrease_frequency cannot be null'); + } - if (!is_null($numerical_decrease_frequency) && ($numerical_decrease_frequency < 0)) { + if (($numerical_decrease_frequency < 0)) { throw new \InvalidArgumentException('invalid value for $numerical_decrease_frequency when calling DynamicVoucher., must be bigger than or equal to 0.'); } @@ -1104,6 +1262,9 @@ public function getTemporalDecreaseAmountDecimal() */ public function setTemporalDecreaseAmountDecimal($temporal_decrease_amount_decimal) { + if (is_null($temporal_decrease_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_amount_decimal cannot be null'); + } $this->container['temporal_decrease_amount_decimal'] = $temporal_decrease_amount_decimal; return $this; @@ -1128,6 +1289,9 @@ public function getTemporalDecreaseAmountString() */ public function setTemporalDecreaseAmountString($temporal_decrease_amount_string) { + if (is_null($temporal_decrease_amount_string)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_amount_string cannot be null'); + } $this->container['temporal_decrease_amount_string'] = $temporal_decrease_amount_string; return $this; @@ -1152,6 +1316,9 @@ public function getNumericalDecreaseAmountDecimal() */ public function setNumericalDecreaseAmountDecimal($numerical_decrease_amount_decimal) { + if (is_null($numerical_decrease_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable numerical_decrease_amount_decimal cannot be null'); + } $this->container['numerical_decrease_amount_decimal'] = $numerical_decrease_amount_decimal; return $this; @@ -1176,6 +1343,9 @@ public function getNumericalDecreaseAmountString() */ public function setNumericalDecreaseAmountString($numerical_decrease_amount_string) { + if (is_null($numerical_decrease_amount_string)) { + throw new \InvalidArgumentException('non-nullable numerical_decrease_amount_string cannot be null'); + } $this->container['numerical_decrease_amount_string'] = $numerical_decrease_amount_string; return $this; @@ -1200,6 +1370,9 @@ public function getStartingValueDecimal() */ public function setStartingValueDecimal($starting_value_decimal) { + if (is_null($starting_value_decimal)) { + throw new \InvalidArgumentException('non-nullable starting_value_decimal cannot be null'); + } $this->container['starting_value_decimal'] = $starting_value_decimal; return $this; @@ -1224,6 +1397,9 @@ public function getStartingValueString() */ public function setStartingValueString($starting_value_string) { + if (is_null($starting_value_string)) { + throw new \InvalidArgumentException('non-nullable starting_value_string cannot be null'); + } $this->container['starting_value_string'] = $starting_value_string; return $this; @@ -1248,6 +1424,9 @@ public function getMaxBudgetDecimal() */ public function setMaxBudgetDecimal($max_budget_decimal) { + if (is_null($max_budget_decimal)) { + throw new \InvalidArgumentException('non-nullable max_budget_decimal cannot be null'); + } $this->container['max_budget_decimal'] = $max_budget_decimal; return $this; @@ -1272,6 +1451,9 @@ public function getMaxBudgetString() */ public function setMaxBudgetString($max_budget_string) { + if (is_null($max_budget_string)) { + throw new \InvalidArgumentException('non-nullable max_budget_string cannot be null'); + } $this->container['max_budget_string'] = $max_budget_string; return $this; @@ -1280,7 +1462,7 @@ public function setMaxBudgetString($max_budget_string) /** * Gets current_value * - * @return double + * @return float */ public function getCurrentValue() { @@ -1290,12 +1472,15 @@ public function getCurrentValue() /** * Sets current_value * - * @param double $current_value current_value + * @param float $current_value current_value * * @return self */ public function setCurrentValue($current_value) { + if (is_null($current_value)) { + throw new \InvalidArgumentException('non-nullable current_value cannot be null'); + } $this->container['current_value'] = $current_value; return $this; @@ -1320,6 +1505,9 @@ public function getCurrentValueDecimal() */ public function setCurrentValueDecimal($current_value_decimal) { + if (is_null($current_value_decimal)) { + throw new \InvalidArgumentException('non-nullable current_value_decimal cannot be null'); + } $this->container['current_value_decimal'] = $current_value_decimal; return $this; @@ -1344,6 +1532,9 @@ public function getCurrentValueString() */ public function setCurrentValueString($current_value_string) { + if (is_null($current_value_string)) { + throw new \InvalidArgumentException('non-nullable current_value_string cannot be null'); + } $this->container['current_value_string'] = $current_value_string; return $this; @@ -1352,7 +1543,7 @@ public function setCurrentValueString($current_value_string) /** * Gets status * - * @return string + * @return \OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus */ public function getStatus() { @@ -1362,12 +1553,15 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param \OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus $status status * * @return self */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -1376,7 +1570,7 @@ public function setStatus($status) /** * Gets temporal_decrease_frequency_type * - * @return string + * @return \OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType */ public function getTemporalDecreaseFrequencyType() { @@ -1386,12 +1580,15 @@ public function getTemporalDecreaseFrequencyType() /** * Sets temporal_decrease_frequency_type * - * @param string $temporal_decrease_frequency_type temporal_decrease_frequency_type + * @param \OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType $temporal_decrease_frequency_type temporal_decrease_frequency_type * * @return self */ public function setTemporalDecreaseFrequencyType($temporal_decrease_frequency_type) { + if (is_null($temporal_decrease_frequency_type)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_frequency_type cannot be null'); + } $this->container['temporal_decrease_frequency_type'] = $temporal_decrease_frequency_type; return $this; @@ -1416,6 +1613,9 @@ public function getSummary() */ public function setSummary($summary) { + if (is_null($summary)) { + throw new \InvalidArgumentException('non-nullable summary cannot be null'); + } $this->container['summary'] = $summary; return $this; @@ -1427,7 +1627,7 @@ public function setSummary($summary) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1439,6 +1639,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1452,7 +1653,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1468,7 +1669,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1480,6 +1681,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/DynamicVoucherBroadcast.php b/lib/Model/DynamicVoucherBroadcast.php index fbf9891..76151be 100644 --- a/lib/Model/DynamicVoucherBroadcast.php +++ b/lib/Model/DynamicVoucherBroadcast.php @@ -2,7 +2,7 @@ /** * DynamicVoucherBroadcast * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class DynamicVoucherBroadcast implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,22 +59,22 @@ class DynamicVoucherBroadcast implements ModelInterface, ArrayAccess, \JsonSeria */ protected static $openAPITypes = [ 'phone_number_id' => 'string', - 'payment_object_prefix' => 'string', + 'payment_object_prefix' => '\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix', 'payment_object_id' => 'string', 'message_template' => 'string', 'media_urls' => 'string[]', 'employee_id' => 'string', 'broadcast_scheduled_at' => '\DateTime', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', - 'broadcast_status' => 'string', + 'broadcast_status' => '\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus', 'broadcast_queued_at' => '\DateTime', 'broadcast_started_at' => '\DateTime', 'broadcast_completed_at' => '\DateTime', - 'list_type' => 'string', + 'list_type' => '\OpenAPI\Client\Model\DynamicVoucherBroadcastListType', 'list_id' => 'string', 'opt_in_list' => '\OpenAPI\Client\Model\WTOptInList', 'imported_list' => '\OpenAPI\Client\Model\WTImportedList', @@ -114,6 +112,42 @@ class DynamicVoucherBroadcast implements ModelInterface, ArrayAccess, \JsonSeria 'dynamic_voucher' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_number_id' => false, + 'payment_object_prefix' => false, + 'payment_object_id' => false, + 'message_template' => false, + 'media_urls' => false, + 'employee_id' => false, + 'broadcast_scheduled_at' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'broadcast_status' => false, + 'broadcast_queued_at' => true, + 'broadcast_started_at' => true, + 'broadcast_completed_at' => true, + 'list_type' => false, + 'list_id' => false, + 'opt_in_list' => false, + 'imported_list' => false, + 'dynamic_voucher' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -134,6 +168,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -279,27 +365,45 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['payment_object_prefix'] = $data['payment_object_prefix'] ?? null; - $this->container['payment_object_id'] = $data['payment_object_id'] ?? null; - $this->container['message_template'] = $data['message_template'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['broadcast_scheduled_at'] = $data['broadcast_scheduled_at'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['broadcast_status'] = $data['broadcast_status'] ?? null; - $this->container['broadcast_queued_at'] = $data['broadcast_queued_at'] ?? null; - $this->container['broadcast_started_at'] = $data['broadcast_started_at'] ?? null; - $this->container['broadcast_completed_at'] = $data['broadcast_completed_at'] ?? null; - $this->container['list_type'] = $data['list_type'] ?? null; - $this->container['list_id'] = $data['list_id'] ?? null; - $this->container['opt_in_list'] = $data['opt_in_list'] ?? null; - $this->container['imported_list'] = $data['imported_list'] ?? null; - $this->container['dynamic_voucher'] = $data['dynamic_voucher'] ?? null; + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('payment_object_prefix', $data ?? [], null); + $this->setIfExists('payment_object_id', $data ?? [], null); + $this->setIfExists('message_template', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('broadcast_scheduled_at', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('broadcast_status', $data ?? [], null); + $this->setIfExists('broadcast_queued_at', $data ?? [], null); + $this->setIfExists('broadcast_started_at', $data ?? [], null); + $this->setIfExists('broadcast_completed_at', $data ?? [], null); + $this->setIfExists('list_type', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('opt_in_list', $data ?? [], null); + $this->setIfExists('imported_list', $data ?? [], null); + $this->setIfExists('dynamic_voucher', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -329,14 +433,6 @@ public function listInvalidProperties() if ($this->container['payment_object_prefix'] === null) { $invalidProperties[] = "'payment_object_prefix' can't be null"; } - if ((mb_strlen($this->container['payment_object_prefix']) > 2)) { - $invalidProperties[] = "invalid value for 'payment_object_prefix', the character length must be smaller than or equal to 2."; - } - - if ((mb_strlen($this->container['payment_object_prefix']) < 2)) { - $invalidProperties[] = "invalid value for 'payment_object_prefix', the character length must be bigger than or equal to 2."; - } - if ($this->container['payment_object_id'] === null) { $invalidProperties[] = "'payment_object_id' can't be null"; } @@ -379,14 +475,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -478,14 +566,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling DynamicVoucherBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling DynamicVoucherBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling DynamicVoucherBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling DynamicVoucherBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -496,7 +587,7 @@ public function setPhoneNumberId($phone_number_id) /** * Gets payment_object_prefix * - * @return string + * @return \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix */ public function getPaymentObjectPrefix() { @@ -506,19 +597,15 @@ public function getPaymentObjectPrefix() /** * Sets payment_object_prefix * - * @param string $payment_object_prefix payment_object_prefix + * @param \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix $payment_object_prefix payment_object_prefix * * @return self */ public function setPaymentObjectPrefix($payment_object_prefix) { - if ((mb_strlen($payment_object_prefix) > 2)) { - throw new \InvalidArgumentException('invalid length for $payment_object_prefix when calling DynamicVoucherBroadcast., must be smaller than or equal to 2.'); - } - if ((mb_strlen($payment_object_prefix) < 2)) { - throw new \InvalidArgumentException('invalid length for $payment_object_prefix when calling DynamicVoucherBroadcast., must be bigger than or equal to 2.'); + if (is_null($payment_object_prefix)) { + throw new \InvalidArgumentException('non-nullable payment_object_prefix cannot be null'); } - $this->container['payment_object_prefix'] = $payment_object_prefix; return $this; @@ -543,14 +630,17 @@ public function getPaymentObjectId() */ public function setPaymentObjectId($payment_object_id) { + if (is_null($payment_object_id)) { + throw new \InvalidArgumentException('non-nullable payment_object_id cannot be null'); + } if ((mb_strlen($payment_object_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling DynamicVoucherBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_object_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling DynamicVoucherBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_object_id))) { - throw new \InvalidArgumentException("invalid value for $payment_object_id when calling DynamicVoucherBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_object_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_object_id when calling DynamicVoucherBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_object_id'] = $payment_object_id; @@ -577,6 +667,9 @@ public function getMessageTemplate() */ public function setMessageTemplate($message_template) { + if (is_null($message_template)) { + throw new \InvalidArgumentException('non-nullable message_template cannot be null'); + } $this->container['message_template'] = $message_template; return $this; @@ -601,6 +694,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -625,14 +721,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling DynamicVoucherBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling DynamicVoucherBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling DynamicVoucherBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling DynamicVoucherBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -659,6 +758,9 @@ public function getBroadcastScheduledAt() */ public function setBroadcastScheduledAt($broadcast_scheduled_at) { + if (is_null($broadcast_scheduled_at)) { + throw new \InvalidArgumentException('non-nullable broadcast_scheduled_at cannot be null'); + } $this->container['broadcast_scheduled_at'] = $broadcast_scheduled_at; return $this; @@ -667,7 +769,7 @@ public function setBroadcastScheduledAt($broadcast_scheduled_at) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -677,19 +779,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling DynamicVoucherBroadcast., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling DynamicVoucherBroadcast., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -714,14 +812,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling DynamicVoucherBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling DynamicVoucherBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling DynamicVoucherBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling DynamicVoucherBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -748,6 +849,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -772,6 +876,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -796,6 +903,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -804,7 +914,7 @@ public function setIsActive($is_active) /** * Gets broadcast_status * - * @return string + * @return \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus */ public function getBroadcastStatus() { @@ -814,12 +924,15 @@ public function getBroadcastStatus() /** * Sets broadcast_status * - * @param string $broadcast_status broadcast_status + * @param \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus $broadcast_status broadcast_status * * @return self */ public function setBroadcastStatus($broadcast_status) { + if (is_null($broadcast_status)) { + throw new \InvalidArgumentException('non-nullable broadcast_status cannot be null'); + } $this->container['broadcast_status'] = $broadcast_status; return $this; @@ -844,6 +957,16 @@ public function getBroadcastQueuedAt() */ public function setBroadcastQueuedAt($broadcast_queued_at) { + if (is_null($broadcast_queued_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_queued_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_queued_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_queued_at'] = $broadcast_queued_at; return $this; @@ -868,6 +991,16 @@ public function getBroadcastStartedAt() */ public function setBroadcastStartedAt($broadcast_started_at) { + if (is_null($broadcast_started_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_started_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_started_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_started_at'] = $broadcast_started_at; return $this; @@ -892,6 +1025,16 @@ public function getBroadcastCompletedAt() */ public function setBroadcastCompletedAt($broadcast_completed_at) { + if (is_null($broadcast_completed_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_completed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_completed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_completed_at'] = $broadcast_completed_at; return $this; @@ -900,7 +1043,7 @@ public function setBroadcastCompletedAt($broadcast_completed_at) /** * Gets list_type * - * @return string + * @return \OpenAPI\Client\Model\DynamicVoucherBroadcastListType */ public function getListType() { @@ -910,12 +1053,15 @@ public function getListType() /** * Sets list_type * - * @param string $list_type list_type + * @param \OpenAPI\Client\Model\DynamicVoucherBroadcastListType $list_type list_type * * @return self */ public function setListType($list_type) { + if (is_null($list_type)) { + throw new \InvalidArgumentException('non-nullable list_type cannot be null'); + } $this->container['list_type'] = $list_type; return $this; @@ -940,14 +1086,17 @@ public function getListId() */ public function setListId($list_id) { + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + } if ((mb_strlen($list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling DynamicVoucherBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling DynamicVoucherBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $list_id))) { - throw new \InvalidArgumentException("invalid value for $list_id when calling DynamicVoucherBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($list_id)))) { + throw new \InvalidArgumentException("invalid value for \$list_id when calling DynamicVoucherBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['list_id'] = $list_id; @@ -974,6 +1123,9 @@ public function getOptInList() */ public function setOptInList($opt_in_list) { + if (is_null($opt_in_list)) { + throw new \InvalidArgumentException('non-nullable opt_in_list cannot be null'); + } $this->container['opt_in_list'] = $opt_in_list; return $this; @@ -998,6 +1150,9 @@ public function getImportedList() */ public function setImportedList($imported_list) { + if (is_null($imported_list)) { + throw new \InvalidArgumentException('non-nullable imported_list cannot be null'); + } $this->container['imported_list'] = $imported_list; return $this; @@ -1022,6 +1177,9 @@ public function getDynamicVoucher() */ public function setDynamicVoucher($dynamic_voucher) { + if (is_null($dynamic_voucher)) { + throw new \InvalidArgumentException('non-nullable dynamic_voucher cannot be null'); + } $this->container['dynamic_voucher'] = $dynamic_voucher; return $this; @@ -1033,7 +1191,7 @@ public function setDynamicVoucher($dynamic_voucher) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1045,6 +1203,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1058,7 +1217,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1074,7 +1233,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1086,6 +1245,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/DynamicVoucherBroadcastListType.php b/lib/Model/DynamicVoucherBroadcastListType.php new file mode 100644 index 0000000..c44b1bc --- /dev/null +++ b/lib/Model/DynamicVoucherBroadcastListType.php @@ -0,0 +1,382 @@ + + */ +class DynamicVoucherBroadcastListType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DynamicVoucherBroadcast_listType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DynamicVoucherTemporalDecreaseFrequencyType.php b/lib/Model/DynamicVoucherTemporalDecreaseFrequencyType.php new file mode 100644 index 0000000..0771b13 --- /dev/null +++ b/lib/Model/DynamicVoucherTemporalDecreaseFrequencyType.php @@ -0,0 +1,382 @@ + + */ +class DynamicVoucherTemporalDecreaseFrequencyType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DynamicVoucher_temporalDecreaseFrequencyType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EmailSubscriber.php b/lib/Model/EmailSubscriber.php index a518151..86ebf32 100644 --- a/lib/Model/EmailSubscriber.php +++ b/lib/Model/EmailSubscriber.php @@ -2,7 +2,7 @@ /** * EmailSubscriber * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class EmailSubscriber implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class EmailSubscriber implements ModelInterface, ArrayAccess, \JsonSerializable 'first_name' => 'string', 'last_name' => 'string', 'email_address' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -88,6 +86,29 @@ class EmailSubscriber implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email_address' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -214,14 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -311,6 +402,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling EmailSubscriber., must be bigger than or equal to 1.'); @@ -340,6 +434,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling EmailSubscriber., must be bigger than or equal to 1.'); @@ -369,6 +466,9 @@ public function getEmailAddress() */ public function setEmailAddress($email_address) { + if (is_null($email_address)) { + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -377,7 +477,7 @@ public function setEmailAddress($email_address) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -387,12 +487,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -417,6 +520,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -441,6 +547,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -465,6 +574,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -489,14 +601,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling EmailSubscriber., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling EmailSubscriber., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling EmailSubscriber., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling EmailSubscriber., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -510,7 +625,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -522,6 +637,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -535,7 +651,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -551,7 +667,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -563,6 +679,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Employee.php b/lib/Model/Employee.php index 7be7890..5388f1b 100644 --- a/lib/Model/Employee.php +++ b/lib/Model/Employee.php @@ -2,7 +2,7 @@ /** * Employee * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Employee implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,14 +67,14 @@ class Employee implements ModelInterface, ArrayAccess, \JsonSerializable 'employee_id' => 'string', 'job_title' => 'string', 'department' => 'string', - 'schedule_start_day' => 'string', - 'schedule_start_hour' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_start_minute' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_start_meridiem' => 'string', - 'schedule_end_day' => 'string', - 'schedule_end_hour' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_end_minute' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_end_meridiem' => 'string', + 'schedule_start_day' => '\OpenAPI\Client\Model\EmployeeScheduleStartDay', + 'schedule_start_hour' => '\OpenAPI\Client\Model\EmployeeScheduleStartHour', + 'schedule_start_minute' => '\OpenAPI\Client\Model\EmployeeScheduleStartMinute', + 'schedule_start_meridiem' => '\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem', + 'schedule_end_day' => '\OpenAPI\Client\Model\EmployeeScheduleStartDay', + 'schedule_end_hour' => '\OpenAPI\Client\Model\EmployeeScheduleStartHour', + 'schedule_end_minute' => '\OpenAPI\Client\Model\EmployeeScheduleStartMinute', + 'schedule_end_meridiem' => '\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem', 'id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -85,7 +83,7 @@ class Employee implements ModelInterface, ArrayAccess, \JsonSerializable 'profile_picture_url' => 'string', 'merchant_id' => 'string', 'session_token' => 'string', - 'failed_login_attempts' => 'double', + 'failed_login_attempts' => 'float', 'last_login_date' => '\DateTime', 'cfuvid' => 'string', 'schedule' => 'object', @@ -132,6 +130,51 @@ class Employee implements ModelInterface, ArrayAccess, \JsonSerializable 'is_email_notification_disabled' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email' => false, + 'phone_number' => false, + 'is_public_representative' => false, + 'wallet_sequence_number' => false, + 'employee_id' => false, + 'job_title' => false, + 'department' => false, + 'schedule_start_day' => false, + 'schedule_start_hour' => false, + 'schedule_start_minute' => false, + 'schedule_start_meridiem' => false, + 'schedule_end_day' => false, + 'schedule_end_hour' => false, + 'schedule_end_minute' => false, + 'schedule_end_meridiem' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'username' => false, + 'email_verified' => false, + 'profile_picture_url' => false, + 'merchant_id' => false, + 'session_token' => false, + 'failed_login_attempts' => false, + 'last_login_date' => false, + 'cfuvid' => false, + 'schedule' => false, + 'is_email_notification_disabled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -152,6 +195,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -324,36 +419,54 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['is_public_representative'] = $data['is_public_representative'] ?? null; - $this->container['wallet_sequence_number'] = $data['wallet_sequence_number'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['job_title'] = $data['job_title'] ?? null; - $this->container['department'] = $data['department'] ?? null; - $this->container['schedule_start_day'] = $data['schedule_start_day'] ?? null; - $this->container['schedule_start_hour'] = $data['schedule_start_hour'] ?? null; - $this->container['schedule_start_minute'] = $data['schedule_start_minute'] ?? null; - $this->container['schedule_start_meridiem'] = $data['schedule_start_meridiem'] ?? null; - $this->container['schedule_end_day'] = $data['schedule_end_day'] ?? null; - $this->container['schedule_end_hour'] = $data['schedule_end_hour'] ?? null; - $this->container['schedule_end_minute'] = $data['schedule_end_minute'] ?? null; - $this->container['schedule_end_meridiem'] = $data['schedule_end_meridiem'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['username'] = $data['username'] ?? null; - $this->container['email_verified'] = $data['email_verified'] ?? null; - $this->container['profile_picture_url'] = $data['profile_picture_url'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['session_token'] = $data['session_token'] ?? null; - $this->container['failed_login_attempts'] = $data['failed_login_attempts'] ?? null; - $this->container['last_login_date'] = $data['last_login_date'] ?? null; - $this->container['cfuvid'] = $data['cfuvid'] ?? null; - $this->container['schedule'] = $data['schedule'] ?? null; - $this->container['is_email_notification_disabled'] = $data['is_email_notification_disabled'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('is_public_representative', $data ?? [], null); + $this->setIfExists('wallet_sequence_number', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('job_title', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('schedule_start_day', $data ?? [], null); + $this->setIfExists('schedule_start_hour', $data ?? [], null); + $this->setIfExists('schedule_start_minute', $data ?? [], null); + $this->setIfExists('schedule_start_meridiem', $data ?? [], null); + $this->setIfExists('schedule_end_day', $data ?? [], null); + $this->setIfExists('schedule_end_hour', $data ?? [], null); + $this->setIfExists('schedule_end_minute', $data ?? [], null); + $this->setIfExists('schedule_end_meridiem', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('email_verified', $data ?? [], null); + $this->setIfExists('profile_picture_url', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('session_token', $data ?? [], null); + $this->setIfExists('failed_login_attempts', $data ?? [], null); + $this->setIfExists('last_login_date', $data ?? [], null); + $this->setIfExists('cfuvid', $data ?? [], null); + $this->setIfExists('schedule', $data ?? [], null); + $this->setIfExists('is_email_notification_disabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -498,6 +611,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling Employee., must be bigger than or equal to 1.'); @@ -527,6 +643,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling Employee., must be bigger than or equal to 1.'); @@ -556,6 +675,9 @@ public function getEmail() */ public function setEmail($email) { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } if ((mb_strlen($email) < 1)) { throw new \InvalidArgumentException('invalid length for $email when calling Employee., must be bigger than or equal to 1.'); @@ -585,6 +707,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -609,6 +734,9 @@ public function getIsPublicRepresentative() */ public function setIsPublicRepresentative($is_public_representative) { + if (is_null($is_public_representative)) { + throw new \InvalidArgumentException('non-nullable is_public_representative cannot be null'); + } $this->container['is_public_representative'] = $is_public_representative; return $this; @@ -633,6 +761,9 @@ public function getWalletSequenceNumber() */ public function setWalletSequenceNumber($wallet_sequence_number) { + if (is_null($wallet_sequence_number)) { + throw new \InvalidArgumentException('non-nullable wallet_sequence_number cannot be null'); + } $this->container['wallet_sequence_number'] = $wallet_sequence_number; return $this; @@ -657,6 +788,9 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) < 0)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling Employee., must be bigger than or equal to 0.'); @@ -686,6 +820,9 @@ public function getJobTitle() */ public function setJobTitle($job_title) { + if (is_null($job_title)) { + throw new \InvalidArgumentException('non-nullable job_title cannot be null'); + } if ((mb_strlen($job_title) < 0)) { throw new \InvalidArgumentException('invalid length for $job_title when calling Employee., must be bigger than or equal to 0.'); @@ -715,6 +852,9 @@ public function getDepartment() */ public function setDepartment($department) { + if (is_null($department)) { + throw new \InvalidArgumentException('non-nullable department cannot be null'); + } if ((mb_strlen($department) < 0)) { throw new \InvalidArgumentException('invalid length for $department when calling Employee., must be bigger than or equal to 0.'); @@ -728,7 +868,7 @@ public function setDepartment($department) /** * Gets schedule_start_day * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartDay|null */ public function getScheduleStartDay() { @@ -738,12 +878,15 @@ public function getScheduleStartDay() /** * Sets schedule_start_day * - * @param string|null $schedule_start_day schedule_start_day + * @param \OpenAPI\Client\Model\EmployeeScheduleStartDay|null $schedule_start_day schedule_start_day * * @return self */ public function setScheduleStartDay($schedule_start_day) { + if (is_null($schedule_start_day)) { + throw new \InvalidArgumentException('non-nullable schedule_start_day cannot be null'); + } $this->container['schedule_start_day'] = $schedule_start_day; return $this; @@ -752,7 +895,7 @@ public function setScheduleStartDay($schedule_start_day) /** * Gets schedule_start_hour * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartHour|null */ public function getScheduleStartHour() { @@ -762,12 +905,15 @@ public function getScheduleStartHour() /** * Sets schedule_start_hour * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_start_hour schedule_start_hour + * @param \OpenAPI\Client\Model\EmployeeScheduleStartHour|null $schedule_start_hour schedule_start_hour * * @return self */ public function setScheduleStartHour($schedule_start_hour) { + if (is_null($schedule_start_hour)) { + throw new \InvalidArgumentException('non-nullable schedule_start_hour cannot be null'); + } $this->container['schedule_start_hour'] = $schedule_start_hour; return $this; @@ -776,7 +922,7 @@ public function setScheduleStartHour($schedule_start_hour) /** * Gets schedule_start_minute * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null */ public function getScheduleStartMinute() { @@ -786,12 +932,15 @@ public function getScheduleStartMinute() /** * Sets schedule_start_minute * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_start_minute schedule_start_minute + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null $schedule_start_minute schedule_start_minute * * @return self */ public function setScheduleStartMinute($schedule_start_minute) { + if (is_null($schedule_start_minute)) { + throw new \InvalidArgumentException('non-nullable schedule_start_minute cannot be null'); + } $this->container['schedule_start_minute'] = $schedule_start_minute; return $this; @@ -800,7 +949,7 @@ public function setScheduleStartMinute($schedule_start_minute) /** * Gets schedule_start_meridiem * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null */ public function getScheduleStartMeridiem() { @@ -810,12 +959,15 @@ public function getScheduleStartMeridiem() /** * Sets schedule_start_meridiem * - * @param string|null $schedule_start_meridiem schedule_start_meridiem + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null $schedule_start_meridiem schedule_start_meridiem * * @return self */ public function setScheduleStartMeridiem($schedule_start_meridiem) { + if (is_null($schedule_start_meridiem)) { + throw new \InvalidArgumentException('non-nullable schedule_start_meridiem cannot be null'); + } $this->container['schedule_start_meridiem'] = $schedule_start_meridiem; return $this; @@ -824,7 +976,7 @@ public function setScheduleStartMeridiem($schedule_start_meridiem) /** * Gets schedule_end_day * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartDay|null */ public function getScheduleEndDay() { @@ -834,12 +986,15 @@ public function getScheduleEndDay() /** * Sets schedule_end_day * - * @param string|null $schedule_end_day schedule_end_day + * @param \OpenAPI\Client\Model\EmployeeScheduleStartDay|null $schedule_end_day schedule_end_day * * @return self */ public function setScheduleEndDay($schedule_end_day) { + if (is_null($schedule_end_day)) { + throw new \InvalidArgumentException('non-nullable schedule_end_day cannot be null'); + } $this->container['schedule_end_day'] = $schedule_end_day; return $this; @@ -848,7 +1003,7 @@ public function setScheduleEndDay($schedule_end_day) /** * Gets schedule_end_hour * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartHour|null */ public function getScheduleEndHour() { @@ -858,12 +1013,15 @@ public function getScheduleEndHour() /** * Sets schedule_end_hour * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_end_hour schedule_end_hour + * @param \OpenAPI\Client\Model\EmployeeScheduleStartHour|null $schedule_end_hour schedule_end_hour * * @return self */ public function setScheduleEndHour($schedule_end_hour) { + if (is_null($schedule_end_hour)) { + throw new \InvalidArgumentException('non-nullable schedule_end_hour cannot be null'); + } $this->container['schedule_end_hour'] = $schedule_end_hour; return $this; @@ -872,7 +1030,7 @@ public function setScheduleEndHour($schedule_end_hour) /** * Gets schedule_end_minute * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null */ public function getScheduleEndMinute() { @@ -882,12 +1040,15 @@ public function getScheduleEndMinute() /** * Sets schedule_end_minute * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_end_minute schedule_end_minute + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null $schedule_end_minute schedule_end_minute * * @return self */ public function setScheduleEndMinute($schedule_end_minute) { + if (is_null($schedule_end_minute)) { + throw new \InvalidArgumentException('non-nullable schedule_end_minute cannot be null'); + } $this->container['schedule_end_minute'] = $schedule_end_minute; return $this; @@ -896,7 +1057,7 @@ public function setScheduleEndMinute($schedule_end_minute) /** * Gets schedule_end_meridiem * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null */ public function getScheduleEndMeridiem() { @@ -906,12 +1067,15 @@ public function getScheduleEndMeridiem() /** * Sets schedule_end_meridiem * - * @param string|null $schedule_end_meridiem schedule_end_meridiem + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null $schedule_end_meridiem schedule_end_meridiem * * @return self */ public function setScheduleEndMeridiem($schedule_end_meridiem) { + if (is_null($schedule_end_meridiem)) { + throw new \InvalidArgumentException('non-nullable schedule_end_meridiem cannot be null'); + } $this->container['schedule_end_meridiem'] = $schedule_end_meridiem; return $this; @@ -936,14 +1100,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Employee., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Employee., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling Employee., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling Employee., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -970,6 +1137,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -994,6 +1164,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -1018,6 +1191,9 @@ public function getUsername() */ public function setUsername($username) { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } $this->container['username'] = $username; return $this; @@ -1042,6 +1218,9 @@ public function getEmailVerified() */ public function setEmailVerified($email_verified) { + if (is_null($email_verified)) { + throw new \InvalidArgumentException('non-nullable email_verified cannot be null'); + } $this->container['email_verified'] = $email_verified; return $this; @@ -1066,6 +1245,9 @@ public function getProfilePictureUrl() */ public function setProfilePictureUrl($profile_picture_url) { + if (is_null($profile_picture_url)) { + throw new \InvalidArgumentException('non-nullable profile_picture_url cannot be null'); + } $this->container['profile_picture_url'] = $profile_picture_url; return $this; @@ -1090,14 +1272,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Employee., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Employee., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Employee., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Employee., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -1124,6 +1309,9 @@ public function getSessionToken() */ public function setSessionToken($session_token) { + if (is_null($session_token)) { + throw new \InvalidArgumentException('non-nullable session_token cannot be null'); + } $this->container['session_token'] = $session_token; return $this; @@ -1132,7 +1320,7 @@ public function setSessionToken($session_token) /** * Gets failed_login_attempts * - * @return double|null + * @return float|null */ public function getFailedLoginAttempts() { @@ -1142,12 +1330,15 @@ public function getFailedLoginAttempts() /** * Sets failed_login_attempts * - * @param double|null $failed_login_attempts failed_login_attempts + * @param float|null $failed_login_attempts failed_login_attempts * * @return self */ public function setFailedLoginAttempts($failed_login_attempts) { + if (is_null($failed_login_attempts)) { + throw new \InvalidArgumentException('non-nullable failed_login_attempts cannot be null'); + } $this->container['failed_login_attempts'] = $failed_login_attempts; return $this; @@ -1172,6 +1363,9 @@ public function getLastLoginDate() */ public function setLastLoginDate($last_login_date) { + if (is_null($last_login_date)) { + throw new \InvalidArgumentException('non-nullable last_login_date cannot be null'); + } $this->container['last_login_date'] = $last_login_date; return $this; @@ -1196,6 +1390,9 @@ public function getCfuvid() */ public function setCfuvid($cfuvid) { + if (is_null($cfuvid)) { + throw new \InvalidArgumentException('non-nullable cfuvid cannot be null'); + } $this->container['cfuvid'] = $cfuvid; return $this; @@ -1220,6 +1417,9 @@ public function getSchedule() */ public function setSchedule($schedule) { + if (is_null($schedule)) { + throw new \InvalidArgumentException('non-nullable schedule cannot be null'); + } $this->container['schedule'] = $schedule; return $this; @@ -1244,6 +1444,9 @@ public function getIsEmailNotificationDisabled() */ public function setIsEmailNotificationDisabled($is_email_notification_disabled) { + if (is_null($is_email_notification_disabled)) { + throw new \InvalidArgumentException('non-nullable is_email_notification_disabled cannot be null'); + } $this->container['is_email_notification_disabled'] = $is_email_notification_disabled; return $this; @@ -1255,7 +1458,7 @@ public function setIsEmailNotificationDisabled($is_email_notification_disabled) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1267,6 +1470,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1280,7 +1484,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1296,7 +1500,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1308,6 +1512,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/EmployeeAPIKey.php b/lib/Model/EmployeeAPIKey.php index bb0c3e6..5dd4097 100644 --- a/lib/Model/EmployeeAPIKey.php +++ b/lib/Model/EmployeeAPIKey.php @@ -2,7 +2,7 @@ /** * EmployeeAPIKey * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class EmployeeAPIKey implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class EmployeeAPIKey implements ModelInterface, ArrayAccess, \JsonSerializable 'title' => 'string', 'description' => 'string', 'employee_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -90,6 +88,30 @@ class EmployeeAPIKey implements ModelInterface, ArrayAccess, \JsonSerializable 'api_key' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'employee_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'api_key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -110,6 +132,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -219,15 +293,33 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['api_key'] = $data['api_key'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('api_key', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -271,14 +363,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -337,6 +421,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling EmployeeAPIKey., must be bigger than or equal to 1.'); @@ -366,6 +453,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling EmployeeAPIKey., must be bigger than or equal to 1.'); @@ -395,14 +485,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling EmployeeAPIKey., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling EmployeeAPIKey., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling EmployeeAPIKey., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling EmployeeAPIKey., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -413,7 +506,7 @@ public function setEmployeeId($employee_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -423,19 +516,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling EmployeeAPIKey., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling EmployeeAPIKey., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -460,14 +549,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling EmployeeAPIKey., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling EmployeeAPIKey., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling EmployeeAPIKey., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling EmployeeAPIKey., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -494,6 +586,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -518,6 +613,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -542,6 +640,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -566,6 +667,9 @@ public function getApiKey() */ public function setApiKey($api_key) { + if (is_null($api_key)) { + throw new \InvalidArgumentException('non-nullable api_key cannot be null'); + } $this->container['api_key'] = $api_key; return $this; @@ -577,7 +681,7 @@ public function setApiKey($api_key) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -589,6 +693,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -602,7 +707,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -618,7 +723,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -630,6 +735,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/EmployeeActivityLog.php b/lib/Model/EmployeeActivityLog.php index 3e87b4f..c15a423 100644 --- a/lib/Model/EmployeeActivityLog.php +++ b/lib/Model/EmployeeActivityLog.php @@ -2,7 +2,7 @@ /** * EmployeeActivityLog * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class EmployeeActivityLog implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -86,6 +84,28 @@ class EmployeeActivityLog implements ModelInterface, ArrayAccess, \JsonSerializa 'page_name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'employee_id' => false, + 'action' => false, + 'route' => false, + 'page_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +126,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -209,13 +281,31 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['action'] = $data['action'] ?? null; - $this->container['route'] = $data['route'] ?? null; - $this->container['page_name'] = $data['page_name'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('route', $data ?? [], null); + $this->setIfExists('page_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -306,14 +396,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling EmployeeActivityLog., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling EmployeeActivityLog., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling EmployeeActivityLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling EmployeeActivityLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -340,6 +433,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -364,6 +460,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -388,14 +487,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling EmployeeActivityLog., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling EmployeeActivityLog., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling EmployeeActivityLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling EmployeeActivityLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -422,6 +524,9 @@ public function getAction() */ public function setAction($action) { + if (is_null($action)) { + throw new \InvalidArgumentException('non-nullable action cannot be null'); + } $this->container['action'] = $action; return $this; @@ -446,6 +551,9 @@ public function getRoute() */ public function setRoute($route) { + if (is_null($route)) { + throw new \InvalidArgumentException('non-nullable route cannot be null'); + } $this->container['route'] = $route; return $this; @@ -470,6 +578,9 @@ public function getPageName() */ public function setPageName($page_name) { + if (is_null($page_name)) { + throw new \InvalidArgumentException('non-nullable page_name cannot be null'); + } $this->container['page_name'] = $page_name; return $this; @@ -481,7 +592,7 @@ public function setPageName($page_name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -493,6 +604,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -506,7 +618,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -522,7 +634,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -534,6 +646,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/EmployeeAlert.php b/lib/Model/EmployeeAlert.php index 124776c..b6cea4a 100644 --- a/lib/Model/EmployeeAlert.php +++ b/lib/Model/EmployeeAlert.php @@ -2,7 +2,7 @@ /** * EmployeeAlert * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class EmployeeAlert implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -65,7 +63,7 @@ class EmployeeAlert implements ModelInterface, ArrayAccess, \JsonSerializable 'message' => 'string', 's3_bucket' => 'string', 's3_key' => 'string', - 'file_size_bytes' => 'double', + 'file_size_bytes' => 'float', 'id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -92,6 +90,31 @@ class EmployeeAlert implements ModelInterface, ArrayAccess, \JsonSerializable 'is_read' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false, + 'title' => false, + 'message' => false, + 's3_bucket' => false, + 's3_key' => false, + 'file_size_bytes' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_read' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['s3_bucket'] = $data['s3_bucket'] ?? null; - $this->container['s3_key'] = $data['s3_key'] ?? null; - $this->container['file_size_bytes'] = $data['file_size_bytes'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_read'] = $data['is_read'] ?? null; + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('s3_bucket', $data ?? [], null); + $this->setIfExists('s3_key', $data ?? [], null); + $this->setIfExists('file_size_bytes', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_read', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -333,14 +426,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling EmployeeAlert., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling EmployeeAlert., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling EmployeeAlert., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling EmployeeAlert., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -367,6 +463,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } $this->container['title'] = $title; return $this; @@ -391,6 +490,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -415,6 +517,9 @@ public function getS3Bucket() */ public function setS3Bucket($s3_bucket) { + if (is_null($s3_bucket)) { + throw new \InvalidArgumentException('non-nullable s3_bucket cannot be null'); + } $this->container['s3_bucket'] = $s3_bucket; return $this; @@ -439,6 +544,9 @@ public function getS3Key() */ public function setS3Key($s3_key) { + if (is_null($s3_key)) { + throw new \InvalidArgumentException('non-nullable s3_key cannot be null'); + } $this->container['s3_key'] = $s3_key; return $this; @@ -447,7 +555,7 @@ public function setS3Key($s3_key) /** * Gets file_size_bytes * - * @return double + * @return float */ public function getFileSizeBytes() { @@ -457,12 +565,15 @@ public function getFileSizeBytes() /** * Sets file_size_bytes * - * @param double $file_size_bytes file_size_bytes + * @param float $file_size_bytes file_size_bytes * * @return self */ public function setFileSizeBytes($file_size_bytes) { + if (is_null($file_size_bytes)) { + throw new \InvalidArgumentException('non-nullable file_size_bytes cannot be null'); + } $this->container['file_size_bytes'] = $file_size_bytes; return $this; @@ -487,14 +598,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling EmployeeAlert., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling EmployeeAlert., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling EmployeeAlert., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling EmployeeAlert., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -521,6 +635,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -545,6 +662,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -569,6 +689,9 @@ public function getIsRead() */ public function setIsRead($is_read) { + if (is_null($is_read)) { + throw new \InvalidArgumentException('non-nullable is_read cannot be null'); + } $this->container['is_read'] = $is_read; return $this; @@ -580,7 +703,7 @@ public function setIsRead($is_read) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -592,6 +715,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -605,7 +729,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -621,7 +745,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -633,6 +757,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/EmployeeScheduleStartDay.php b/lib/Model/EmployeeScheduleStartDay.php new file mode 100644 index 0000000..2c2a3ad --- /dev/null +++ b/lib/Model/EmployeeScheduleStartDay.php @@ -0,0 +1,382 @@ + + */ +class EmployeeScheduleStartDay implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Employee_scheduleStartDay'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EmployeeScheduleStartHour.php b/lib/Model/EmployeeScheduleStartHour.php new file mode 100644 index 0000000..65bd2b4 --- /dev/null +++ b/lib/Model/EmployeeScheduleStartHour.php @@ -0,0 +1,382 @@ + + */ +class EmployeeScheduleStartHour implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Employee_scheduleStartHour'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EmployeeScheduleStartMeridiem.php b/lib/Model/EmployeeScheduleStartMeridiem.php new file mode 100644 index 0000000..4b96abf --- /dev/null +++ b/lib/Model/EmployeeScheduleStartMeridiem.php @@ -0,0 +1,382 @@ + + */ +class EmployeeScheduleStartMeridiem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Employee_scheduleStartMeridiem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EmployeeScheduleStartMinute.php b/lib/Model/EmployeeScheduleStartMinute.php new file mode 100644 index 0000000..1b6692e --- /dev/null +++ b/lib/Model/EmployeeScheduleStartMinute.php @@ -0,0 +1,382 @@ + + */ +class EmployeeScheduleStartMinute implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Employee_scheduleStartMinute'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/EntityTooLarge.php b/lib/Model/EntityTooLarge.php index 1192673..b471adf 100644 --- a/lib/Model/EntityTooLarge.php +++ b/lib/Model/EntityTooLarge.php @@ -2,7 +2,7 @@ /** * EntityTooLarge * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class EntityTooLarge implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class EntityTooLarge implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => 'string', 'message' => 'string', 'stack' => 'string', - 'http_error_code' => 'double', + 'http_error_code' => 'float', 'tracking_code' => 'string' ]; @@ -82,6 +80,26 @@ class EntityTooLarge implements ModelInterface, ArrayAccess, \JsonSerializable 'tracking_code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'stack' => false, + 'http_error_code' => false, + 'tracking_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['stack'] = $data['stack'] ?? null; - $this->container['http_error_code'] = $data['http_error_code'] ?? null; - $this->container['tracking_code'] = $data['tracking_code'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('stack', $data ?? [], null); + $this->setIfExists('http_error_code', $data ?? [], null); + $this->setIfExists('tracking_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -261,6 +349,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -285,6 +376,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -309,6 +403,9 @@ public function getStack() */ public function setStack($stack) { + if (is_null($stack)) { + throw new \InvalidArgumentException('non-nullable stack cannot be null'); + } $this->container['stack'] = $stack; return $this; @@ -317,7 +414,7 @@ public function setStack($stack) /** * Gets http_error_code * - * @return double + * @return float */ public function getHttpErrorCode() { @@ -327,12 +424,15 @@ public function getHttpErrorCode() /** * Sets http_error_code * - * @param double $http_error_code http_error_code + * @param float $http_error_code http_error_code * * @return self */ public function setHttpErrorCode($http_error_code) { + if (is_null($http_error_code)) { + throw new \InvalidArgumentException('non-nullable http_error_code cannot be null'); + } $this->container['http_error_code'] = $http_error_code; return $this; @@ -357,6 +457,9 @@ public function getTrackingCode() */ public function setTrackingCode($tracking_code) { + if (is_null($tracking_code)) { + throw new \InvalidArgumentException('non-nullable tracking_code cannot be null'); + } $this->container['tracking_code'] = $tracking_code; return $this; @@ -368,7 +471,7 @@ public function setTrackingCode($tracking_code) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -380,6 +483,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -393,7 +497,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -409,7 +513,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -421,6 +525,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ExportDataFile.php b/lib/Model/ExportDataFile.php index 7bba0d4..e649989 100644 --- a/lib/Model/ExportDataFile.php +++ b/lib/Model/ExportDataFile.php @@ -2,7 +2,7 @@ /** * ExportDataFile * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ExportDataFile implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,7 +67,7 @@ class ExportDataFile implements ModelInterface, ArrayAccess, \JsonSerializable 'employee_id' => 'string', 's3_bucket' => 'string', 's3_key' => 'string', - 'file_size_bytes' => 'double' + 'file_size_bytes' => 'float' ]; /** @@ -92,6 +90,31 @@ class ExportDataFile implements ModelInterface, ArrayAccess, \JsonSerializable 'file_size_bytes' => 'double' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'is_read' => false, + 'employee_id' => false, + 's3_bucket' => false, + 's3_key' => false, + 'file_size_bytes' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['is_read'] = $data['is_read'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['s3_bucket'] = $data['s3_bucket'] ?? null; - $this->container['s3_key'] = $data['s3_key'] ?? null; - $this->container['file_size_bytes'] = $data['file_size_bytes'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('is_read', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('s3_bucket', $data ?? [], null); + $this->setIfExists('s3_key', $data ?? [], null); + $this->setIfExists('file_size_bytes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -345,14 +438,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling ExportDataFile., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling ExportDataFile., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling ExportDataFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling ExportDataFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -379,14 +475,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling ExportDataFile., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling ExportDataFile., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling ExportDataFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling ExportDataFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -413,6 +512,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -437,6 +539,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -461,6 +566,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -485,6 +593,9 @@ public function getIsRead() */ public function setIsRead($is_read) { + if (is_null($is_read)) { + throw new \InvalidArgumentException('non-nullable is_read cannot be null'); + } $this->container['is_read'] = $is_read; return $this; @@ -509,14 +620,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling ExportDataFile., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling ExportDataFile., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling ExportDataFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling ExportDataFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -543,6 +657,9 @@ public function getS3Bucket() */ public function setS3Bucket($s3_bucket) { + if (is_null($s3_bucket)) { + throw new \InvalidArgumentException('non-nullable s3_bucket cannot be null'); + } $this->container['s3_bucket'] = $s3_bucket; return $this; @@ -567,6 +684,9 @@ public function getS3Key() */ public function setS3Key($s3_key) { + if (is_null($s3_key)) { + throw new \InvalidArgumentException('non-nullable s3_key cannot be null'); + } $this->container['s3_key'] = $s3_key; return $this; @@ -575,7 +695,7 @@ public function setS3Key($s3_key) /** * Gets file_size_bytes * - * @return double + * @return float */ public function getFileSizeBytes() { @@ -585,12 +705,15 @@ public function getFileSizeBytes() /** * Sets file_size_bytes * - * @param double $file_size_bytes file_size_bytes + * @param float $file_size_bytes file_size_bytes * * @return self */ public function setFileSizeBytes($file_size_bytes) { + if (is_null($file_size_bytes)) { + throw new \InvalidArgumentException('non-nullable file_size_bytes cannot be null'); + } $this->container['file_size_bytes'] = $file_size_bytes; return $this; @@ -602,7 +725,7 @@ public function setFileSizeBytes($file_size_bytes) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -614,6 +737,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -627,7 +751,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -643,7 +767,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -655,6 +779,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/FalsumError.php b/lib/Model/FalsumError.php index b4af4c2..0752fc6 100644 --- a/lib/Model/FalsumError.php +++ b/lib/Model/FalsumError.php @@ -2,7 +2,7 @@ /** * FalsumError * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class FalsumError implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -77,6 +75,23 @@ class FalsumError implements ModelInterface, ArrayAccess, \JsonSerializable 'fields' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false, + 'fields' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +112,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -185,8 +252,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['message'] = $data['message'] ?? null; - $this->container['fields'] = $data['fields'] ?? null; + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('fields', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -238,6 +323,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -262,6 +350,9 @@ public function getFields() */ public function setFields($fields) { + if (is_null($fields)) { + throw new \InvalidArgumentException('non-nullable fields cannot be null'); + } $this->container['fields'] = $fields; return $this; @@ -273,7 +364,7 @@ public function setFields($fields) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -285,6 +376,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -298,7 +390,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -314,7 +406,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -326,6 +418,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/FalsumField.php b/lib/Model/FalsumField.php index 5688e24..7ed2e73 100644 --- a/lib/Model/FalsumField.php +++ b/lib/Model/FalsumField.php @@ -2,7 +2,7 @@ /** * FalsumField * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class FalsumField implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -79,6 +77,24 @@ class FalsumField implements ModelInterface, ArrayAccess, \JsonSerializable 'value' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -99,6 +115,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -190,9 +258,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['value'] = $data['value'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -247,6 +333,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -271,6 +360,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -295,6 +387,9 @@ public function getValue() */ public function setValue($value) { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } $this->container['value'] = $value; return $this; @@ -306,7 +401,7 @@ public function setValue($value) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -318,6 +413,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -331,7 +427,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -347,7 +443,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -359,6 +455,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Feature.php b/lib/Model/Feature.php index 7914763..6000d7d 100644 --- a/lib/Model/Feature.php +++ b/lib/Model/Feature.php @@ -2,7 +2,7 @@ /** * Feature * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Feature implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class Feature implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sort_num' => 'double', + 'sort_num' => 'float', 'name' => 'string', 'max_volume' => 'string', 'measurement' => 'string', @@ -90,6 +88,30 @@ class Feature implements ModelInterface, ArrayAccess, \JsonSerializable 'is_enabled' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'sort_num' => false, + 'name' => false, + 'max_volume' => false, + 'measurement' => false, + 'description' => false, + 'current_volume' => false, + 'is_exceeded' => false, + 'is_in_use' => false, + 'is_enabled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -110,6 +132,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -219,15 +293,33 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['sort_num'] = $data['sort_num'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['max_volume'] = $data['max_volume'] ?? null; - $this->container['measurement'] = $data['measurement'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['current_volume'] = $data['current_volume'] ?? null; - $this->container['is_exceeded'] = $data['is_exceeded'] ?? null; - $this->container['is_in_use'] = $data['is_in_use'] ?? null; - $this->container['is_enabled'] = $data['is_enabled'] ?? null; + $this->setIfExists('sort_num', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('max_volume', $data ?? [], null); + $this->setIfExists('measurement', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('current_volume', $data ?? [], null); + $this->setIfExists('is_exceeded', $data ?? [], null); + $this->setIfExists('is_in_use', $data ?? [], null); + $this->setIfExists('is_enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -269,7 +361,7 @@ public function valid() /** * Gets sort_num * - * @return double + * @return float */ public function getSortNum() { @@ -279,12 +371,15 @@ public function getSortNum() /** * Sets sort_num * - * @param double $sort_num sort_num + * @param float $sort_num sort_num * * @return self */ public function setSortNum($sort_num) { + if (is_null($sort_num)) { + throw new \InvalidArgumentException('non-nullable sort_num cannot be null'); + } $this->container['sort_num'] = $sort_num; return $this; @@ -309,6 +404,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -333,6 +431,9 @@ public function getMaxVolume() */ public function setMaxVolume($max_volume) { + if (is_null($max_volume)) { + throw new \InvalidArgumentException('non-nullable max_volume cannot be null'); + } $this->container['max_volume'] = $max_volume; return $this; @@ -357,6 +458,9 @@ public function getMeasurement() */ public function setMeasurement($measurement) { + if (is_null($measurement)) { + throw new \InvalidArgumentException('non-nullable measurement cannot be null'); + } $this->container['measurement'] = $measurement; return $this; @@ -381,6 +485,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } $this->container['description'] = $description; return $this; @@ -405,6 +512,9 @@ public function getCurrentVolume() */ public function setCurrentVolume($current_volume) { + if (is_null($current_volume)) { + throw new \InvalidArgumentException('non-nullable current_volume cannot be null'); + } $this->container['current_volume'] = $current_volume; return $this; @@ -429,6 +539,9 @@ public function getIsExceeded() */ public function setIsExceeded($is_exceeded) { + if (is_null($is_exceeded)) { + throw new \InvalidArgumentException('non-nullable is_exceeded cannot be null'); + } $this->container['is_exceeded'] = $is_exceeded; return $this; @@ -453,6 +566,9 @@ public function getIsInUse() */ public function setIsInUse($is_in_use) { + if (is_null($is_in_use)) { + throw new \InvalidArgumentException('non-nullable is_in_use cannot be null'); + } $this->container['is_in_use'] = $is_in_use; return $this; @@ -477,6 +593,9 @@ public function getIsEnabled() */ public function setIsEnabled($is_enabled) { + if (is_null($is_enabled)) { + throw new \InvalidArgumentException('non-nullable is_enabled cannot be null'); + } $this->container['is_enabled'] = $is_enabled; return $this; @@ -488,7 +607,7 @@ public function setIsEnabled($is_enabled) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -500,6 +619,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -513,7 +633,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -529,7 +649,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -541,6 +661,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/FetchAllCountries200ResponseInner.php b/lib/Model/FetchAllCountries200ResponseInner.php new file mode 100644 index 0000000..20801c2 --- /dev/null +++ b/lib/Model/FetchAllCountries200ResponseInner.php @@ -0,0 +1,524 @@ + + */ +class FetchAllCountries200ResponseInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchAllCountries_200_response_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency_abbreviation' => 'string', + 'phone_code' => 'string', + 'iso2' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency_abbreviation' => null, + 'phone_code' => null, + 'iso2' => null, + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'currency_abbreviation' => false, + 'phone_code' => false, + 'iso2' => false, + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency_abbreviation' => 'currency_abbreviation', + 'phone_code' => 'phone_code', + 'iso2' => 'iso2', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency_abbreviation' => 'setCurrencyAbbreviation', + 'phone_code' => 'setPhoneCode', + 'iso2' => 'setIso2', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency_abbreviation' => 'getCurrencyAbbreviation', + 'phone_code' => 'getPhoneCode', + 'iso2' => 'getIso2', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('currency_abbreviation', $data ?? [], null); + $this->setIfExists('phone_code', $data ?? [], null); + $this->setIfExists('iso2', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency_abbreviation'] === null) { + $invalidProperties[] = "'currency_abbreviation' can't be null"; + } + if ($this->container['phone_code'] === null) { + $invalidProperties[] = "'phone_code' can't be null"; + } + if ($this->container['iso2'] === null) { + $invalidProperties[] = "'iso2' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency_abbreviation + * + * @return string + */ + public function getCurrencyAbbreviation() + { + return $this->container['currency_abbreviation']; + } + + /** + * Sets currency_abbreviation + * + * @param string $currency_abbreviation currency_abbreviation + * + * @return self + */ + public function setCurrencyAbbreviation($currency_abbreviation) + { + if (is_null($currency_abbreviation)) { + throw new \InvalidArgumentException('non-nullable currency_abbreviation cannot be null'); + } + $this->container['currency_abbreviation'] = $currency_abbreviation; + + return $this; + } + + /** + * Gets phone_code + * + * @return string + */ + public function getPhoneCode() + { + return $this->container['phone_code']; + } + + /** + * Sets phone_code + * + * @param string $phone_code phone_code + * + * @return self + */ + public function setPhoneCode($phone_code) + { + if (is_null($phone_code)) { + throw new \InvalidArgumentException('non-nullable phone_code cannot be null'); + } + $this->container['phone_code'] = $phone_code; + + return $this; + } + + /** + * Gets iso2 + * + * @return string + */ + public function getIso2() + { + return $this->container['iso2']; + } + + /** + * Sets iso2 + * + * @param string $iso2 iso2 + * + * @return self + */ + public function setIso2($iso2) + { + if (is_null($iso2)) { + throw new \InvalidArgumentException('non-nullable iso2 cannot be null'); + } + $this->container['iso2'] = $iso2; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchAllLedgerTransactions200Response.php b/lib/Model/FetchAllLedgerTransactions200Response.php new file mode 100644 index 0000000..d11a1a3 --- /dev/null +++ b/lib/Model/FetchAllLedgerTransactions200Response.php @@ -0,0 +1,487 @@ + + */ +class FetchAllLedgerTransactions200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchAllLedgerTransactions_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entries' => '\OpenAPI\Client\Model\LedgerEntry[]', + 'page_count' => 'float', + 'total_records' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entries' => null, + 'page_count' => 'double', + 'total_records' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'entries' => false, + 'page_count' => false, + 'total_records' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entries' => 'entries', + 'page_count' => 'pageCount', + 'total_records' => 'totalRecords' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entries' => 'setEntries', + 'page_count' => 'setPageCount', + 'total_records' => 'setTotalRecords' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entries' => 'getEntries', + 'page_count' => 'getPageCount', + 'total_records' => 'getTotalRecords' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('entries', $data ?? [], null); + $this->setIfExists('page_count', $data ?? [], null); + $this->setIfExists('total_records', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['entries'] === null) { + $invalidProperties[] = "'entries' can't be null"; + } + if ($this->container['page_count'] === null) { + $invalidProperties[] = "'page_count' can't be null"; + } + if ($this->container['total_records'] === null) { + $invalidProperties[] = "'total_records' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets entries + * + * @return \OpenAPI\Client\Model\LedgerEntry[] + */ + public function getEntries() + { + return $this->container['entries']; + } + + /** + * Sets entries + * + * @param \OpenAPI\Client\Model\LedgerEntry[] $entries entries + * + * @return self + */ + public function setEntries($entries) + { + if (is_null($entries)) { + throw new \InvalidArgumentException('non-nullable entries cannot be null'); + } + $this->container['entries'] = $entries; + + return $this; + } + + /** + * Gets page_count + * + * @return float + */ + public function getPageCount() + { + return $this->container['page_count']; + } + + /** + * Sets page_count + * + * @param float $page_count page_count + * + * @return self + */ + public function setPageCount($page_count) + { + if (is_null($page_count)) { + throw new \InvalidArgumentException('non-nullable page_count cannot be null'); + } + $this->container['page_count'] = $page_count; + + return $this; + } + + /** + * Gets total_records + * + * @return float + */ + public function getTotalRecords() + { + return $this->container['total_records']; + } + + /** + * Sets total_records + * + * @param float $total_records total_records + * + * @return self + */ + public function setTotalRecords($total_records) + { + if (is_null($total_records)) { + throw new \InvalidArgumentException('non-nullable total_records cannot be null'); + } + $this->container['total_records'] = $total_records; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner.php b/lib/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner.php new file mode 100644 index 0000000..71962c5 --- /dev/null +++ b/lib/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner.php @@ -0,0 +1,857 @@ + + */ +class FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInner implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID_200_response_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_design' => '\OpenAPI\Client\Model\PaymentDesign', + 'value_type' => '\OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType', + 'voucher_type' => 'float', + 'expiration_date' => '\DateTime', + 'start_date' => '\DateTime', + 'title' => 'string', + 'is_redeemed' => 'bool', + 'display_value' => 'string', + 'offer_amount_cents_decimal' => 'string', + 'offer_amount_cents' => 'float', + 'member_id' => 'string', + 'cell_phone_number' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_design' => null, + 'value_type' => null, + 'voucher_type' => 'double', + 'expiration_date' => 'date-time', + 'start_date' => 'date-time', + 'title' => null, + 'is_redeemed' => null, + 'display_value' => null, + 'offer_amount_cents_decimal' => null, + 'offer_amount_cents' => 'double', + 'member_id' => null, + 'cell_phone_number' => null, + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'payment_design' => false, + 'value_type' => false, + 'voucher_type' => false, + 'expiration_date' => false, + 'start_date' => false, + 'title' => false, + 'is_redeemed' => false, + 'display_value' => false, + 'offer_amount_cents_decimal' => false, + 'offer_amount_cents' => false, + 'member_id' => false, + 'cell_phone_number' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_design' => 'PaymentDesign', + 'value_type' => 'ValueType', + 'voucher_type' => 'VoucherType', + 'expiration_date' => 'ExpirationDate', + 'start_date' => 'StartDate', + 'title' => 'Title', + 'is_redeemed' => 'IsRedeemed', + 'display_value' => 'DisplayValue', + 'offer_amount_cents_decimal' => 'OfferAmountCents_decimal', + 'offer_amount_cents' => 'OfferAmountCents', + 'member_id' => 'MemberID', + 'cell_phone_number' => 'CellPhoneNumber', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_design' => 'setPaymentDesign', + 'value_type' => 'setValueType', + 'voucher_type' => 'setVoucherType', + 'expiration_date' => 'setExpirationDate', + 'start_date' => 'setStartDate', + 'title' => 'setTitle', + 'is_redeemed' => 'setIsRedeemed', + 'display_value' => 'setDisplayValue', + 'offer_amount_cents_decimal' => 'setOfferAmountCentsDecimal', + 'offer_amount_cents' => 'setOfferAmountCents', + 'member_id' => 'setMemberId', + 'cell_phone_number' => 'setCellPhoneNumber', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_design' => 'getPaymentDesign', + 'value_type' => 'getValueType', + 'voucher_type' => 'getVoucherType', + 'expiration_date' => 'getExpirationDate', + 'start_date' => 'getStartDate', + 'title' => 'getTitle', + 'is_redeemed' => 'getIsRedeemed', + 'display_value' => 'getDisplayValue', + 'offer_amount_cents_decimal' => 'getOfferAmountCentsDecimal', + 'offer_amount_cents' => 'getOfferAmountCents', + 'member_id' => 'getMemberId', + 'cell_phone_number' => 'getCellPhoneNumber', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_design', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('voucher_type', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('is_redeemed', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('offer_amount_cents_decimal', $data ?? [], null); + $this->setIfExists('offer_amount_cents', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('cell_phone_number', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['payment_design'] === null) { + $invalidProperties[] = "'payment_design' can't be null"; + } + if ($this->container['value_type'] === null) { + $invalidProperties[] = "'value_type' can't be null"; + } + if ($this->container['voucher_type'] === null) { + $invalidProperties[] = "'voucher_type' can't be null"; + } + if ($this->container['expiration_date'] === null) { + $invalidProperties[] = "'expiration_date' can't be null"; + } + if ($this->container['start_date'] === null) { + $invalidProperties[] = "'start_date' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['is_redeemed'] === null) { + $invalidProperties[] = "'is_redeemed' can't be null"; + } + if ($this->container['display_value'] === null) { + $invalidProperties[] = "'display_value' can't be null"; + } + if ($this->container['offer_amount_cents_decimal'] === null) { + $invalidProperties[] = "'offer_amount_cents_decimal' can't be null"; + } + if ($this->container['offer_amount_cents'] === null) { + $invalidProperties[] = "'offer_amount_cents' can't be null"; + } + if ($this->container['member_id'] === null) { + $invalidProperties[] = "'member_id' can't be null"; + } + if ($this->container['cell_phone_number'] === null) { + $invalidProperties[] = "'cell_phone_number' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_design + * + * @return \OpenAPI\Client\Model\PaymentDesign + */ + public function getPaymentDesign() + { + return $this->container['payment_design']; + } + + /** + * Sets payment_design + * + * @param \OpenAPI\Client\Model\PaymentDesign $payment_design payment_design + * + * @return self + */ + public function setPaymentDesign($payment_design) + { + if (is_null($payment_design)) { + throw new \InvalidArgumentException('non-nullable payment_design cannot be null'); + } + $this->container['payment_design'] = $payment_design; + + return $this; + } + + /** + * Gets value_type + * + * @return \OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType + */ + public function getValueType() + { + return $this->container['value_type']; + } + + /** + * Sets value_type + * + * @param \OpenAPI\Client\Model\FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType $value_type value_type + * + * @return self + */ + public function setValueType($value_type) + { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } + $this->container['value_type'] = $value_type; + + return $this; + } + + /** + * Gets voucher_type + * + * @return float + */ + public function getVoucherType() + { + return $this->container['voucher_type']; + } + + /** + * Sets voucher_type + * + * @param float $voucher_type voucher_type + * + * @return self + */ + public function setVoucherType($voucher_type) + { + if (is_null($voucher_type)) { + throw new \InvalidArgumentException('non-nullable voucher_type cannot be null'); + } + $this->container['voucher_type'] = $voucher_type; + + return $this; + } + + /** + * Gets expiration_date + * + * @return \DateTime + */ + public function getExpirationDate() + { + return $this->container['expiration_date']; + } + + /** + * Sets expiration_date + * + * @param \DateTime $expiration_date expiration_date + * + * @return self + */ + public function setExpirationDate($expiration_date) + { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } + $this->container['expiration_date'] = $expiration_date; + + return $this; + } + + /** + * Gets start_date + * + * @return \DateTime + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime $start_date start_date + * + * @return self + */ + public function setStartDate($start_date) + { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets is_redeemed + * + * @return bool + */ + public function getIsRedeemed() + { + return $this->container['is_redeemed']; + } + + /** + * Sets is_redeemed + * + * @param bool $is_redeemed is_redeemed + * + * @return self + */ + public function setIsRedeemed($is_redeemed) + { + if (is_null($is_redeemed)) { + throw new \InvalidArgumentException('non-nullable is_redeemed cannot be null'); + } + $this->container['is_redeemed'] = $is_redeemed; + + return $this; + } + + /** + * Gets display_value + * + * @return string + */ + public function getDisplayValue() + { + return $this->container['display_value']; + } + + /** + * Sets display_value + * + * @param string $display_value display_value + * + * @return self + */ + public function setDisplayValue($display_value) + { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } + $this->container['display_value'] = $display_value; + + return $this; + } + + /** + * Gets offer_amount_cents_decimal + * + * @return string + */ + public function getOfferAmountCentsDecimal() + { + return $this->container['offer_amount_cents_decimal']; + } + + /** + * Sets offer_amount_cents_decimal + * + * @param string $offer_amount_cents_decimal offer_amount_cents_decimal + * + * @return self + */ + public function setOfferAmountCentsDecimal($offer_amount_cents_decimal) + { + if (is_null($offer_amount_cents_decimal)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents_decimal cannot be null'); + } + $this->container['offer_amount_cents_decimal'] = $offer_amount_cents_decimal; + + return $this; + } + + /** + * Gets offer_amount_cents + * + * @return float + */ + public function getOfferAmountCents() + { + return $this->container['offer_amount_cents']; + } + + /** + * Sets offer_amount_cents + * + * @param float $offer_amount_cents offer_amount_cents + * + * @return self + */ + public function setOfferAmountCents($offer_amount_cents) + { + if (is_null($offer_amount_cents)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents cannot be null'); + } + $this->container['offer_amount_cents'] = $offer_amount_cents; + + return $this; + } + + /** + * Gets member_id + * + * @return string + */ + public function getMemberId() + { + return $this->container['member_id']; + } + + /** + * Sets member_id + * + * @param string $member_id member_id + * + * @return self + */ + public function setMemberId($member_id) + { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } + $this->container['member_id'] = $member_id; + + return $this; + } + + /** + * Gets cell_phone_number + * + * @return string + */ + public function getCellPhoneNumber() + { + return $this->container['cell_phone_number']; + } + + /** + * Sets cell_phone_number + * + * @param string $cell_phone_number cell_phone_number + * + * @return self + */ + public function setCellPhoneNumber($cell_phone_number) + { + if (is_null($cell_phone_number)) { + throw new \InvalidArgumentException('non-nullable cell_phone_number cannot be null'); + } + $this->container['cell_phone_number'] = $cell_phone_number; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType.php b/lib/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType.php new file mode 100644 index 0000000..6e01134 --- /dev/null +++ b/lib/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType.php @@ -0,0 +1,382 @@ + + */ +class FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchAllStaticVouchersAssociatedWithCustomerWithVoucherID_200_response_inner_ValueType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchCustomerTicketsWithTokenRequest.php b/lib/Model/FetchCustomerTicketsWithTokenRequest.php new file mode 100644 index 0000000..01e70b4 --- /dev/null +++ b/lib/Model/FetchCustomerTicketsWithTokenRequest.php @@ -0,0 +1,450 @@ + + */ +class FetchCustomerTicketsWithTokenRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchCustomerTicketsWithToken_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'phone_verification_token' => 'string', + 'merchant_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'phone_verification_token' => null, + 'merchant_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_verification_token' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'phone_verification_token' => 'phoneVerificationToken', + 'merchant_id' => 'merchantID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'phone_verification_token' => 'setPhoneVerificationToken', + 'merchant_id' => 'setMerchantId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'phone_verification_token' => 'getPhoneVerificationToken', + 'merchant_id' => 'getMerchantId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('phone_verification_token', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['phone_verification_token'] === null) { + $invalidProperties[] = "'phone_verification_token' can't be null"; + } + if ($this->container['merchant_id'] === null) { + $invalidProperties[] = "'merchant_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets phone_verification_token + * + * @return string + */ + public function getPhoneVerificationToken() + { + return $this->container['phone_verification_token']; + } + + /** + * Sets phone_verification_token + * + * @param string $phone_verification_token phone_verification_token + * + * @return self + */ + public function setPhoneVerificationToken($phone_verification_token) + { + if (is_null($phone_verification_token)) { + throw new \InvalidArgumentException('non-nullable phone_verification_token cannot be null'); + } + $this->container['phone_verification_token'] = $phone_verification_token; + + return $this; + } + + /** + * Gets merchant_id + * + * @return string + */ + public function getMerchantId() + { + return $this->container['merchant_id']; + } + + /** + * Sets merchant_id + * + * @param string $merchant_id merchant_id + * + * @return self + */ + public function setMerchantId($merchant_id) + { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } + $this->container['merchant_id'] = $merchant_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchDomainsByIndustry200Response.php b/lib/Model/FetchDomainsByIndustry200Response.php new file mode 100644 index 0000000..6502d10 --- /dev/null +++ b/lib/Model/FetchDomainsByIndustry200Response.php @@ -0,0 +1,635 @@ + + */ +class FetchDomainsByIndustry200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchDomainsByIndustry_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entertainment' => 'mixed[]', + 'grocery' => 'mixed[]', + 'service' => 'mixed[]', + 'casino' => 'mixed[]', + 'hospitality' => 'mixed[]', + 'food' => 'mixed[]', + 'retail' => 'mixed[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entertainment' => null, + 'grocery' => null, + 'service' => null, + 'casino' => null, + 'hospitality' => null, + 'food' => null, + 'retail' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'entertainment' => false, + 'grocery' => false, + 'service' => false, + 'casino' => false, + 'hospitality' => false, + 'food' => false, + 'retail' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entertainment' => 'entertainment', + 'grocery' => 'grocery', + 'service' => 'service', + 'casino' => 'casino', + 'hospitality' => 'hospitality', + 'food' => 'food', + 'retail' => 'retail' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entertainment' => 'setEntertainment', + 'grocery' => 'setGrocery', + 'service' => 'setService', + 'casino' => 'setCasino', + 'hospitality' => 'setHospitality', + 'food' => 'setFood', + 'retail' => 'setRetail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entertainment' => 'getEntertainment', + 'grocery' => 'getGrocery', + 'service' => 'getService', + 'casino' => 'getCasino', + 'hospitality' => 'getHospitality', + 'food' => 'getFood', + 'retail' => 'getRetail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('entertainment', $data ?? [], null); + $this->setIfExists('grocery', $data ?? [], null); + $this->setIfExists('service', $data ?? [], null); + $this->setIfExists('casino', $data ?? [], null); + $this->setIfExists('hospitality', $data ?? [], null); + $this->setIfExists('food', $data ?? [], null); + $this->setIfExists('retail', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['entertainment'] === null) { + $invalidProperties[] = "'entertainment' can't be null"; + } + if ($this->container['grocery'] === null) { + $invalidProperties[] = "'grocery' can't be null"; + } + if ($this->container['service'] === null) { + $invalidProperties[] = "'service' can't be null"; + } + if ($this->container['casino'] === null) { + $invalidProperties[] = "'casino' can't be null"; + } + if ($this->container['hospitality'] === null) { + $invalidProperties[] = "'hospitality' can't be null"; + } + if ($this->container['food'] === null) { + $invalidProperties[] = "'food' can't be null"; + } + if ($this->container['retail'] === null) { + $invalidProperties[] = "'retail' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets entertainment + * + * @return mixed[] + */ + public function getEntertainment() + { + return $this->container['entertainment']; + } + + /** + * Sets entertainment + * + * @param mixed[] $entertainment entertainment + * + * @return self + */ + public function setEntertainment($entertainment) + { + if (is_null($entertainment)) { + throw new \InvalidArgumentException('non-nullable entertainment cannot be null'); + } + $this->container['entertainment'] = $entertainment; + + return $this; + } + + /** + * Gets grocery + * + * @return mixed[] + */ + public function getGrocery() + { + return $this->container['grocery']; + } + + /** + * Sets grocery + * + * @param mixed[] $grocery grocery + * + * @return self + */ + public function setGrocery($grocery) + { + if (is_null($grocery)) { + throw new \InvalidArgumentException('non-nullable grocery cannot be null'); + } + $this->container['grocery'] = $grocery; + + return $this; + } + + /** + * Gets service + * + * @return mixed[] + */ + public function getService() + { + return $this->container['service']; + } + + /** + * Sets service + * + * @param mixed[] $service service + * + * @return self + */ + public function setService($service) + { + if (is_null($service)) { + throw new \InvalidArgumentException('non-nullable service cannot be null'); + } + $this->container['service'] = $service; + + return $this; + } + + /** + * Gets casino + * + * @return mixed[] + */ + public function getCasino() + { + return $this->container['casino']; + } + + /** + * Sets casino + * + * @param mixed[] $casino casino + * + * @return self + */ + public function setCasino($casino) + { + if (is_null($casino)) { + throw new \InvalidArgumentException('non-nullable casino cannot be null'); + } + $this->container['casino'] = $casino; + + return $this; + } + + /** + * Gets hospitality + * + * @return mixed[] + */ + public function getHospitality() + { + return $this->container['hospitality']; + } + + /** + * Sets hospitality + * + * @param mixed[] $hospitality hospitality + * + * @return self + */ + public function setHospitality($hospitality) + { + if (is_null($hospitality)) { + throw new \InvalidArgumentException('non-nullable hospitality cannot be null'); + } + $this->container['hospitality'] = $hospitality; + + return $this; + } + + /** + * Gets food + * + * @return mixed[] + */ + public function getFood() + { + return $this->container['food']; + } + + /** + * Sets food + * + * @param mixed[] $food food + * + * @return self + */ + public function setFood($food) + { + if (is_null($food)) { + throw new \InvalidArgumentException('non-nullable food cannot be null'); + } + $this->container['food'] = $food; + + return $this; + } + + /** + * Gets retail + * + * @return mixed[] + */ + public function getRetail() + { + return $this->container['retail']; + } + + /** + * Sets retail + * + * @param mixed[] $retail retail + * + * @return self + */ + public function setRetail($retail) + { + if (is_null($retail)) { + throw new \InvalidArgumentException('non-nullable retail cannot be null'); + } + $this->container['retail'] = $retail; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchImportedListRecipientsByPage200Response.php b/lib/Model/FetchImportedListRecipientsByPage200Response.php new file mode 100644 index 0000000..29a8459 --- /dev/null +++ b/lib/Model/FetchImportedListRecipientsByPage200Response.php @@ -0,0 +1,487 @@ + + */ +class FetchImportedListRecipientsByPage200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchImportedListRecipientsByPage_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'total' => 'float', + 'length' => 'float', + 'results' => '\OpenAPI\Client\Model\ImportedListRecipient[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'total' => 'double', + 'length' => 'double', + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'total' => false, + 'length' => false, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'total' => 'total', + 'length' => 'length', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'total' => 'setTotal', + 'length' => 'setLength', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'total' => 'getTotal', + 'length' => 'getLength', + 'results' => 'getResults' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } + if ($this->container['length'] === null) { + $invalidProperties[] = "'length' can't be null"; + } + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets total + * + * @return float + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float $total total + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets length + * + * @return float + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param float $length length + * + * @return self + */ + public function setLength($length) + { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\ImportedListRecipient[] + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\ImportedListRecipient[] $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchInboundSMSByPage200Response.php b/lib/Model/FetchInboundSMSByPage200Response.php new file mode 100644 index 0000000..e10bede --- /dev/null +++ b/lib/Model/FetchInboundSMSByPage200Response.php @@ -0,0 +1,487 @@ + + */ +class FetchInboundSMSByPage200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchInboundSMSByPage_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'total' => 'float', + 'length' => 'float', + 'results' => '\OpenAPI\Client\Model\InboundSMS[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'total' => 'double', + 'length' => 'double', + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'total' => false, + 'length' => false, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'total' => 'total', + 'length' => 'length', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'total' => 'setTotal', + 'length' => 'setLength', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'total' => 'getTotal', + 'length' => 'getLength', + 'results' => 'getResults' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } + if ($this->container['length'] === null) { + $invalidProperties[] = "'length' can't be null"; + } + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets total + * + * @return float + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float $total total + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets length + * + * @return float + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param float $length length + * + * @return self + */ + public function setLength($length) + { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\InboundSMS[] + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\InboundSMS[] $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchIndustry200Response.php b/lib/Model/FetchIndustry200Response.php new file mode 100644 index 0000000..958704a --- /dev/null +++ b/lib/Model/FetchIndustry200Response.php @@ -0,0 +1,561 @@ + + */ +class FetchIndustry200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchIndustry_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'plans' => '\OpenAPI\Client\Model\SubscriptionPlan[]', + 'title' => 'string', + 'icon' => 'string', + 'sort_number' => 'string', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'plans' => null, + 'title' => null, + 'icon' => null, + 'sort_number' => null, + 'id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'plans' => false, + 'title' => false, + 'icon' => false, + 'sort_number' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plans' => 'plans', + 'title' => 'title', + 'icon' => 'icon', + 'sort_number' => 'sortNumber', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plans' => 'setPlans', + 'title' => 'setTitle', + 'icon' => 'setIcon', + 'sort_number' => 'setSortNumber', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plans' => 'getPlans', + 'title' => 'getTitle', + 'icon' => 'getIcon', + 'sort_number' => 'getSortNumber', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('plans', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('sort_number', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['plans'] === null) { + $invalidProperties[] = "'plans' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['icon'] === null) { + $invalidProperties[] = "'icon' can't be null"; + } + if ($this->container['sort_number'] === null) { + $invalidProperties[] = "'sort_number' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets plans + * + * @return \OpenAPI\Client\Model\SubscriptionPlan[] + */ + public function getPlans() + { + return $this->container['plans']; + } + + /** + * Sets plans + * + * @param \OpenAPI\Client\Model\SubscriptionPlan[] $plans plans + * + * @return self + */ + public function setPlans($plans) + { + if (is_null($plans)) { + throw new \InvalidArgumentException('non-nullable plans cannot be null'); + } + $this->container['plans'] = $plans; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets icon + * + * @return string + */ + public function getIcon() + { + return $this->container['icon']; + } + + /** + * Sets icon + * + * @param string $icon icon + * + * @return self + */ + public function setIcon($icon) + { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } + $this->container['icon'] = $icon; + + return $this; + } + + /** + * Gets sort_number + * + * @return string + */ + public function getSortNumber() + { + return $this->container['sort_number']; + } + + /** + * Sets sort_number + * + * @param string $sort_number sort_number + * + * @return self + */ + public function setSortNumber($sort_number) + { + if (is_null($sort_number)) { + throw new \InvalidArgumentException('non-nullable sort_number cannot be null'); + } + $this->container['sort_number'] = $sort_number; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchMembersCount200Response.php b/lib/Model/FetchMembersCount200Response.php new file mode 100644 index 0000000..5b762a5 --- /dev/null +++ b/lib/Model/FetchMembersCount200Response.php @@ -0,0 +1,413 @@ + + */ +class FetchMembersCount200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchMembersCount_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets count + * + * @return float + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param float $count count + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchOptInListSubscribersByPage200Response.php b/lib/Model/FetchOptInListSubscribersByPage200Response.php new file mode 100644 index 0000000..a2b7eeb --- /dev/null +++ b/lib/Model/FetchOptInListSubscribersByPage200Response.php @@ -0,0 +1,487 @@ + + */ +class FetchOptInListSubscribersByPage200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchOptInListSubscribersByPage_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'total' => 'float', + 'length' => 'float', + 'results' => '\OpenAPI\Client\Model\OptInListSubscriber[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'total' => 'double', + 'length' => 'double', + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'total' => false, + 'length' => false, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'total' => 'total', + 'length' => 'length', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'total' => 'setTotal', + 'length' => 'setLength', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'total' => 'getTotal', + 'length' => 'getLength', + 'results' => 'getResults' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } + if ($this->container['length'] === null) { + $invalidProperties[] = "'length' can't be null"; + } + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets total + * + * @return float + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float $total total + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets length + * + * @return float + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param float $length length + * + * @return self + */ + public function setLength($length) + { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\OptInListSubscriber[] + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\OptInListSubscriber[] $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchOutboundSMSByPage200Response.php b/lib/Model/FetchOutboundSMSByPage200Response.php new file mode 100644 index 0000000..48f996d --- /dev/null +++ b/lib/Model/FetchOutboundSMSByPage200Response.php @@ -0,0 +1,487 @@ + + */ +class FetchOutboundSMSByPage200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchOutboundSMSByPage_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'total' => 'float', + 'length' => 'float', + 'results' => '\OpenAPI\Client\Model\OutboundSMS[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'total' => 'double', + 'length' => 'double', + 'results' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'total' => false, + 'length' => false, + 'results' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'total' => 'total', + 'length' => 'length', + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'total' => 'setTotal', + 'length' => 'setLength', + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'total' => 'getTotal', + 'length' => 'getLength', + 'results' => 'getResults' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('results', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } + if ($this->container['length'] === null) { + $invalidProperties[] = "'length' can't be null"; + } + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets total + * + * @return float + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param float $total total + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets length + * + * @return float + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param float $length length + * + * @return self + */ + public function setLength($length) + { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets results + * + * @return \OpenAPI\Client\Model\OutboundSMS[] + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \OpenAPI\Client\Model\OutboundSMS[] $results results + * + * @return self + */ + public function setResults($results) + { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchPerformanceTicketsPage200Response.php b/lib/Model/FetchPerformanceTicketsPage200Response.php new file mode 100644 index 0000000..e448e67 --- /dev/null +++ b/lib/Model/FetchPerformanceTicketsPage200Response.php @@ -0,0 +1,450 @@ + + */ +class FetchPerformanceTicketsPage200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchPerformanceTicketsPage_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\OpenAPI\Client\Model\WTTicket[]', + 'total_rows' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'total_rows' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false, + 'total_rows' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'total_rows' => 'totalRows' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'total_rows' => 'setTotalRows' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'total_rows' => 'getTotalRows' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('total_rows', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['total_rows'] === null) { + $invalidProperties[] = "'total_rows' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\WTTicket[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\WTTicket[] $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets total_rows + * + * @return float + */ + public function getTotalRows() + { + return $this->container['total_rows']; + } + + /** + * Sets total_rows + * + * @param float $total_rows total_rows + * + * @return self + */ + public function setTotalRows($total_rows) + { + if (is_null($total_rows)) { + throw new \InvalidArgumentException('non-nullable total_rows cannot be null'); + } + $this->container['total_rows'] = $total_rows; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FetchStaticVouchersPage200Response.php b/lib/Model/FetchStaticVouchersPage200Response.php new file mode 100644 index 0000000..bd86111 --- /dev/null +++ b/lib/Model/FetchStaticVouchersPage200Response.php @@ -0,0 +1,450 @@ + + */ +class FetchStaticVouchersPage200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'fetchStaticVouchersPage_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\OpenAPI\Client\Model\WTStaticVoucher[]', + 'total_rows' => 'float' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null, + 'total_rows' => 'double' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'data' => false, + 'total_rows' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'data' => 'data', + 'total_rows' => 'totalRows' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData', + 'total_rows' => 'setTotalRows' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData', + 'total_rows' => 'getTotalRows' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('total_rows', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['total_rows'] === null) { + $invalidProperties[] = "'total_rows' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets data + * + * @return \OpenAPI\Client\Model\WTStaticVoucher[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \OpenAPI\Client\Model\WTStaticVoucher[] $data data + * + * @return self + */ + public function setData($data) + { + if (is_null($data)) { + throw new \InvalidArgumentException('non-nullable data cannot be null'); + } + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets total_rows + * + * @return float + */ + public function getTotalRows() + { + return $this->container['total_rows']; + } + + /** + * Sets total_rows + * + * @param float $total_rows total_rows + * + * @return self + */ + public function setTotalRows($total_rows) + { + if (is_null($total_rows)) { + throw new \InvalidArgumentException('non-nullable total_rows cannot be null'); + } + $this->container['total_rows'] = $total_rows; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ForbiddenRequest.php b/lib/Model/ForbiddenRequest.php index 580c55d..7b5d526 100644 --- a/lib/Model/ForbiddenRequest.php +++ b/lib/Model/ForbiddenRequest.php @@ -2,7 +2,7 @@ /** * ForbiddenRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ForbiddenRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class ForbiddenRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => 'string', 'message' => 'string', 'stack' => 'string', - 'http_error_code' => 'double', + 'http_error_code' => 'float', 'tracking_code' => 'string' ]; @@ -82,6 +80,26 @@ class ForbiddenRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'tracking_code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'stack' => false, + 'http_error_code' => false, + 'tracking_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['stack'] = $data['stack'] ?? null; - $this->container['http_error_code'] = $data['http_error_code'] ?? null; - $this->container['tracking_code'] = $data['tracking_code'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('stack', $data ?? [], null); + $this->setIfExists('http_error_code', $data ?? [], null); + $this->setIfExists('tracking_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -261,6 +349,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -285,6 +376,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -309,6 +403,9 @@ public function getStack() */ public function setStack($stack) { + if (is_null($stack)) { + throw new \InvalidArgumentException('non-nullable stack cannot be null'); + } $this->container['stack'] = $stack; return $this; @@ -317,7 +414,7 @@ public function setStack($stack) /** * Gets http_error_code * - * @return double + * @return float */ public function getHttpErrorCode() { @@ -327,12 +424,15 @@ public function getHttpErrorCode() /** * Sets http_error_code * - * @param double $http_error_code http_error_code + * @param float $http_error_code http_error_code * * @return self */ public function setHttpErrorCode($http_error_code) { + if (is_null($http_error_code)) { + throw new \InvalidArgumentException('non-nullable http_error_code cannot be null'); + } $this->container['http_error_code'] = $http_error_code; return $this; @@ -357,6 +457,9 @@ public function getTrackingCode() */ public function setTrackingCode($tracking_code) { + if (is_null($tracking_code)) { + throw new \InvalidArgumentException('non-nullable tracking_code cannot be null'); + } $this->container['tracking_code'] = $tracking_code; return $this; @@ -368,7 +471,7 @@ public function setTrackingCode($tracking_code) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -380,6 +483,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -393,7 +497,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -409,7 +513,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -421,6 +525,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ForeignKeyDoesNotExist.php b/lib/Model/ForeignKeyDoesNotExist.php index 4ee6ac6..d1a7b6f 100644 --- a/lib/Model/ForeignKeyDoesNotExist.php +++ b/lib/Model/ForeignKeyDoesNotExist.php @@ -2,7 +2,7 @@ /** * ForeignKeyDoesNotExist * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ForeignKeyDoesNotExist implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class ForeignKeyDoesNotExist implements ModelInterface, ArrayAccess, \JsonSerial 'name' => 'string', 'message' => 'string', 'stack' => 'string', - 'http_error_code' => 'double', + 'http_error_code' => 'float', 'tracking_code' => 'string' ]; @@ -82,6 +80,26 @@ class ForeignKeyDoesNotExist implements ModelInterface, ArrayAccess, \JsonSerial 'tracking_code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'stack' => false, + 'http_error_code' => false, + 'tracking_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['stack'] = $data['stack'] ?? null; - $this->container['http_error_code'] = $data['http_error_code'] ?? null; - $this->container['tracking_code'] = $data['tracking_code'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('stack', $data ?? [], null); + $this->setIfExists('http_error_code', $data ?? [], null); + $this->setIfExists('tracking_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -261,6 +349,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -285,6 +376,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -309,6 +403,9 @@ public function getStack() */ public function setStack($stack) { + if (is_null($stack)) { + throw new \InvalidArgumentException('non-nullable stack cannot be null'); + } $this->container['stack'] = $stack; return $this; @@ -317,7 +414,7 @@ public function setStack($stack) /** * Gets http_error_code * - * @return double + * @return float */ public function getHttpErrorCode() { @@ -327,12 +424,15 @@ public function getHttpErrorCode() /** * Sets http_error_code * - * @param double $http_error_code http_error_code + * @param float $http_error_code http_error_code * * @return self */ public function setHttpErrorCode($http_error_code) { + if (is_null($http_error_code)) { + throw new \InvalidArgumentException('non-nullable http_error_code cannot be null'); + } $this->container['http_error_code'] = $http_error_code; return $this; @@ -357,6 +457,9 @@ public function getTrackingCode() */ public function setTrackingCode($tracking_code) { + if (is_null($tracking_code)) { + throw new \InvalidArgumentException('non-nullable tracking_code cannot be null'); + } $this->container['tracking_code'] = $tracking_code; return $this; @@ -368,7 +471,7 @@ public function setTrackingCode($tracking_code) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -380,6 +483,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -393,7 +497,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -409,7 +513,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -421,6 +525,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Gaming.php b/lib/Model/Gaming.php index a14c8db..4a4167d 100644 --- a/lib/Model/Gaming.php +++ b/lib/Model/Gaming.php @@ -2,7 +2,7 @@ /** * Gaming * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Gaming implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -66,7 +64,7 @@ class Gaming implements ModelInterface, ArrayAccess, \JsonSerializable 'order_number' => 'int', 'media_url' => 'string', 'additional_info_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -94,6 +92,32 @@ class Gaming implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -229,17 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -333,6 +427,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling Gaming., must be bigger than or equal to 1.'); @@ -362,6 +459,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling Gaming., must be bigger than or equal to 1.'); @@ -391,6 +491,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -415,6 +518,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling Gaming., must be bigger than or equal to 1.'); @@ -444,6 +550,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -468,6 +577,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -476,7 +588,7 @@ public function setAdditionalInfoUrl($additional_info_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -486,12 +598,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -516,6 +631,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -540,6 +658,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -564,6 +685,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -588,14 +712,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Gaming., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Gaming., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Gaming., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Gaming., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -609,7 +736,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -621,6 +748,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -634,7 +762,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -650,7 +778,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -662,6 +790,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/HelpDeskRequest.php b/lib/Model/HelpDeskRequest.php index 3349511..38f095d 100644 --- a/lib/Model/HelpDeskRequest.php +++ b/lib/Model/HelpDeskRequest.php @@ -2,7 +2,7 @@ /** * HelpDeskRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class HelpDeskRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class HelpDeskRequest implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'merchant_phone_number_id' => 'string', 'cell_phone' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -92,6 +90,31 @@ class HelpDeskRequest implements ModelInterface, ArrayAccess, \JsonSerializable 'resolved_at' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'merchant_phone_number_id' => false, + 'cell_phone' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'employee_id' => false, + 'is_resolved' => false, + 'resolved_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['merchant_phone_number_id'] = $data['merchant_phone_number_id'] ?? null; - $this->container['cell_phone'] = $data['cell_phone'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['is_resolved'] = $data['is_resolved'] ?? null; - $this->container['resolved_at'] = $data['resolved_at'] ?? null; + $this->setIfExists('merchant_phone_number_id', $data ?? [], null); + $this->setIfExists('cell_phone', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('is_resolved', $data ?? [], null); + $this->setIfExists('resolved_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -266,14 +359,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -350,14 +435,17 @@ public function getMerchantPhoneNumberId() */ public function setMerchantPhoneNumberId($merchant_phone_number_id) { + if (is_null($merchant_phone_number_id)) { + throw new \InvalidArgumentException('non-nullable merchant_phone_number_id cannot be null'); + } if ((mb_strlen($merchant_phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_phone_number_id when calling HelpDeskRequest., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_phone_number_id when calling HelpDeskRequest., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_phone_number_id when calling HelpDeskRequest., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_phone_number_id when calling HelpDeskRequest., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_phone_number_id'] = $merchant_phone_number_id; @@ -384,6 +472,9 @@ public function getCellPhone() */ public function setCellPhone($cell_phone) { + if (is_null($cell_phone)) { + throw new \InvalidArgumentException('non-nullable cell_phone cannot be null'); + } $this->container['cell_phone'] = $cell_phone; return $this; @@ -392,7 +483,7 @@ public function setCellPhone($cell_phone) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -402,19 +493,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling HelpDeskRequest., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling HelpDeskRequest., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -439,14 +526,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling HelpDeskRequest., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling HelpDeskRequest., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling HelpDeskRequest., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling HelpDeskRequest., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -473,6 +563,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -497,6 +590,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -521,6 +617,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -545,14 +644,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling HelpDeskRequest., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling HelpDeskRequest., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling HelpDeskRequest., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling HelpDeskRequest., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -579,6 +681,9 @@ public function getIsResolved() */ public function setIsResolved($is_resolved) { + if (is_null($is_resolved)) { + throw new \InvalidArgumentException('non-nullable is_resolved cannot be null'); + } $this->container['is_resolved'] = $is_resolved; return $this; @@ -603,6 +708,9 @@ public function getResolvedAt() */ public function setResolvedAt($resolved_at) { + if (is_null($resolved_at)) { + throw new \InvalidArgumentException('non-nullable resolved_at cannot be null'); + } $this->container['resolved_at'] = $resolved_at; return $this; @@ -614,7 +722,7 @@ public function setResolvedAt($resolved_at) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -626,6 +734,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -639,7 +748,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -655,7 +764,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -667,6 +776,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ImageGrid.php b/lib/Model/ImageGrid.php index 890fcb9..86ba857 100644 --- a/lib/Model/ImageGrid.php +++ b/lib/Model/ImageGrid.php @@ -2,7 +2,7 @@ /** * ImageGrid * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ImageGrid implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -65,7 +63,7 @@ class ImageGrid implements ModelInterface, ArrayAccess, \JsonSerializable 'media_url' => 'string', 'sequence_number' => 'int', 'is_pinned' => 'bool', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -92,6 +90,31 @@ class ImageGrid implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'url' => false, + 'media_url' => false, + 'sequence_number' => false, + 'is_pinned' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['sequence_number'] = $data['sequence_number'] ?? null; - $this->container['is_pinned'] = $data['is_pinned'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('sequence_number', $data ?? [], null); + $this->setIfExists('is_pinned', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -334,6 +427,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling ImageGrid., must be bigger than or equal to 1.'); @@ -363,6 +459,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } if ((mb_strlen($url) < 1)) { throw new \InvalidArgumentException('invalid length for $url when calling ImageGrid., must be bigger than or equal to 1.'); @@ -392,6 +491,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } if ((mb_strlen($media_url) < 1)) { throw new \InvalidArgumentException('invalid length for $media_url when calling ImageGrid., must be bigger than or equal to 1.'); @@ -421,6 +523,9 @@ public function getSequenceNumber() */ public function setSequenceNumber($sequence_number) { + if (is_null($sequence_number)) { + throw new \InvalidArgumentException('non-nullable sequence_number cannot be null'); + } if (($sequence_number < 1)) { throw new \InvalidArgumentException('invalid value for $sequence_number when calling ImageGrid., must be bigger than or equal to 1.'); @@ -450,6 +555,9 @@ public function getIsPinned() */ public function setIsPinned($is_pinned) { + if (is_null($is_pinned)) { + throw new \InvalidArgumentException('non-nullable is_pinned cannot be null'); + } $this->container['is_pinned'] = $is_pinned; return $this; @@ -458,7 +566,7 @@ public function setIsPinned($is_pinned) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -468,12 +576,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -498,6 +609,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -522,6 +636,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -546,6 +663,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -570,14 +690,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling ImageGrid., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling ImageGrid., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling ImageGrid., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling ImageGrid., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -591,7 +714,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -603,6 +726,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -616,7 +740,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -632,7 +756,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -644,6 +768,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ImportTicketsRequest.php b/lib/Model/ImportTicketsRequest.php new file mode 100644 index 0000000..47186fe --- /dev/null +++ b/lib/Model/ImportTicketsRequest.php @@ -0,0 +1,413 @@ + + */ +class ImportTicketsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'importTickets_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'tickets' => '\OpenAPI\Client\Model\WTTicketUpdateParams[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'tickets' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tickets' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'tickets' => 'tickets' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'tickets' => 'setTickets' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'tickets' => 'getTickets' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('tickets', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['tickets'] === null) { + $invalidProperties[] = "'tickets' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets tickets + * + * @return \OpenAPI\Client\Model\WTTicketUpdateParams[] + */ + public function getTickets() + { + return $this->container['tickets']; + } + + /** + * Sets tickets + * + * @param \OpenAPI\Client\Model\WTTicketUpdateParams[] $tickets tickets + * + * @return self + */ + public function setTickets($tickets) + { + if (is_null($tickets)) { + throw new \InvalidArgumentException('non-nullable tickets cannot be null'); + } + $this->container['tickets'] = $tickets; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ImportedList.php b/lib/Model/ImportedList.php index 8d9c776..072bfeb 100644 --- a/lib/Model/ImportedList.php +++ b/lib/Model/ImportedList.php @@ -2,7 +2,7 @@ /** * ImportedList * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ImportedList implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class ImportedList implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => 'bool', 'list_name' => 'string', 'phone_number_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime' @@ -88,6 +86,29 @@ class ImportedList implements ModelInterface, ArrayAccess, \JsonSerializable 'updated_at' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false, + 'is_active' => false, + 'list_name' => false, + 'phone_number_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -214,14 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['list_name'] = $data['list_name'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('list_name', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -272,14 +363,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -335,14 +418,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling ImportedList., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling ImportedList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling ImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling ImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -369,6 +455,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -393,6 +482,9 @@ public function getListName() */ public function setListName($list_name) { + if (is_null($list_name)) { + throw new \InvalidArgumentException('non-nullable list_name cannot be null'); + } $this->container['list_name'] = $list_name; return $this; @@ -417,14 +509,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling ImportedList., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling ImportedList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling ImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling ImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -435,7 +530,7 @@ public function setPhoneNumberId($phone_number_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -445,19 +540,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling ImportedList., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling ImportedList., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -482,14 +573,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling ImportedList., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling ImportedList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling ImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling ImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -516,6 +610,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -540,6 +637,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -551,7 +651,7 @@ public function setUpdatedAt($updated_at) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -563,6 +663,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -576,7 +677,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -592,7 +693,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -604,6 +705,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ImportedListRecipient.php b/lib/Model/ImportedListRecipient.php index 3bd2fae..d651126 100644 --- a/lib/Model/ImportedListRecipient.php +++ b/lib/Model/ImportedListRecipient.php @@ -2,7 +2,7 @@ /** * ImportedListRecipient * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ImportedListRecipient implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class ImportedListRecipient implements ModelInterface, ArrayAccess, \JsonSeriali protected static $openAPITypes = [ 'imported_list_id' => 'string', 'mobile_phone_number' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -88,6 +86,29 @@ class ImportedListRecipient implements ModelInterface, ArrayAccess, \JsonSeriali 'opted_status' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'imported_list_id' => false, + 'mobile_phone_number' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'opted_status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -214,14 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['imported_list_id'] = $data['imported_list_id'] ?? null; - $this->container['mobile_phone_number'] = $data['mobile_phone_number'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['opted_status'] = $data['opted_status'] ?? null; + $this->setIfExists('imported_list_id', $data ?? [], null); + $this->setIfExists('mobile_phone_number', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('opted_status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -254,14 +345,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -320,14 +403,17 @@ public function getImportedListId() */ public function setImportedListId($imported_list_id) { + if (is_null($imported_list_id)) { + throw new \InvalidArgumentException('non-nullable imported_list_id cannot be null'); + } if ((mb_strlen($imported_list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $imported_list_id when calling ImportedListRecipient., must be smaller than or equal to 10.'); } if ((mb_strlen($imported_list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $imported_list_id when calling ImportedListRecipient., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $imported_list_id))) { - throw new \InvalidArgumentException("invalid value for $imported_list_id when calling ImportedListRecipient., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($imported_list_id)))) { + throw new \InvalidArgumentException("invalid value for \$imported_list_id when calling ImportedListRecipient., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['imported_list_id'] = $imported_list_id; @@ -354,6 +440,9 @@ public function getMobilePhoneNumber() */ public function setMobilePhoneNumber($mobile_phone_number) { + if (is_null($mobile_phone_number)) { + throw new \InvalidArgumentException('non-nullable mobile_phone_number cannot be null'); + } $this->container['mobile_phone_number'] = $mobile_phone_number; return $this; @@ -362,7 +451,7 @@ public function setMobilePhoneNumber($mobile_phone_number) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -372,19 +461,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling ImportedListRecipient., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling ImportedListRecipient., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -409,14 +494,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling ImportedListRecipient., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling ImportedListRecipient., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling ImportedListRecipient., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling ImportedListRecipient., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -443,6 +531,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -467,6 +558,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -491,6 +585,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -515,6 +612,9 @@ public function getOptedStatus() */ public function setOptedStatus($opted_status) { + if (is_null($opted_status)) { + throw new \InvalidArgumentException('non-nullable opted_status cannot be null'); + } $this->container['opted_status'] = $opted_status; return $this; @@ -526,7 +626,7 @@ public function setOptedStatus($opted_status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -538,6 +638,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -551,7 +652,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -567,7 +668,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -579,6 +680,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/InboundSMS.php b/lib/Model/InboundSMS.php index 75ff672..500a149 100644 --- a/lib/Model/InboundSMS.php +++ b/lib/Model/InboundSMS.php @@ -2,7 +2,7 @@ /** * InboundSMS * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class InboundSMS implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class InboundSMS implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'automated_reply' => 'string', 'automated_reply_additional_info' => 'string', 'sms_sid' => 'string', @@ -144,6 +142,57 @@ class InboundSMS implements ModelInterface, ArrayAccess, \JsonSerializable 'from_localized' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'automated_reply' => false, + 'automated_reply_additional_info' => false, + 'sms_sid' => false, + 'sms_message_sid' => false, + 'sms_status' => false, + 'messaging_service_sid' => false, + 'account_sid' => false, + 'message_sid' => false, + 'body' => false, + 'num_segments' => false, + 'to' => false, + 'to_city' => false, + 'to_state' => false, + 'to_zip' => false, + 'to_country' => false, + 'from' => false, + 'from_city' => false, + 'from_state' => false, + 'from_zip' => false, + 'from_country' => false, + 'media_urls' => false, + 'watson_intent' => false, + 'watson_intents' => false, + 'watson_context' => false, + 'watson_contexts' => false, + 'num_media' => false, + 'api_version' => false, + 'is_opt_in' => false, + 'is_help_desk_request' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'body_lowercase' => false, + 'from_localized' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -164,6 +213,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -354,42 +455,60 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['automated_reply'] = $data['automated_reply'] ?? null; - $this->container['automated_reply_additional_info'] = $data['automated_reply_additional_info'] ?? null; - $this->container['sms_sid'] = $data['sms_sid'] ?? null; - $this->container['sms_message_sid'] = $data['sms_message_sid'] ?? null; - $this->container['sms_status'] = $data['sms_status'] ?? null; - $this->container['messaging_service_sid'] = $data['messaging_service_sid'] ?? null; - $this->container['account_sid'] = $data['account_sid'] ?? null; - $this->container['message_sid'] = $data['message_sid'] ?? null; - $this->container['body'] = $data['body'] ?? null; - $this->container['num_segments'] = $data['num_segments'] ?? null; - $this->container['to'] = $data['to'] ?? null; - $this->container['to_city'] = $data['to_city'] ?? null; - $this->container['to_state'] = $data['to_state'] ?? null; - $this->container['to_zip'] = $data['to_zip'] ?? null; - $this->container['to_country'] = $data['to_country'] ?? null; - $this->container['from'] = $data['from'] ?? null; - $this->container['from_city'] = $data['from_city'] ?? null; - $this->container['from_state'] = $data['from_state'] ?? null; - $this->container['from_zip'] = $data['from_zip'] ?? null; - $this->container['from_country'] = $data['from_country'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; - $this->container['watson_intent'] = $data['watson_intent'] ?? null; - $this->container['watson_intents'] = $data['watson_intents'] ?? null; - $this->container['watson_context'] = $data['watson_context'] ?? null; - $this->container['watson_contexts'] = $data['watson_contexts'] ?? null; - $this->container['num_media'] = $data['num_media'] ?? null; - $this->container['api_version'] = $data['api_version'] ?? null; - $this->container['is_opt_in'] = $data['is_opt_in'] ?? null; - $this->container['is_help_desk_request'] = $data['is_help_desk_request'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['body_lowercase'] = $data['body_lowercase'] ?? null; - $this->container['from_localized'] = $data['from_localized'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('automated_reply', $data ?? [], null); + $this->setIfExists('automated_reply_additional_info', $data ?? [], null); + $this->setIfExists('sms_sid', $data ?? [], null); + $this->setIfExists('sms_message_sid', $data ?? [], null); + $this->setIfExists('sms_status', $data ?? [], null); + $this->setIfExists('messaging_service_sid', $data ?? [], null); + $this->setIfExists('account_sid', $data ?? [], null); + $this->setIfExists('message_sid', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('num_segments', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('to_city', $data ?? [], null); + $this->setIfExists('to_state', $data ?? [], null); + $this->setIfExists('to_zip', $data ?? [], null); + $this->setIfExists('to_country', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('from_city', $data ?? [], null); + $this->setIfExists('from_state', $data ?? [], null); + $this->setIfExists('from_zip', $data ?? [], null); + $this->setIfExists('from_country', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + $this->setIfExists('watson_intent', $data ?? [], null); + $this->setIfExists('watson_intents', $data ?? [], null); + $this->setIfExists('watson_context', $data ?? [], null); + $this->setIfExists('watson_contexts', $data ?? [], null); + $this->setIfExists('num_media', $data ?? [], null); + $this->setIfExists('api_version', $data ?? [], null); + $this->setIfExists('is_opt_in', $data ?? [], null); + $this->setIfExists('is_help_desk_request', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('body_lowercase', $data ?? [], null); + $this->setIfExists('from_localized', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -404,14 +523,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['automated_reply'] === null) { $invalidProperties[] = "'automated_reply' can't be null"; } @@ -531,7 +642,7 @@ public function valid() /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -541,19 +652,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling InboundSMS., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling InboundSMS., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -578,6 +685,9 @@ public function getAutomatedReply() */ public function setAutomatedReply($automated_reply) { + if (is_null($automated_reply)) { + throw new \InvalidArgumentException('non-nullable automated_reply cannot be null'); + } $this->container['automated_reply'] = $automated_reply; return $this; @@ -602,6 +712,9 @@ public function getAutomatedReplyAdditionalInfo() */ public function setAutomatedReplyAdditionalInfo($automated_reply_additional_info) { + if (is_null($automated_reply_additional_info)) { + throw new \InvalidArgumentException('non-nullable automated_reply_additional_info cannot be null'); + } $this->container['automated_reply_additional_info'] = $automated_reply_additional_info; return $this; @@ -626,6 +739,9 @@ public function getSmsSid() */ public function setSmsSid($sms_sid) { + if (is_null($sms_sid)) { + throw new \InvalidArgumentException('non-nullable sms_sid cannot be null'); + } $this->container['sms_sid'] = $sms_sid; return $this; @@ -650,6 +766,9 @@ public function getSmsMessageSid() */ public function setSmsMessageSid($sms_message_sid) { + if (is_null($sms_message_sid)) { + throw new \InvalidArgumentException('non-nullable sms_message_sid cannot be null'); + } $this->container['sms_message_sid'] = $sms_message_sid; return $this; @@ -674,6 +793,9 @@ public function getSmsStatus() */ public function setSmsStatus($sms_status) { + if (is_null($sms_status)) { + throw new \InvalidArgumentException('non-nullable sms_status cannot be null'); + } $this->container['sms_status'] = $sms_status; return $this; @@ -698,6 +820,9 @@ public function getMessagingServiceSid() */ public function setMessagingServiceSid($messaging_service_sid) { + if (is_null($messaging_service_sid)) { + throw new \InvalidArgumentException('non-nullable messaging_service_sid cannot be null'); + } $this->container['messaging_service_sid'] = $messaging_service_sid; return $this; @@ -722,6 +847,9 @@ public function getAccountSid() */ public function setAccountSid($account_sid) { + if (is_null($account_sid)) { + throw new \InvalidArgumentException('non-nullable account_sid cannot be null'); + } $this->container['account_sid'] = $account_sid; return $this; @@ -746,6 +874,9 @@ public function getMessageSid() */ public function setMessageSid($message_sid) { + if (is_null($message_sid)) { + throw new \InvalidArgumentException('non-nullable message_sid cannot be null'); + } $this->container['message_sid'] = $message_sid; return $this; @@ -770,6 +901,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } $this->container['body'] = $body; return $this; @@ -794,6 +928,9 @@ public function getNumSegments() */ public function setNumSegments($num_segments) { + if (is_null($num_segments)) { + throw new \InvalidArgumentException('non-nullable num_segments cannot be null'); + } if (($num_segments < 0)) { throw new \InvalidArgumentException('invalid value for $num_segments when calling InboundSMS., must be bigger than or equal to 0.'); @@ -823,6 +960,9 @@ public function getTo() */ public function setTo($to) { + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } $this->container['to'] = $to; return $this; @@ -847,6 +987,9 @@ public function getToCity() */ public function setToCity($to_city) { + if (is_null($to_city)) { + throw new \InvalidArgumentException('non-nullable to_city cannot be null'); + } $this->container['to_city'] = $to_city; return $this; @@ -871,6 +1014,9 @@ public function getToState() */ public function setToState($to_state) { + if (is_null($to_state)) { + throw new \InvalidArgumentException('non-nullable to_state cannot be null'); + } $this->container['to_state'] = $to_state; return $this; @@ -895,6 +1041,9 @@ public function getToZip() */ public function setToZip($to_zip) { + if (is_null($to_zip)) { + throw new \InvalidArgumentException('non-nullable to_zip cannot be null'); + } $this->container['to_zip'] = $to_zip; return $this; @@ -919,6 +1068,9 @@ public function getToCountry() */ public function setToCountry($to_country) { + if (is_null($to_country)) { + throw new \InvalidArgumentException('non-nullable to_country cannot be null'); + } $this->container['to_country'] = $to_country; return $this; @@ -943,6 +1095,9 @@ public function getFrom() */ public function setFrom($from) { + if (is_null($from)) { + throw new \InvalidArgumentException('non-nullable from cannot be null'); + } $this->container['from'] = $from; return $this; @@ -967,6 +1122,9 @@ public function getFromCity() */ public function setFromCity($from_city) { + if (is_null($from_city)) { + throw new \InvalidArgumentException('non-nullable from_city cannot be null'); + } $this->container['from_city'] = $from_city; return $this; @@ -991,6 +1149,9 @@ public function getFromState() */ public function setFromState($from_state) { + if (is_null($from_state)) { + throw new \InvalidArgumentException('non-nullable from_state cannot be null'); + } $this->container['from_state'] = $from_state; return $this; @@ -1015,6 +1176,9 @@ public function getFromZip() */ public function setFromZip($from_zip) { + if (is_null($from_zip)) { + throw new \InvalidArgumentException('non-nullable from_zip cannot be null'); + } $this->container['from_zip'] = $from_zip; return $this; @@ -1039,6 +1203,9 @@ public function getFromCountry() */ public function setFromCountry($from_country) { + if (is_null($from_country)) { + throw new \InvalidArgumentException('non-nullable from_country cannot be null'); + } $this->container['from_country'] = $from_country; return $this; @@ -1063,6 +1230,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -1087,6 +1257,9 @@ public function getWatsonIntent() */ public function setWatsonIntent($watson_intent) { + if (is_null($watson_intent)) { + throw new \InvalidArgumentException('non-nullable watson_intent cannot be null'); + } $this->container['watson_intent'] = $watson_intent; return $this; @@ -1111,6 +1284,9 @@ public function getWatsonIntents() */ public function setWatsonIntents($watson_intents) { + if (is_null($watson_intents)) { + throw new \InvalidArgumentException('non-nullable watson_intents cannot be null'); + } $this->container['watson_intents'] = $watson_intents; return $this; @@ -1135,6 +1311,9 @@ public function getWatsonContext() */ public function setWatsonContext($watson_context) { + if (is_null($watson_context)) { + throw new \InvalidArgumentException('non-nullable watson_context cannot be null'); + } $this->container['watson_context'] = $watson_context; return $this; @@ -1159,6 +1338,9 @@ public function getWatsonContexts() */ public function setWatsonContexts($watson_contexts) { + if (is_null($watson_contexts)) { + throw new \InvalidArgumentException('non-nullable watson_contexts cannot be null'); + } $this->container['watson_contexts'] = $watson_contexts; return $this; @@ -1183,6 +1365,9 @@ public function getNumMedia() */ public function setNumMedia($num_media) { + if (is_null($num_media)) { + throw new \InvalidArgumentException('non-nullable num_media cannot be null'); + } if (($num_media < 0)) { throw new \InvalidArgumentException('invalid value for $num_media when calling InboundSMS., must be bigger than or equal to 0.'); @@ -1212,6 +1397,9 @@ public function getApiVersion() */ public function setApiVersion($api_version) { + if (is_null($api_version)) { + throw new \InvalidArgumentException('non-nullable api_version cannot be null'); + } $this->container['api_version'] = $api_version; return $this; @@ -1236,6 +1424,9 @@ public function getIsOptIn() */ public function setIsOptIn($is_opt_in) { + if (is_null($is_opt_in)) { + throw new \InvalidArgumentException('non-nullable is_opt_in cannot be null'); + } $this->container['is_opt_in'] = $is_opt_in; return $this; @@ -1260,6 +1451,9 @@ public function getIsHelpDeskRequest() */ public function setIsHelpDeskRequest($is_help_desk_request) { + if (is_null($is_help_desk_request)) { + throw new \InvalidArgumentException('non-nullable is_help_desk_request cannot be null'); + } $this->container['is_help_desk_request'] = $is_help_desk_request; return $this; @@ -1284,14 +1478,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling InboundSMS., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling InboundSMS., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling InboundSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling InboundSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -1318,6 +1515,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -1342,6 +1542,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -1366,6 +1569,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -1390,6 +1596,9 @@ public function getBodyLowercase() */ public function setBodyLowercase($body_lowercase) { + if (is_null($body_lowercase)) { + throw new \InvalidArgumentException('non-nullable body_lowercase cannot be null'); + } $this->container['body_lowercase'] = $body_lowercase; return $this; @@ -1414,6 +1623,9 @@ public function getFromLocalized() */ public function setFromLocalized($from_localized) { + if (is_null($from_localized)) { + throw new \InvalidArgumentException('non-nullable from_localized cannot be null'); + } $this->container['from_localized'] = $from_localized; return $this; @@ -1425,7 +1637,7 @@ public function setFromLocalized($from_localized) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1437,6 +1649,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1450,7 +1663,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1466,7 +1679,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1478,6 +1691,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/InternalServerError.php b/lib/Model/InternalServerError.php index f200640..ed75719 100644 --- a/lib/Model/InternalServerError.php +++ b/lib/Model/InternalServerError.php @@ -2,7 +2,7 @@ /** * InternalServerError * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class InternalServerError implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class InternalServerError implements ModelInterface, ArrayAccess, \JsonSerializa 'name' => 'string', 'message' => 'string', 'stack' => 'string', - 'http_error_code' => 'double', + 'http_error_code' => 'float', 'tracking_code' => 'string' ]; @@ -82,6 +80,26 @@ class InternalServerError implements ModelInterface, ArrayAccess, \JsonSerializa 'tracking_code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'stack' => false, + 'http_error_code' => false, + 'tracking_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['stack'] = $data['stack'] ?? null; - $this->container['http_error_code'] = $data['http_error_code'] ?? null; - $this->container['tracking_code'] = $data['tracking_code'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('stack', $data ?? [], null); + $this->setIfExists('http_error_code', $data ?? [], null); + $this->setIfExists('tracking_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -261,6 +349,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -285,6 +376,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -309,6 +403,9 @@ public function getStack() */ public function setStack($stack) { + if (is_null($stack)) { + throw new \InvalidArgumentException('non-nullable stack cannot be null'); + } $this->container['stack'] = $stack; return $this; @@ -317,7 +414,7 @@ public function setStack($stack) /** * Gets http_error_code * - * @return double + * @return float */ public function getHttpErrorCode() { @@ -327,12 +424,15 @@ public function getHttpErrorCode() /** * Sets http_error_code * - * @param double $http_error_code http_error_code + * @param float $http_error_code http_error_code * * @return self */ public function setHttpErrorCode($http_error_code) { + if (is_null($http_error_code)) { + throw new \InvalidArgumentException('non-nullable http_error_code cannot be null'); + } $this->container['http_error_code'] = $http_error_code; return $this; @@ -357,6 +457,9 @@ public function getTrackingCode() */ public function setTrackingCode($tracking_code) { + if (is_null($tracking_code)) { + throw new \InvalidArgumentException('non-nullable tracking_code cannot be null'); + } $this->container['tracking_code'] = $tracking_code; return $this; @@ -368,7 +471,7 @@ public function setTrackingCode($tracking_code) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -380,6 +483,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -393,7 +497,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -409,7 +513,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -421,6 +525,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/JobPosition.php b/lib/Model/JobPosition.php index 31dec8f..929b0d8 100644 --- a/lib/Model/JobPosition.php +++ b/lib/Model/JobPosition.php @@ -2,7 +2,7 @@ /** * JobPosition * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -43,19 +43,19 @@ class JobPosition /** * Possible values of this enum */ - const DIRECTOR = 'Director'; + public const DIRECTOR = 'Director'; - const GM = 'GM'; + public const GM = 'GM'; - const VP = 'VP'; + public const VP = 'VP'; - const CEO = 'CEO'; + public const CEO = 'CEO'; - const CFO = 'CFO'; + public const CFO = 'CFO'; - const GENERAL_COUNSEL = 'GeneralCounsel'; + public const GENERAL_COUNSEL = 'GeneralCounsel'; - const OTHER = 'Other'; + public const OTHER = 'Other'; /** * Gets allowable values of the enum diff --git a/lib/Model/LedgerEntry.php b/lib/Model/LedgerEntry.php index 7be4b76..5f64e79 100644 --- a/lib/Model/LedgerEntry.php +++ b/lib/Model/LedgerEntry.php @@ -2,7 +2,7 @@ /** * LedgerEntry * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class LedgerEntry implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,17 +61,17 @@ class LedgerEntry implements ModelInterface, ArrayAccess, \JsonSerializable 'register_id' => 'string', 'register_type' => '\OpenAPI\Client\Model\ApplicableTerminals', 'transaction_id' => 'string', - 'transaction_type' => 'string', - 'check_amount' => 'double', - 'transaction_amount' => 'double', - 'check_balance' => 'double', + 'transaction_type' => '\OpenAPI\Client\Model\LedgerEntryTransactionType', + 'check_amount' => 'float', + 'transaction_amount' => 'float', + 'check_balance' => 'float', 'discount_received' => 'string', 'payment_object_prefix' => 'string', 'payment_object_id' => 'string', 'parent_object_prefix' => 'string', - 'parent_object_id' => 'string', + 'parent_object_id' => '\OpenAPI\Client\Model\LedgerEntryParentObjectID', 'meta_value' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -122,6 +120,46 @@ class LedgerEntry implements ModelInterface, ArrayAccess, \JsonSerializable 'check_balance_string' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'register_id' => false, + 'register_type' => false, + 'transaction_id' => false, + 'transaction_type' => false, + 'check_amount' => false, + 'transaction_amount' => false, + 'check_balance' => false, + 'discount_received' => false, + 'payment_object_prefix' => false, + 'payment_object_id' => false, + 'parent_object_prefix' => false, + 'parent_object_id' => false, + 'meta_value' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'refunded_ledger_entry_id' => false, + 'transaction_amount_decimal' => false, + 'transaction_amount_string' => false, + 'check_amount_decimal' => false, + 'check_amount_string' => false, + 'check_balance_decimal' => false, + 'check_balance_string' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -142,6 +180,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -299,31 +389,49 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['register_type'] = $data['register_type'] ?? null; - $this->container['transaction_id'] = $data['transaction_id'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['check_amount'] = $data['check_amount'] ?? null; - $this->container['transaction_amount'] = $data['transaction_amount'] ?? null; - $this->container['check_balance'] = $data['check_balance'] ?? null; - $this->container['discount_received'] = $data['discount_received'] ?? null; - $this->container['payment_object_prefix'] = $data['payment_object_prefix'] ?? null; - $this->container['payment_object_id'] = $data['payment_object_id'] ?? null; - $this->container['parent_object_prefix'] = $data['parent_object_prefix'] ?? null; - $this->container['parent_object_id'] = $data['parent_object_id'] ?? null; - $this->container['meta_value'] = $data['meta_value'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['refunded_ledger_entry_id'] = $data['refunded_ledger_entry_id'] ?? null; - $this->container['transaction_amount_decimal'] = $data['transaction_amount_decimal'] ?? null; - $this->container['transaction_amount_string'] = $data['transaction_amount_string'] ?? null; - $this->container['check_amount_decimal'] = $data['check_amount_decimal'] ?? null; - $this->container['check_amount_string'] = $data['check_amount_string'] ?? null; - $this->container['check_balance_decimal'] = $data['check_balance_decimal'] ?? null; - $this->container['check_balance_string'] = $data['check_balance_string'] ?? null; + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('register_type', $data ?? [], null); + $this->setIfExists('transaction_id', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('check_amount', $data ?? [], null); + $this->setIfExists('transaction_amount', $data ?? [], null); + $this->setIfExists('check_balance', $data ?? [], null); + $this->setIfExists('discount_received', $data ?? [], null); + $this->setIfExists('payment_object_prefix', $data ?? [], null); + $this->setIfExists('payment_object_id', $data ?? [], null); + $this->setIfExists('parent_object_prefix', $data ?? [], null); + $this->setIfExists('parent_object_id', $data ?? [], null); + $this->setIfExists('meta_value', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('refunded_ledger_entry_id', $data ?? [], null); + $this->setIfExists('transaction_amount_decimal', $data ?? [], null); + $this->setIfExists('transaction_amount_string', $data ?? [], null); + $this->setIfExists('check_amount_decimal', $data ?? [], null); + $this->setIfExists('check_amount_string', $data ?? [], null); + $this->setIfExists('check_balance_decimal', $data ?? [], null); + $this->setIfExists('check_balance_string', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -389,14 +497,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -485,6 +585,9 @@ public function getRegisterId() */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -509,6 +612,9 @@ public function getRegisterType() */ public function setRegisterType($register_type) { + if (is_null($register_type)) { + throw new \InvalidArgumentException('non-nullable register_type cannot be null'); + } $this->container['register_type'] = $register_type; return $this; @@ -533,6 +639,9 @@ public function getTransactionId() */ public function setTransactionId($transaction_id) { + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('non-nullable transaction_id cannot be null'); + } $this->container['transaction_id'] = $transaction_id; return $this; @@ -541,7 +650,7 @@ public function setTransactionId($transaction_id) /** * Gets transaction_type * - * @return string + * @return \OpenAPI\Client\Model\LedgerEntryTransactionType */ public function getTransactionType() { @@ -551,12 +660,15 @@ public function getTransactionType() /** * Sets transaction_type * - * @param string $transaction_type transaction_type + * @param \OpenAPI\Client\Model\LedgerEntryTransactionType $transaction_type transaction_type * * @return self */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -565,7 +677,7 @@ public function setTransactionType($transaction_type) /** * Gets check_amount * - * @return double + * @return float */ public function getCheckAmount() { @@ -575,12 +687,15 @@ public function getCheckAmount() /** * Sets check_amount * - * @param double $check_amount check_amount + * @param float $check_amount check_amount * * @return self */ public function setCheckAmount($check_amount) { + if (is_null($check_amount)) { + throw new \InvalidArgumentException('non-nullable check_amount cannot be null'); + } $this->container['check_amount'] = $check_amount; return $this; @@ -589,7 +704,7 @@ public function setCheckAmount($check_amount) /** * Gets transaction_amount * - * @return double + * @return float */ public function getTransactionAmount() { @@ -599,12 +714,15 @@ public function getTransactionAmount() /** * Sets transaction_amount * - * @param double $transaction_amount transaction_amount + * @param float $transaction_amount transaction_amount * * @return self */ public function setTransactionAmount($transaction_amount) { + if (is_null($transaction_amount)) { + throw new \InvalidArgumentException('non-nullable transaction_amount cannot be null'); + } $this->container['transaction_amount'] = $transaction_amount; return $this; @@ -613,7 +731,7 @@ public function setTransactionAmount($transaction_amount) /** * Gets check_balance * - * @return double + * @return float */ public function getCheckBalance() { @@ -623,12 +741,15 @@ public function getCheckBalance() /** * Sets check_balance * - * @param double $check_balance check_balance + * @param float $check_balance check_balance * * @return self */ public function setCheckBalance($check_balance) { + if (is_null($check_balance)) { + throw new \InvalidArgumentException('non-nullable check_balance cannot be null'); + } $this->container['check_balance'] = $check_balance; return $this; @@ -653,6 +774,9 @@ public function getDiscountReceived() */ public function setDiscountReceived($discount_received) { + if (is_null($discount_received)) { + throw new \InvalidArgumentException('non-nullable discount_received cannot be null'); + } $this->container['discount_received'] = $discount_received; return $this; @@ -677,6 +801,9 @@ public function getPaymentObjectPrefix() */ public function setPaymentObjectPrefix($payment_object_prefix) { + if (is_null($payment_object_prefix)) { + throw new \InvalidArgumentException('non-nullable payment_object_prefix cannot be null'); + } $this->container['payment_object_prefix'] = $payment_object_prefix; return $this; @@ -701,14 +828,17 @@ public function getPaymentObjectId() */ public function setPaymentObjectId($payment_object_id) { + if (is_null($payment_object_id)) { + throw new \InvalidArgumentException('non-nullable payment_object_id cannot be null'); + } if ((mb_strlen($payment_object_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling LedgerEntry., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_object_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling LedgerEntry., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_object_id))) { - throw new \InvalidArgumentException("invalid value for $payment_object_id when calling LedgerEntry., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_object_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_object_id when calling LedgerEntry., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_object_id'] = $payment_object_id; @@ -735,6 +865,9 @@ public function getParentObjectPrefix() */ public function setParentObjectPrefix($parent_object_prefix) { + if (is_null($parent_object_prefix)) { + throw new \InvalidArgumentException('non-nullable parent_object_prefix cannot be null'); + } $this->container['parent_object_prefix'] = $parent_object_prefix; return $this; @@ -743,7 +876,7 @@ public function setParentObjectPrefix($parent_object_prefix) /** * Gets parent_object_id * - * @return string + * @return \OpenAPI\Client\Model\LedgerEntryParentObjectID */ public function getParentObjectId() { @@ -753,12 +886,15 @@ public function getParentObjectId() /** * Sets parent_object_id * - * @param string $parent_object_id parent_object_id + * @param \OpenAPI\Client\Model\LedgerEntryParentObjectID $parent_object_id parent_object_id * * @return self */ public function setParentObjectId($parent_object_id) { + if (is_null($parent_object_id)) { + throw new \InvalidArgumentException('non-nullable parent_object_id cannot be null'); + } $this->container['parent_object_id'] = $parent_object_id; return $this; @@ -783,6 +919,9 @@ public function getMetaValue() */ public function setMetaValue($meta_value) { + if (is_null($meta_value)) { + throw new \InvalidArgumentException('non-nullable meta_value cannot be null'); + } $this->container['meta_value'] = $meta_value; return $this; @@ -791,7 +930,7 @@ public function setMetaValue($meta_value) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -801,19 +940,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling LedgerEntry., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling LedgerEntry., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -838,14 +973,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling LedgerEntry., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling LedgerEntry., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling LedgerEntry., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling LedgerEntry., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -872,6 +1010,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -896,6 +1037,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -920,6 +1064,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -944,14 +1091,17 @@ public function getRefundedLedgerEntryId() */ public function setRefundedLedgerEntryId($refunded_ledger_entry_id) { - if (!is_null($refunded_ledger_entry_id) && (mb_strlen($refunded_ledger_entry_id) > 10)) { + if (is_null($refunded_ledger_entry_id)) { + throw new \InvalidArgumentException('non-nullable refunded_ledger_entry_id cannot be null'); + } + if ((mb_strlen($refunded_ledger_entry_id) > 10)) { throw new \InvalidArgumentException('invalid length for $refunded_ledger_entry_id when calling LedgerEntry., must be smaller than or equal to 10.'); } - if (!is_null($refunded_ledger_entry_id) && (mb_strlen($refunded_ledger_entry_id) < 10)) { + if ((mb_strlen($refunded_ledger_entry_id) < 10)) { throw new \InvalidArgumentException('invalid length for $refunded_ledger_entry_id when calling LedgerEntry., must be bigger than or equal to 10.'); } - if (!is_null($refunded_ledger_entry_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $refunded_ledger_entry_id))) { - throw new \InvalidArgumentException("invalid value for $refunded_ledger_entry_id when calling LedgerEntry., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($refunded_ledger_entry_id)))) { + throw new \InvalidArgumentException("invalid value for \$refunded_ledger_entry_id when calling LedgerEntry., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['refunded_ledger_entry_id'] = $refunded_ledger_entry_id; @@ -978,6 +1128,9 @@ public function getTransactionAmountDecimal() */ public function setTransactionAmountDecimal($transaction_amount_decimal) { + if (is_null($transaction_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable transaction_amount_decimal cannot be null'); + } $this->container['transaction_amount_decimal'] = $transaction_amount_decimal; return $this; @@ -1002,6 +1155,9 @@ public function getTransactionAmountString() */ public function setTransactionAmountString($transaction_amount_string) { + if (is_null($transaction_amount_string)) { + throw new \InvalidArgumentException('non-nullable transaction_amount_string cannot be null'); + } $this->container['transaction_amount_string'] = $transaction_amount_string; return $this; @@ -1026,6 +1182,9 @@ public function getCheckAmountDecimal() */ public function setCheckAmountDecimal($check_amount_decimal) { + if (is_null($check_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable check_amount_decimal cannot be null'); + } $this->container['check_amount_decimal'] = $check_amount_decimal; return $this; @@ -1050,6 +1209,9 @@ public function getCheckAmountString() */ public function setCheckAmountString($check_amount_string) { + if (is_null($check_amount_string)) { + throw new \InvalidArgumentException('non-nullable check_amount_string cannot be null'); + } $this->container['check_amount_string'] = $check_amount_string; return $this; @@ -1074,6 +1236,9 @@ public function getCheckBalanceDecimal() */ public function setCheckBalanceDecimal($check_balance_decimal) { + if (is_null($check_balance_decimal)) { + throw new \InvalidArgumentException('non-nullable check_balance_decimal cannot be null'); + } $this->container['check_balance_decimal'] = $check_balance_decimal; return $this; @@ -1098,6 +1263,9 @@ public function getCheckBalanceString() */ public function setCheckBalanceString($check_balance_string) { + if (is_null($check_balance_string)) { + throw new \InvalidArgumentException('non-nullable check_balance_string cannot be null'); + } $this->container['check_balance_string'] = $check_balance_string; return $this; @@ -1109,7 +1277,7 @@ public function setCheckBalanceString($check_balance_string) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1121,6 +1289,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1134,7 +1303,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1150,7 +1319,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1162,6 +1331,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/LedgerEntryParentObjectID.php b/lib/Model/LedgerEntryParentObjectID.php new file mode 100644 index 0000000..341a5cd --- /dev/null +++ b/lib/Model/LedgerEntryParentObjectID.php @@ -0,0 +1,382 @@ + + */ +class LedgerEntryParentObjectID implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LedgerEntry_parentObjectID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/LedgerEntryTransactionType.php b/lib/Model/LedgerEntryTransactionType.php new file mode 100644 index 0000000..240ea76 --- /dev/null +++ b/lib/Model/LedgerEntryTransactionType.php @@ -0,0 +1,382 @@ + + */ +class LedgerEntryTransactionType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LedgerEntry_transactionType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/LinkBook.php b/lib/Model/LinkBook.php index 35af76c..0591804 100644 --- a/lib/Model/LinkBook.php +++ b/lib/Model/LinkBook.php @@ -2,7 +2,7 @@ /** * LinkBook * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class LinkBook implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,8 +62,8 @@ class LinkBook implements ModelInterface, ArrayAccess, \JsonSerializable 'url' => 'string', 'icon' => 'string', 'order_number' => 'int', - 'link_book_section_id' => 'stringNumber', - 'id' => 'string', + 'link_book_section_id' => '\OpenAPI\Client\Model\WTLinkBookLinkBookSectionID', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -92,6 +90,31 @@ class LinkBook implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'url' => false, + 'icon' => false, + 'order_number' => false, + 'link_book_section_id' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['icon'] = $data['icon'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['link_book_section_id'] = $data['link_book_section_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('link_book_section_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -334,6 +427,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling LinkBook., must be bigger than or equal to 1.'); @@ -363,6 +459,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } if ((mb_strlen($url) < 1)) { throw new \InvalidArgumentException('invalid length for $url when calling LinkBook., must be bigger than or equal to 1.'); @@ -392,6 +491,9 @@ public function getIcon() */ public function setIcon($icon) { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } if ((mb_strlen($icon) < 1)) { throw new \InvalidArgumentException('invalid length for $icon when calling LinkBook., must be bigger than or equal to 1.'); @@ -421,6 +523,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling LinkBook., must be bigger than or equal to 1.'); @@ -434,7 +539,7 @@ public function setOrderNumber($order_number) /** * Gets link_book_section_id * - * @return stringNumber|null + * @return \OpenAPI\Client\Model\WTLinkBookLinkBookSectionID|null */ public function getLinkBookSectionId() { @@ -444,12 +549,15 @@ public function getLinkBookSectionId() /** * Sets link_book_section_id * - * @param stringNumber|null $link_book_section_id link_book_section_id + * @param \OpenAPI\Client\Model\WTLinkBookLinkBookSectionID|null $link_book_section_id link_book_section_id * * @return self */ public function setLinkBookSectionId($link_book_section_id) { + if (is_null($link_book_section_id)) { + throw new \InvalidArgumentException('non-nullable link_book_section_id cannot be null'); + } $this->container['link_book_section_id'] = $link_book_section_id; return $this; @@ -458,7 +566,7 @@ public function setLinkBookSectionId($link_book_section_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -468,12 +576,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -498,6 +609,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -522,6 +636,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -546,6 +663,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -570,14 +690,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling LinkBook., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling LinkBook., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling LinkBook., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling LinkBook., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -591,7 +714,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -603,6 +726,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -616,7 +740,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -632,7 +756,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -644,6 +768,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/LinkBookSection.php b/lib/Model/LinkBookSection.php index 2ca7835..d2c124e 100644 --- a/lib/Model/LinkBookSection.php +++ b/lib/Model/LinkBookSection.php @@ -2,7 +2,7 @@ /** * LinkBookSection * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class LinkBookSection implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class LinkBookSection implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'name' => 'string', 'order_number' => 'int', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -86,6 +84,28 @@ class LinkBookSection implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'order_number' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +126,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -209,13 +281,31 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -302,6 +392,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } if ((mb_strlen($name) < 1)) { throw new \InvalidArgumentException('invalid length for $name when calling LinkBookSection., must be bigger than or equal to 1.'); @@ -331,6 +424,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling LinkBookSection., must be bigger than or equal to 1.'); @@ -344,7 +440,7 @@ public function setOrderNumber($order_number) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -354,12 +450,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -384,6 +483,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -408,6 +510,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -432,6 +537,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -456,14 +564,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling LinkBookSection., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling LinkBookSection., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling LinkBookSection., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling LinkBookSection., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -477,7 +588,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -489,6 +600,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -502,7 +614,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -518,7 +630,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -530,6 +642,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/LoginStatus200Response.php b/lib/Model/LoginStatus200Response.php new file mode 100644 index 0000000..e79fbc6 --- /dev/null +++ b/lib/Model/LoginStatus200Response.php @@ -0,0 +1,519 @@ + + */ +class LoginStatus200Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'loginStatus_200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + 'code' => 'string', + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + 'code' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false, + 'code' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + 'code' => 'code', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + 'code' => 'setCode', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + 'code' => 'getCode', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_VALID = 'Valid'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_VALID, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/LoginStatus200ResponseAnyOf.php b/lib/Model/LoginStatus200ResponseAnyOf.php new file mode 100644 index 0000000..4d628f4 --- /dev/null +++ b/lib/Model/LoginStatus200ResponseAnyOf.php @@ -0,0 +1,450 @@ + + */ +class LoginStatus200ResponseAnyOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'loginStatus_200_response_anyOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + 'code' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + 'code' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false, + 'code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + 'code' => 'code' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + 'code' => 'setCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + 'code' => 'getCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets code + * + * @return string + */ + public function getCode() + { + return $this->container['code']; + } + + /** + * Sets code + * + * @param string $code code + * + * @return self + */ + public function setCode($code) + { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } + $this->container['code'] = $code; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Lounge.php b/lib/Model/Lounge.php index ba93964..fc842c1 100644 --- a/lib/Model/Lounge.php +++ b/lib/Model/Lounge.php @@ -2,7 +2,7 @@ /** * Lounge * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Lounge implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -66,7 +64,7 @@ class Lounge implements ModelInterface, ArrayAccess, \JsonSerializable 'order_number' => 'int', 'media_url' => 'string', 'additional_info_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -94,6 +92,32 @@ class Lounge implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -229,17 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -333,6 +427,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling Lounge., must be bigger than or equal to 1.'); @@ -362,6 +459,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling Lounge., must be bigger than or equal to 1.'); @@ -391,6 +491,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -415,6 +518,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling Lounge., must be bigger than or equal to 1.'); @@ -444,6 +550,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -468,6 +577,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -476,7 +588,7 @@ public function setAdditionalInfoUrl($additional_info_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -486,12 +598,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -516,6 +631,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -540,6 +658,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -564,6 +685,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -588,14 +712,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Lounge., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Lounge., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Lounge., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Lounge., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -609,7 +736,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -621,6 +748,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -634,7 +762,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -650,7 +778,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -662,6 +790,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSAnalyticsMemberCountPartitionedByDate.php b/lib/Model/MSAnalyticsMemberCountPartitionedByDate.php index fe496fb..e8faea0 100644 --- a/lib/Model/MSAnalyticsMemberCountPartitionedByDate.php +++ b/lib/Model/MSAnalyticsMemberCountPartitionedByDate.php @@ -2,7 +2,7 @@ /** * MSAnalyticsMemberCountPartitionedByDate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSAnalyticsMemberCountPartitionedByDate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class MSAnalyticsMemberCountPartitionedByDate implements ModelInterface, ArrayAc 'count' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'date' => false, + 'count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['date'] = $data['date'] ?? null; - $this->container['count'] = $data['count'] ?? null; + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -241,6 +326,9 @@ public function getDate() */ public function setDate($date) { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } $this->container['date'] = $date; return $this; @@ -265,6 +353,9 @@ public function getCount() */ public function setCount($count) { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } if (($count < 0)) { throw new \InvalidArgumentException('invalid value for $count when calling MSAnalyticsMemberCountPartitionedByDate., must be bigger than or equal to 0.'); @@ -281,7 +372,7 @@ public function setCount($count) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,6 +384,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -306,7 +398,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -322,7 +414,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -334,6 +426,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSAnalyticsMemberPointsRedeemedPartitionedByDate.php b/lib/Model/MSAnalyticsMemberPointsRedeemedPartitionedByDate.php index 381966c..62ff523 100644 --- a/lib/Model/MSAnalyticsMemberPointsRedeemedPartitionedByDate.php +++ b/lib/Model/MSAnalyticsMemberPointsRedeemedPartitionedByDate.php @@ -2,7 +2,7 @@ /** * MSAnalyticsMemberPointsRedeemedPartitionedByDate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSAnalyticsMemberPointsRedeemedPartitionedByDate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class MSAnalyticsMemberPointsRedeemedPartitionedByDate implements ModelInterface 'points' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'date' => false, + 'points' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['date'] = $data['date'] ?? null; - $this->container['points'] = $data['points'] ?? null; + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('points', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -241,6 +326,9 @@ public function getDate() */ public function setDate($date) { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } $this->container['date'] = $date; return $this; @@ -265,6 +353,9 @@ public function getPoints() */ public function setPoints($points) { + if (is_null($points)) { + throw new \InvalidArgumentException('non-nullable points cannot be null'); + } if (($points < 0)) { throw new \InvalidArgumentException('invalid value for $points when calling MSAnalyticsMemberPointsRedeemedPartitionedByDate., must be bigger than or equal to 0.'); @@ -281,7 +372,7 @@ public function setPoints($points) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,6 +384,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -306,7 +398,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -322,7 +414,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -334,6 +426,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSAnalyticsMemberPointsRefundedPartitionedByDate.php b/lib/Model/MSAnalyticsMemberPointsRefundedPartitionedByDate.php index 2806d64..5dc2417 100644 --- a/lib/Model/MSAnalyticsMemberPointsRefundedPartitionedByDate.php +++ b/lib/Model/MSAnalyticsMemberPointsRefundedPartitionedByDate.php @@ -2,7 +2,7 @@ /** * MSAnalyticsMemberPointsRefundedPartitionedByDate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSAnalyticsMemberPointsRefundedPartitionedByDate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class MSAnalyticsMemberPointsRefundedPartitionedByDate implements ModelInterface 'points' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'date' => false, + 'points' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['date'] = $data['date'] ?? null; - $this->container['points'] = $data['points'] ?? null; + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('points', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -241,6 +326,9 @@ public function getDate() */ public function setDate($date) { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } $this->container['date'] = $date; return $this; @@ -265,6 +353,9 @@ public function getPoints() */ public function setPoints($points) { + if (is_null($points)) { + throw new \InvalidArgumentException('non-nullable points cannot be null'); + } if (($points < 0)) { throw new \InvalidArgumentException('invalid value for $points when calling MSAnalyticsMemberPointsRefundedPartitionedByDate., must be bigger than or equal to 0.'); @@ -281,7 +372,7 @@ public function setPoints($points) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,6 +384,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -306,7 +398,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -322,7 +414,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -334,6 +426,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate.php b/lib/Model/MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate.php index 0e8dbb6..68e56fe 100644 --- a/lib/Model/MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate.php +++ b/lib/Model/MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate.php @@ -2,7 +2,7 @@ /** * MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate implements ModelI 'amount' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'date' => false, + 'amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['date'] = $data['date'] ?? null; - $this->container['amount'] = $data['amount'] ?? null; + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -241,6 +326,9 @@ public function getDate() */ public function setDate($date) { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } $this->container['date'] = $date; return $this; @@ -265,6 +353,9 @@ public function getAmount() */ public function setAmount($amount) { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } if (($amount < 0)) { throw new \InvalidArgumentException('invalid value for $amount when calling MSAnalyticsMembershipTierAmountRedeemedPartitionedByDate., must be bigger than or equal to 0.'); @@ -281,7 +372,7 @@ public function setAmount($amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,6 +384,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -306,7 +398,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -322,7 +414,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -334,6 +426,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSAnalyticsMembershipTierAmountRefundedPartitionedByDate.php b/lib/Model/MSAnalyticsMembershipTierAmountRefundedPartitionedByDate.php index 91ba131..0f3c1e2 100644 --- a/lib/Model/MSAnalyticsMembershipTierAmountRefundedPartitionedByDate.php +++ b/lib/Model/MSAnalyticsMembershipTierAmountRefundedPartitionedByDate.php @@ -2,7 +2,7 @@ /** * MSAnalyticsMembershipTierAmountRefundedPartitionedByDate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSAnalyticsMembershipTierAmountRefundedPartitionedByDate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class MSAnalyticsMembershipTierAmountRefundedPartitionedByDate implements ModelI 'amount' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'date' => false, + 'amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['date'] = $data['date'] ?? null; - $this->container['amount'] = $data['amount'] ?? null; + $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -241,6 +326,9 @@ public function getDate() */ public function setDate($date) { + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); + } $this->container['date'] = $date; return $this; @@ -265,6 +353,9 @@ public function getAmount() */ public function setAmount($amount) { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } if (($amount < 0)) { throw new \InvalidArgumentException('invalid value for $amount when calling MSAnalyticsMembershipTierAmountRefundedPartitionedByDate., must be bigger than or equal to 0.'); @@ -281,7 +372,7 @@ public function setAmount($amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,6 +384,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -306,7 +398,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -322,7 +414,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -334,6 +426,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMemberHistory.php b/lib/Model/MSMemberHistory.php index d8b62ea..ed7c589 100644 --- a/lib/Model/MSMemberHistory.php +++ b/lib/Model/MSMemberHistory.php @@ -2,7 +2,7 @@ /** * MSMemberHistory * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMemberHistory implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -65,6 +63,8 @@ class MSMemberHistory implements ModelInterface, ArrayAccess, \JsonSerializable 'last_name' => 'string', 'membership_tier_id' => 'string', 'mobile_number' => 'string', + 'email' => 'string', + 'birthday' => 'string', 'points_accrued' => 'int', 'id' => 'string', 'member_id' => 'string', @@ -86,6 +86,8 @@ class MSMemberHistory implements ModelInterface, ArrayAccess, \JsonSerializable 'last_name' => null, 'membership_tier_id' => null, 'mobile_number' => null, + 'email' => null, + 'birthday' => null, 'points_accrued' => 'int32', 'id' => null, 'member_id' => null, @@ -94,6 +96,34 @@ class MSMemberHistory implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'member_identifier' => false, + 'first_name' => false, + 'last_name' => false, + 'membership_tier_id' => false, + 'mobile_number' => false, + 'email' => false, + 'birthday' => false, + 'points_accrued' => false, + 'id' => false, + 'member_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -126,6 +208,8 @@ public static function openAPIFormats() 'last_name' => 'lastName', 'membership_tier_id' => 'membershipTierID', 'mobile_number' => 'mobileNumber', + 'email' => 'email', + 'birthday' => 'birthday', 'points_accrued' => 'pointsAccrued', 'id' => 'id', 'member_id' => 'memberID', @@ -145,6 +229,8 @@ public static function openAPIFormats() 'last_name' => 'setLastName', 'membership_tier_id' => 'setMembershipTierId', 'mobile_number' => 'setMobileNumber', + 'email' => 'setEmail', + 'birthday' => 'setBirthday', 'points_accrued' => 'setPointsAccrued', 'id' => 'setId', 'member_id' => 'setMemberId', @@ -164,6 +250,8 @@ public static function openAPIFormats() 'last_name' => 'getLastName', 'membership_tier_id' => 'getMembershipTierId', 'mobile_number' => 'getMobileNumber', + 'email' => 'getEmail', + 'birthday' => 'getBirthday', 'points_accrued' => 'getPointsAccrued', 'id' => 'getId', 'member_id' => 'getMemberId', @@ -229,17 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['member_identifier'] = $data['member_identifier'] ?? null; - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['membership_tier_id'] = $data['membership_tier_id'] ?? null; - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['points_accrued'] = $data['points_accrued'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('member_identifier', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('membership_tier_id', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('birthday', $data ?? [], null); + $this->setIfExists('points_accrued', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -280,6 +388,12 @@ public function listInvalidProperties() if ($this->container['mobile_number'] === null) { $invalidProperties[] = "'mobile_number' can't be null"; } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['birthday'] === null) { + $invalidProperties[] = "'birthday' can't be null"; + } if ($this->container['points_accrued'] === null) { $invalidProperties[] = "'points_accrued' can't be null"; } @@ -368,12 +482,15 @@ public function getMemberIdentifier() */ public function setMemberIdentifier($member_identifier) { + if (is_null($member_identifier)) { + throw new \InvalidArgumentException('non-nullable member_identifier cannot be null'); + } if ((mb_strlen($member_identifier) < 1)) { throw new \InvalidArgumentException('invalid length for $member_identifier when calling MSMemberHistory., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $member_identifier))) { - throw new \InvalidArgumentException("invalid value for $member_identifier when calling MSMemberHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($member_identifier)))) { + throw new \InvalidArgumentException("invalid value for \$member_identifier when calling MSMemberHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['member_identifier'] = $member_identifier; @@ -400,6 +517,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } $this->container['first_name'] = $first_name; return $this; @@ -424,6 +544,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } $this->container['last_name'] = $last_name; return $this; @@ -448,14 +571,17 @@ public function getMembershipTierId() */ public function setMembershipTierId($membership_tier_id) { + if (is_null($membership_tier_id)) { + throw new \InvalidArgumentException('non-nullable membership_tier_id cannot be null'); + } if ((mb_strlen($membership_tier_id) > 10)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling MSMemberHistory., must be smaller than or equal to 10.'); } if ((mb_strlen($membership_tier_id) < 10)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling MSMemberHistory., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $membership_tier_id))) { - throw new \InvalidArgumentException("invalid value for $membership_tier_id when calling MSMemberHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($membership_tier_id)))) { + throw new \InvalidArgumentException("invalid value for \$membership_tier_id when calling MSMemberHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['membership_tier_id'] = $membership_tier_id; @@ -482,11 +608,68 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } $this->container['mobile_number'] = $mobile_number; return $this; } + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets birthday + * + * @return string + */ + public function getBirthday() + { + return $this->container['birthday']; + } + + /** + * Sets birthday + * + * @param string $birthday Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured + * + * @return self + */ + public function setBirthday($birthday) + { + if (is_null($birthday)) { + throw new \InvalidArgumentException('non-nullable birthday cannot be null'); + } + $this->container['birthday'] = $birthday; + + return $this; + } + /** * Gets points_accrued * @@ -506,6 +689,9 @@ public function getPointsAccrued() */ public function setPointsAccrued($points_accrued) { + if (is_null($points_accrued)) { + throw new \InvalidArgumentException('non-nullable points_accrued cannot be null'); + } if (($points_accrued < 0)) { throw new \InvalidArgumentException('invalid value for $points_accrued when calling MSMemberHistory., must be bigger than or equal to 0.'); @@ -535,6 +721,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 36)) { throw new \InvalidArgumentException('invalid length for $id when calling MSMemberHistory., must be smaller than or equal to 36.'); } @@ -566,14 +755,17 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } if ((mb_strlen($member_id) > 10)) { throw new \InvalidArgumentException('invalid length for $member_id when calling MSMemberHistory., must be smaller than or equal to 10.'); } if ((mb_strlen($member_id) < 10)) { throw new \InvalidArgumentException('invalid length for $member_id when calling MSMemberHistory., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling MSMemberHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling MSMemberHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['member_id'] = $member_id; @@ -600,14 +792,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMemberHistory., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMemberHistory., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling MSMemberHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling MSMemberHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -634,6 +829,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -658,6 +856,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -669,7 +870,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -681,6 +882,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -694,7 +896,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -710,7 +912,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -722,6 +924,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMemberHistoryPagination.php b/lib/Model/MSMemberHistoryPagination.php index cc46c85..1ad33de 100644 --- a/lib/Model/MSMemberHistoryPagination.php +++ b/lib/Model/MSMemberHistoryPagination.php @@ -2,7 +2,7 @@ /** * MSMemberHistoryPagination * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMemberHistoryPagination implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class MSMemberHistoryPagination implements ModelInterface, ArrayAccess, \JsonSer 'total' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false, + 'length' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['results'] = $data['results'] ?? null; - $this->container['length'] = $data['length'] ?? null; - $this->container['total'] = $data['total'] ?? null; + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +332,9 @@ public function getResults() */ public function setResults($results) { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } $this->container['results'] = $results; return $this; @@ -270,6 +359,9 @@ public function getLength() */ public function setLength($length) { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } $this->container['length'] = $length; return $this; @@ -294,6 +386,9 @@ public function getTotal() */ public function setTotal($total) { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } $this->container['total'] = $total; return $this; @@ -305,7 +400,7 @@ public function setTotal($total) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMemberRedemption.php b/lib/Model/MSMemberRedemption.php index 17c21f4..8090faa 100644 --- a/lib/Model/MSMemberRedemption.php +++ b/lib/Model/MSMemberRedemption.php @@ -2,7 +2,7 @@ /** * MSMemberRedemption * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMemberRedemption implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,9 +59,9 @@ class MSMemberRedemption implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'transaction_id' => 'string', - 'transaction_type' => 'string', + 'transaction_type' => '\OpenAPI\Client\Model\MSMemberRedemptionTransactionType', 'points' => 'int', - 'register_id' => 'string', + 'register_id' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID', 'terminal_type' => 'string', 'id' => 'string', 'member_id' => 'string', @@ -92,6 +90,31 @@ class MSMemberRedemption implements ModelInterface, ArrayAccess, \JsonSerializab 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'transaction_id' => false, + 'transaction_type' => false, + 'points' => false, + 'register_id' => false, + 'terminal_type' => false, + 'id' => false, + 'member_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['transaction_id'] = $data['transaction_id'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['points'] = $data['points'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['terminal_type'] = $data['terminal_type'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('transaction_id', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('points', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('terminal_type', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -350,6 +443,9 @@ public function getTransactionId() */ public function setTransactionId($transaction_id) { + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('non-nullable transaction_id cannot be null'); + } if ((mb_strlen($transaction_id) < 1)) { throw new \InvalidArgumentException('invalid length for $transaction_id when calling MSMemberRedemption., must be bigger than or equal to 1.'); @@ -363,7 +459,7 @@ public function setTransactionId($transaction_id) /** * Gets transaction_type * - * @return string + * @return \OpenAPI\Client\Model\MSMemberRedemptionTransactionType */ public function getTransactionType() { @@ -373,12 +469,15 @@ public function getTransactionType() /** * Sets transaction_type * - * @param string $transaction_type The type of the transaction - either redemption or refund + * @param \OpenAPI\Client\Model\MSMemberRedemptionTransactionType $transaction_type transaction_type * * @return self */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -403,6 +502,9 @@ public function getPoints() */ public function setPoints($points) { + if (is_null($points)) { + throw new \InvalidArgumentException('non-nullable points cannot be null'); + } if (($points < 0)) { throw new \InvalidArgumentException('invalid value for $points when calling MSMemberRedemption., must be bigger than or equal to 0.'); @@ -416,7 +518,7 @@ public function setPoints($points) /** * Gets register_id * - * @return string|null + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID|null */ public function getRegisterId() { @@ -426,12 +528,15 @@ public function getRegisterId() /** * Sets register_id * - * @param string|null $register_id The ID of the register where the transaction occurred + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID|null $register_id register_id * * @return self */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -456,6 +561,9 @@ public function getTerminalType() */ public function setTerminalType($terminal_type) { + if (is_null($terminal_type)) { + throw new \InvalidArgumentException('non-nullable terminal_type cannot be null'); + } if ((mb_strlen($terminal_type) < 1)) { throw new \InvalidArgumentException('invalid length for $terminal_type when calling MSMemberRedemption., must be bigger than or equal to 1.'); @@ -485,6 +593,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 36)) { throw new \InvalidArgumentException('invalid length for $id when calling MSMemberRedemption., must be smaller than or equal to 36.'); } @@ -516,14 +627,17 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } if ((mb_strlen($member_id) > 10)) { throw new \InvalidArgumentException('invalid length for $member_id when calling MSMemberRedemption., must be smaller than or equal to 10.'); } if ((mb_strlen($member_id) < 10)) { throw new \InvalidArgumentException('invalid length for $member_id when calling MSMemberRedemption., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling MSMemberRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling MSMemberRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['member_id'] = $member_id; @@ -550,14 +664,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMemberRedemption., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMemberRedemption., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling MSMemberRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling MSMemberRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -584,6 +701,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -608,6 +728,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -619,7 +742,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -631,6 +754,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -644,7 +768,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -660,7 +784,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -672,6 +796,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMemberRedemptionPagination.php b/lib/Model/MSMemberRedemptionPagination.php index b8b5b4c..85c57b5 100644 --- a/lib/Model/MSMemberRedemptionPagination.php +++ b/lib/Model/MSMemberRedemptionPagination.php @@ -2,7 +2,7 @@ /** * MSMemberRedemptionPagination * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMemberRedemptionPagination implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class MSMemberRedemptionPagination implements ModelInterface, ArrayAccess, \Json 'total' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false, + 'length' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['results'] = $data['results'] ?? null; - $this->container['length'] = $data['length'] ?? null; - $this->container['total'] = $data['total'] ?? null; + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +332,9 @@ public function getResults() */ public function setResults($results) { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } $this->container['results'] = $results; return $this; @@ -270,6 +359,9 @@ public function getLength() */ public function setLength($length) { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } $this->container['length'] = $length; return $this; @@ -294,6 +386,9 @@ public function getTotal() */ public function setTotal($total) { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } $this->container['total'] = $total; return $this; @@ -305,7 +400,7 @@ public function setTotal($total) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMemberRedemptionTransactionType.php b/lib/Model/MSMemberRedemptionTransactionType.php new file mode 100644 index 0000000..c095837 --- /dev/null +++ b/lib/Model/MSMemberRedemptionTransactionType.php @@ -0,0 +1,383 @@ + + */ +class MSMemberRedemptionTransactionType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MSMemberRedemption_transactionType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/MSMembershipTierHistory.php b/lib/Model/MSMembershipTierHistory.php index 153df95..711c1dd 100644 --- a/lib/Model/MSMembershipTierHistory.php +++ b/lib/Model/MSMembershipTierHistory.php @@ -2,7 +2,7 @@ /** * MSMembershipTierHistory * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMembershipTierHistory implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -92,6 +90,31 @@ class MSMembershipTierHistory implements ModelInterface, ArrayAccess, \JsonSeria 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tier_number' => false, + 'tier_name' => false, + 'tier_discount' => false, + 'tier_design_id' => false, + 'points_design_id' => false, + 'id' => false, + 'merchant_id' => false, + 'tier_id' => false, + 'created_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['tier_number'] = $data['tier_number'] ?? null; - $this->container['tier_name'] = $data['tier_name'] ?? null; - $this->container['tier_discount'] = $data['tier_discount'] ?? null; - $this->container['tier_design_id'] = $data['tier_design_id'] ?? null; - $this->container['points_design_id'] = $data['points_design_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['tier_id'] = $data['tier_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('tier_number', $data ?? [], null); + $this->setIfExists('tier_name', $data ?? [], null); + $this->setIfExists('tier_discount', $data ?? [], null); + $this->setIfExists('tier_design_id', $data ?? [], null); + $this->setIfExists('points_design_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('tier_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -377,6 +470,9 @@ public function getTierNumber() */ public function setTierNumber($tier_number) { + if (is_null($tier_number)) { + throw new \InvalidArgumentException('non-nullable tier_number cannot be null'); + } if ((mb_strlen($tier_number) < 1)) { throw new \InvalidArgumentException('invalid length for $tier_number when calling MSMembershipTierHistory., must be bigger than or equal to 1.'); @@ -406,6 +502,9 @@ public function getTierName() */ public function setTierName($tier_name) { + if (is_null($tier_name)) { + throw new \InvalidArgumentException('non-nullable tier_name cannot be null'); + } if ((mb_strlen($tier_name) < 1)) { throw new \InvalidArgumentException('invalid length for $tier_name when calling MSMembershipTierHistory., must be bigger than or equal to 1.'); @@ -435,6 +534,9 @@ public function getTierDiscount() */ public function setTierDiscount($tier_discount) { + if (is_null($tier_discount)) { + throw new \InvalidArgumentException('non-nullable tier_discount cannot be null'); + } if (($tier_discount > 100)) { throw new \InvalidArgumentException('invalid value for $tier_discount when calling MSMembershipTierHistory., must be smaller than or equal to 100.'); @@ -467,14 +569,17 @@ public function getTierDesignId() */ public function setTierDesignId($tier_design_id) { + if (is_null($tier_design_id)) { + throw new \InvalidArgumentException('non-nullable tier_design_id cannot be null'); + } if ((mb_strlen($tier_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $tier_design_id when calling MSMembershipTierHistory., must be smaller than or equal to 10.'); } if ((mb_strlen($tier_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $tier_design_id when calling MSMembershipTierHistory., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $tier_design_id))) { - throw new \InvalidArgumentException("invalid value for $tier_design_id when calling MSMembershipTierHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($tier_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$tier_design_id when calling MSMembershipTierHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['tier_design_id'] = $tier_design_id; @@ -501,14 +606,17 @@ public function getPointsDesignId() */ public function setPointsDesignId($points_design_id) { + if (is_null($points_design_id)) { + throw new \InvalidArgumentException('non-nullable points_design_id cannot be null'); + } if ((mb_strlen($points_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $points_design_id when calling MSMembershipTierHistory., must be smaller than or equal to 10.'); } if ((mb_strlen($points_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $points_design_id when calling MSMembershipTierHistory., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $points_design_id))) { - throw new \InvalidArgumentException("invalid value for $points_design_id when calling MSMembershipTierHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($points_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$points_design_id when calling MSMembershipTierHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['points_design_id'] = $points_design_id; @@ -535,6 +643,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 36)) { throw new \InvalidArgumentException('invalid length for $id when calling MSMembershipTierHistory., must be smaller than or equal to 36.'); } @@ -566,14 +677,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMembershipTierHistory., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMembershipTierHistory., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling MSMembershipTierHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling MSMembershipTierHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -600,6 +714,9 @@ public function getTierId() */ public function setTierId($tier_id) { + if (is_null($tier_id)) { + throw new \InvalidArgumentException('non-nullable tier_id cannot be null'); + } if ((mb_strlen($tier_id) > 10)) { throw new \InvalidArgumentException('invalid length for $tier_id when calling MSMembershipTierHistory., must be smaller than or equal to 10.'); } @@ -631,6 +748,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -655,6 +775,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -666,7 +789,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -678,6 +801,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -691,7 +815,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -707,7 +831,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -719,6 +843,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMembershipTierHistoryPagination.php b/lib/Model/MSMembershipTierHistoryPagination.php index 0e8d9cb..c33ac20 100644 --- a/lib/Model/MSMembershipTierHistoryPagination.php +++ b/lib/Model/MSMembershipTierHistoryPagination.php @@ -2,7 +2,7 @@ /** * MSMembershipTierHistoryPagination * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMembershipTierHistoryPagination implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class MSMembershipTierHistoryPagination implements ModelInterface, ArrayAccess, 'total' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false, + 'length' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['results'] = $data['results'] ?? null; - $this->container['length'] = $data['length'] ?? null; - $this->container['total'] = $data['total'] ?? null; + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +332,9 @@ public function getResults() */ public function setResults($results) { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } $this->container['results'] = $results; return $this; @@ -270,6 +359,9 @@ public function getLength() */ public function setLength($length) { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } $this->container['length'] = $length; return $this; @@ -294,6 +386,9 @@ public function getTotal() */ public function setTotal($total) { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } $this->container['total'] = $total; return $this; @@ -305,7 +400,7 @@ public function setTotal($total) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMembershipTierRedemption.php b/lib/Model/MSMembershipTierRedemption.php index f326770..1f1eeec 100644 --- a/lib/Model/MSMembershipTierRedemption.php +++ b/lib/Model/MSMembershipTierRedemption.php @@ -2,7 +2,7 @@ /** * MSMembershipTierRedemption * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMembershipTierRedemption implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,9 +60,9 @@ class MSMembershipTierRedemption implements ModelInterface, ArrayAccess, \JsonSe protected static $openAPITypes = [ 'member_id' => 'string', 'transaction_id' => 'string', - 'transaction_type' => 'string', + 'transaction_type' => '\OpenAPI\Client\Model\MSMemberRedemptionTransactionType', 'amount' => 'int', - 'register_id' => 'string', + 'register_id' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID', 'terminal_type' => 'string', 'id' => 'string', 'tier_id' => 'string', @@ -94,6 +92,32 @@ class MSMembershipTierRedemption implements ModelInterface, ArrayAccess, \JsonSe 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'member_id' => false, + 'transaction_id' => false, + 'transaction_type' => false, + 'amount' => false, + 'register_id' => false, + 'terminal_type' => false, + 'id' => false, + 'tier_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -229,17 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['transaction_id'] = $data['transaction_id'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['amount'] = $data['amount'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['terminal_type'] = $data['terminal_type'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['tier_id'] = $data['tier_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('transaction_id', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('terminal_type', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('tier_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -363,6 +457,9 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } if ((mb_strlen($member_id) > 10)) { throw new \InvalidArgumentException('invalid length for $member_id when calling MSMembershipTierRedemption., must be smaller than or equal to 10.'); } @@ -394,6 +491,9 @@ public function getTransactionId() */ public function setTransactionId($transaction_id) { + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('non-nullable transaction_id cannot be null'); + } if ((mb_strlen($transaction_id) < 1)) { throw new \InvalidArgumentException('invalid length for $transaction_id when calling MSMembershipTierRedemption., must be bigger than or equal to 1.'); @@ -407,7 +507,7 @@ public function setTransactionId($transaction_id) /** * Gets transaction_type * - * @return string + * @return \OpenAPI\Client\Model\MSMemberRedemptionTransactionType */ public function getTransactionType() { @@ -417,12 +517,15 @@ public function getTransactionType() /** * Sets transaction_type * - * @param string $transaction_type The type of the transaction - either redemption or refund + * @param \OpenAPI\Client\Model\MSMemberRedemptionTransactionType $transaction_type transaction_type * * @return self */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -447,6 +550,9 @@ public function getAmount() */ public function setAmount($amount) { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } if (($amount < 0)) { throw new \InvalidArgumentException('invalid value for $amount when calling MSMembershipTierRedemption., must be bigger than or equal to 0.'); @@ -460,7 +566,7 @@ public function setAmount($amount) /** * Gets register_id * - * @return string|null + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID|null */ public function getRegisterId() { @@ -470,12 +576,15 @@ public function getRegisterId() /** * Sets register_id * - * @param string|null $register_id The ID of the register where the transaction occurred + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID|null $register_id register_id * * @return self */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -500,6 +609,9 @@ public function getTerminalType() */ public function setTerminalType($terminal_type) { + if (is_null($terminal_type)) { + throw new \InvalidArgumentException('non-nullable terminal_type cannot be null'); + } if ((mb_strlen($terminal_type) < 1)) { throw new \InvalidArgumentException('invalid length for $terminal_type when calling MSMembershipTierRedemption., must be bigger than or equal to 1.'); @@ -529,6 +641,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 36)) { throw new \InvalidArgumentException('invalid length for $id when calling MSMembershipTierRedemption., must be smaller than or equal to 36.'); } @@ -560,6 +675,9 @@ public function getTierId() */ public function setTierId($tier_id) { + if (is_null($tier_id)) { + throw new \InvalidArgumentException('non-nullable tier_id cannot be null'); + } if ((mb_strlen($tier_id) > 10)) { throw new \InvalidArgumentException('invalid length for $tier_id when calling MSMembershipTierRedemption., must be smaller than or equal to 10.'); } @@ -591,14 +709,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMembershipTierRedemption., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMembershipTierRedemption., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling MSMembershipTierRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling MSMembershipTierRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -625,6 +746,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -649,6 +773,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -660,7 +787,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -672,6 +799,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -685,7 +813,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -701,7 +829,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -713,6 +841,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMembershipTierRedemptionPagination.php b/lib/Model/MSMembershipTierRedemptionPagination.php index ad92e95..dba8d37 100644 --- a/lib/Model/MSMembershipTierRedemptionPagination.php +++ b/lib/Model/MSMembershipTierRedemptionPagination.php @@ -2,7 +2,7 @@ /** * MSMembershipTierRedemptionPagination * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMembershipTierRedemptionPagination implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class MSMembershipTierRedemptionPagination implements ModelInterface, ArrayAcces 'total' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false, + 'length' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['results'] = $data['results'] ?? null; - $this->container['length'] = $data['length'] ?? null; - $this->container['total'] = $data['total'] ?? null; + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +332,9 @@ public function getResults() */ public function setResults($results) { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } $this->container['results'] = $results; return $this; @@ -270,6 +359,9 @@ public function getLength() */ public function setLength($length) { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } $this->container['length'] = $length; return $this; @@ -294,6 +386,9 @@ public function getTotal() */ public function setTotal($total) { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } $this->container['total'] = $total; return $this; @@ -305,7 +400,7 @@ public function setTotal($total) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMerchantCreditHistory.php b/lib/Model/MSMerchantCreditHistory.php index b87e32f..254691c 100644 --- a/lib/Model/MSMerchantCreditHistory.php +++ b/lib/Model/MSMerchantCreditHistory.php @@ -2,7 +2,7 @@ /** * MSMerchantCreditHistory * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMerchantCreditHistory implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -88,6 +86,29 @@ class MSMerchantCreditHistory implements ModelInterface, ArrayAccess, \JsonSeria 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'member_identifier' => false, + 'mobile_number' => false, + 'credit_amount' => false, + 'id' => false, + 'merchant_credit_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -214,14 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['member_identifier'] = $data['member_identifier'] ?? null; - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['credit_amount'] = $data['credit_amount'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_credit_id'] = $data['merchant_credit_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('member_identifier', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('credit_amount', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_credit_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -336,12 +427,15 @@ public function getMemberIdentifier() */ public function setMemberIdentifier($member_identifier) { + if (is_null($member_identifier)) { + throw new \InvalidArgumentException('non-nullable member_identifier cannot be null'); + } - if (!is_null($member_identifier) && (mb_strlen($member_identifier) < 0)) { + if ((mb_strlen($member_identifier) < 0)) { throw new \InvalidArgumentException('invalid length for $member_identifier when calling MSMerchantCreditHistory., must be bigger than or equal to 0.'); } - if (!is_null($member_identifier) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_identifier))) { - throw new \InvalidArgumentException("invalid value for $member_identifier when calling MSMerchantCreditHistory., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_identifier)))) { + throw new \InvalidArgumentException("invalid value for \$member_identifier when calling MSMerchantCreditHistory., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_identifier'] = $member_identifier; @@ -368,6 +462,9 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } if ((mb_strlen($mobile_number) < 1)) { throw new \InvalidArgumentException('invalid length for $mobile_number when calling MSMerchantCreditHistory., must be bigger than or equal to 1.'); @@ -397,6 +494,9 @@ public function getCreditAmount() */ public function setCreditAmount($credit_amount) { + if (is_null($credit_amount)) { + throw new \InvalidArgumentException('non-nullable credit_amount cannot be null'); + } if (($credit_amount < 0)) { throw new \InvalidArgumentException('invalid value for $credit_amount when calling MSMerchantCreditHistory., must be bigger than or equal to 0.'); @@ -426,6 +526,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 36)) { throw new \InvalidArgumentException('invalid length for $id when calling MSMerchantCreditHistory., must be smaller than or equal to 36.'); } @@ -457,14 +560,17 @@ public function getMerchantCreditId() */ public function setMerchantCreditId($merchant_credit_id) { + if (is_null($merchant_credit_id)) { + throw new \InvalidArgumentException('non-nullable merchant_credit_id cannot be null'); + } if ((mb_strlen($merchant_credit_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_credit_id when calling MSMerchantCreditHistory., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_credit_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_credit_id when calling MSMerchantCreditHistory., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_credit_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_credit_id when calling MSMerchantCreditHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_credit_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_credit_id when calling MSMerchantCreditHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_credit_id'] = $merchant_credit_id; @@ -491,14 +597,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMerchantCreditHistory., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMerchantCreditHistory., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling MSMerchantCreditHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling MSMerchantCreditHistory., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -525,6 +634,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -549,6 +661,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -560,7 +675,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -572,6 +687,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -585,7 +701,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -601,7 +717,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -613,6 +729,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMerchantCreditHistoryPagination.php b/lib/Model/MSMerchantCreditHistoryPagination.php index ae0c5a4..5bcc99b 100644 --- a/lib/Model/MSMerchantCreditHistoryPagination.php +++ b/lib/Model/MSMerchantCreditHistoryPagination.php @@ -2,7 +2,7 @@ /** * MSMerchantCreditHistoryPagination * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMerchantCreditHistoryPagination implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class MSMerchantCreditHistoryPagination implements ModelInterface, ArrayAccess, 'total' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false, + 'length' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['results'] = $data['results'] ?? null; - $this->container['length'] = $data['length'] ?? null; - $this->container['total'] = $data['total'] ?? null; + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +332,9 @@ public function getResults() */ public function setResults($results) { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } $this->container['results'] = $results; return $this; @@ -270,6 +359,9 @@ public function getLength() */ public function setLength($length) { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } $this->container['length'] = $length; return $this; @@ -294,6 +386,9 @@ public function getTotal() */ public function setTotal($total) { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } $this->container['total'] = $total; return $this; @@ -305,7 +400,7 @@ public function setTotal($total) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMerchantCreditRedemption.php b/lib/Model/MSMerchantCreditRedemption.php index 1c0bbdb..3129c22 100644 --- a/lib/Model/MSMerchantCreditRedemption.php +++ b/lib/Model/MSMerchantCreditRedemption.php @@ -2,7 +2,7 @@ /** * MSMerchantCreditRedemption * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMerchantCreditRedemption implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,9 +59,9 @@ class MSMerchantCreditRedemption implements ModelInterface, ArrayAccess, \JsonSe */ protected static $openAPITypes = [ 'transaction_id' => 'string', - 'transaction_type' => 'string', + 'transaction_type' => '\OpenAPI\Client\Model\MSMemberRedemptionTransactionType', 'amount' => 'int', - 'register_id' => 'string', + 'register_id' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID', 'terminal_type' => 'string', 'id' => 'string', 'merchant_credit_id' => 'string', @@ -92,6 +90,31 @@ class MSMerchantCreditRedemption implements ModelInterface, ArrayAccess, \JsonSe 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'transaction_id' => false, + 'transaction_type' => false, + 'amount' => false, + 'register_id' => false, + 'terminal_type' => false, + 'id' => false, + 'merchant_credit_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['transaction_id'] = $data['transaction_id'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['amount'] = $data['amount'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['terminal_type'] = $data['terminal_type'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_credit_id'] = $data['merchant_credit_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('transaction_id', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('terminal_type', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_credit_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -350,6 +443,9 @@ public function getTransactionId() */ public function setTransactionId($transaction_id) { + if (is_null($transaction_id)) { + throw new \InvalidArgumentException('non-nullable transaction_id cannot be null'); + } if ((mb_strlen($transaction_id) < 1)) { throw new \InvalidArgumentException('invalid length for $transaction_id when calling MSMerchantCreditRedemption., must be bigger than or equal to 1.'); @@ -363,7 +459,7 @@ public function setTransactionId($transaction_id) /** * Gets transaction_type * - * @return string + * @return \OpenAPI\Client\Model\MSMemberRedemptionTransactionType */ public function getTransactionType() { @@ -373,12 +469,15 @@ public function getTransactionType() /** * Sets transaction_type * - * @param string $transaction_type The type of the transaction - either redemption or refund + * @param \OpenAPI\Client\Model\MSMemberRedemptionTransactionType $transaction_type transaction_type * * @return self */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -403,6 +502,9 @@ public function getAmount() */ public function setAmount($amount) { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } if (($amount < 0)) { throw new \InvalidArgumentException('invalid value for $amount when calling MSMerchantCreditRedemption., must be bigger than or equal to 0.'); @@ -416,7 +518,7 @@ public function setAmount($amount) /** * Gets register_id * - * @return string|null + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID|null */ public function getRegisterId() { @@ -426,12 +528,15 @@ public function getRegisterId() /** * Sets register_id * - * @param string|null $register_id The ID of the register where the transaction occurred + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID|null $register_id register_id * * @return self */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -456,6 +561,9 @@ public function getTerminalType() */ public function setTerminalType($terminal_type) { + if (is_null($terminal_type)) { + throw new \InvalidArgumentException('non-nullable terminal_type cannot be null'); + } if ((mb_strlen($terminal_type) < 1)) { throw new \InvalidArgumentException('invalid length for $terminal_type when calling MSMerchantCreditRedemption., must be bigger than or equal to 1.'); @@ -485,6 +593,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 36)) { throw new \InvalidArgumentException('invalid length for $id when calling MSMerchantCreditRedemption., must be smaller than or equal to 36.'); } @@ -516,14 +627,17 @@ public function getMerchantCreditId() */ public function setMerchantCreditId($merchant_credit_id) { + if (is_null($merchant_credit_id)) { + throw new \InvalidArgumentException('non-nullable merchant_credit_id cannot be null'); + } if ((mb_strlen($merchant_credit_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_credit_id when calling MSMerchantCreditRedemption., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_credit_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_credit_id when calling MSMerchantCreditRedemption., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_credit_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_credit_id when calling MSMerchantCreditRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_credit_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_credit_id when calling MSMerchantCreditRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_credit_id'] = $merchant_credit_id; @@ -550,14 +664,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMerchantCreditRedemption., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MSMerchantCreditRedemption., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling MSMerchantCreditRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling MSMerchantCreditRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -584,6 +701,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -608,6 +728,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -619,7 +742,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -631,6 +754,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -644,7 +768,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -660,7 +784,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -672,6 +796,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MSMerchantCreditRedemptionPagination.php b/lib/Model/MSMerchantCreditRedemptionPagination.php index 2c8b07d..582ec40 100644 --- a/lib/Model/MSMerchantCreditRedemptionPagination.php +++ b/lib/Model/MSMerchantCreditRedemptionPagination.php @@ -2,7 +2,7 @@ /** * MSMerchantCreditRedemptionPagination * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MSMerchantCreditRedemptionPagination implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class MSMerchantCreditRedemptionPagination implements ModelInterface, ArrayAcces 'total' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false, + 'length' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['results'] = $data['results'] ?? null; - $this->container['length'] = $data['length'] ?? null; - $this->container['total'] = $data['total'] ?? null; + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +332,9 @@ public function getResults() */ public function setResults($results) { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } $this->container['results'] = $results; return $this; @@ -270,6 +359,9 @@ public function getLength() */ public function setLength($length) { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } $this->container['length'] = $length; return $this; @@ -294,6 +386,9 @@ public function getTotal() */ public function setTotal($total) { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } $this->container['total'] = $total; return $this; @@ -305,7 +400,7 @@ public function setTotal($total) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MediaFile.php b/lib/Model/MediaFile.php index 45aa696..b2fa5be 100644 --- a/lib/Model/MediaFile.php +++ b/lib/Model/MediaFile.php @@ -2,7 +2,7 @@ /** * MediaFile * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MediaFile implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -67,7 +65,7 @@ class MediaFile implements ModelInterface, ArrayAccess, \JsonSerializable 'file_url' => 'string', 'file_type' => 'string', 'file_name' => 'string', - 'file_size' => 'double', + 'file_size' => 'float', 'folder' => 'string', 'employee_id' => 'string' ]; @@ -92,6 +90,31 @@ class MediaFile implements ModelInterface, ArrayAccess, \JsonSerializable 'employee_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'merchant_id' => false, + 'file_url' => false, + 'file_type' => false, + 'file_name' => false, + 'file_size' => false, + 'folder' => false, + 'employee_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['file_url'] = $data['file_url'] ?? null; - $this->container['file_type'] = $data['file_type'] ?? null; - $this->container['file_name'] = $data['file_name'] ?? null; - $this->container['file_size'] = $data['file_size'] ?? null; - $this->container['folder'] = $data['folder'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('file_url', $data ?? [], null); + $this->setIfExists('file_type', $data ?? [], null); + $this->setIfExists('file_name', $data ?? [], null); + $this->setIfExists('file_size', $data ?? [], null); + $this->setIfExists('folder', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -345,14 +438,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling MediaFile., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling MediaFile., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling MediaFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling MediaFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -379,6 +475,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -403,6 +502,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -427,14 +529,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MediaFile., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MediaFile., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling MediaFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling MediaFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -461,6 +566,9 @@ public function getFileUrl() */ public function setFileUrl($file_url) { + if (is_null($file_url)) { + throw new \InvalidArgumentException('non-nullable file_url cannot be null'); + } $this->container['file_url'] = $file_url; return $this; @@ -485,6 +593,9 @@ public function getFileType() */ public function setFileType($file_type) { + if (is_null($file_type)) { + throw new \InvalidArgumentException('non-nullable file_type cannot be null'); + } $this->container['file_type'] = $file_type; return $this; @@ -509,6 +620,9 @@ public function getFileName() */ public function setFileName($file_name) { + if (is_null($file_name)) { + throw new \InvalidArgumentException('non-nullable file_name cannot be null'); + } $this->container['file_name'] = $file_name; return $this; @@ -517,7 +631,7 @@ public function setFileName($file_name) /** * Gets file_size * - * @return double + * @return float */ public function getFileSize() { @@ -527,12 +641,15 @@ public function getFileSize() /** * Sets file_size * - * @param double $file_size The size of the file + * @param float $file_size The size of the file * * @return self */ public function setFileSize($file_size) { + if (is_null($file_size)) { + throw new \InvalidArgumentException('non-nullable file_size cannot be null'); + } $this->container['file_size'] = $file_size; return $this; @@ -557,6 +674,9 @@ public function getFolder() */ public function setFolder($folder) { + if (is_null($folder)) { + throw new \InvalidArgumentException('non-nullable folder cannot be null'); + } $this->container['folder'] = $folder; return $this; @@ -581,14 +701,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling MediaFile., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling MediaFile., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling MediaFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling MediaFile., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -602,7 +725,7 @@ public function setEmployeeId($employee_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -614,6 +737,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -627,7 +751,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -643,7 +767,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -655,6 +779,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Member.php b/lib/Model/Member.php index 6b4d938..d29e560 100644 --- a/lib/Model/Member.php +++ b/lib/Model/Member.php @@ -2,7 +2,7 @@ /** * Member * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Member implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,6 +67,8 @@ class Member implements ModelInterface, ArrayAccess, \JsonSerializable 'last_name' => 'string', 'membership_tier_id' => 'string', 'mobile_number' => 'string', + 'email' => 'string', + 'birthday' => 'string', 'points_accrued' => 'int', 'member_id' => 'string', 'membership_tier_redeemable_id' => 'string' @@ -91,11 +91,42 @@ class Member implements ModelInterface, ArrayAccess, \JsonSerializable 'last_name' => null, 'membership_tier_id' => null, 'mobile_number' => null, + 'email' => null, + 'birthday' => null, 'points_accrued' => 'int32', 'member_id' => null, 'membership_tier_redeemable_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'first_name' => false, + 'last_name' => false, + 'membership_tier_id' => false, + 'mobile_number' => false, + 'email' => false, + 'birthday' => false, + 'points_accrued' => false, + 'member_id' => false, + 'membership_tier_redeemable_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -116,6 +147,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -132,6 +215,8 @@ public static function openAPIFormats() 'last_name' => 'lastName', 'membership_tier_id' => 'membershipTierID', 'mobile_number' => 'mobileNumber', + 'email' => 'email', + 'birthday' => 'birthday', 'points_accrued' => 'pointsAccrued', 'member_id' => 'memberID', 'membership_tier_redeemable_id' => 'membershipTierRedeemableID' @@ -152,6 +237,8 @@ public static function openAPIFormats() 'last_name' => 'setLastName', 'membership_tier_id' => 'setMembershipTierId', 'mobile_number' => 'setMobileNumber', + 'email' => 'setEmail', + 'birthday' => 'setBirthday', 'points_accrued' => 'setPointsAccrued', 'member_id' => 'setMemberId', 'membership_tier_redeemable_id' => 'setMembershipTierRedeemableId' @@ -172,6 +259,8 @@ public static function openAPIFormats() 'last_name' => 'getLastName', 'membership_tier_id' => 'getMembershipTierId', 'mobile_number' => 'getMobileNumber', + 'email' => 'getEmail', + 'birthday' => 'getBirthday', 'points_accrued' => 'getPointsAccrued', 'member_id' => 'getMemberId', 'membership_tier_redeemable_id' => 'getMembershipTierRedeemableId' @@ -234,18 +323,38 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['membership_tier_id'] = $data['membership_tier_id'] ?? null; - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['points_accrued'] = $data['points_accrued'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['membership_tier_redeemable_id'] = $data['membership_tier_redeemable_id'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('membership_tier_id', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('birthday', $data ?? [], null); + $this->setIfExists('points_accrued', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('membership_tier_redeemable_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -314,6 +423,12 @@ public function listInvalidProperties() if ($this->container['mobile_number'] === null) { $invalidProperties[] = "'mobile_number' can't be null"; } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['birthday'] === null) { + $invalidProperties[] = "'birthday' can't be null"; + } if ($this->container['points_accrued'] === null) { $invalidProperties[] = "'points_accrued' can't be null"; } @@ -381,14 +496,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 12)) { throw new \InvalidArgumentException('invalid length for $id when calling Member., must be smaller than or equal to 12.'); } if ((mb_strlen($id) < 12)) { throw new \InvalidArgumentException('invalid length for $id when calling Member., must be bigger than or equal to 12.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling Member., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling Member., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -415,14 +533,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Member., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Member., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Member., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Member., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -449,6 +570,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -473,6 +597,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -497,6 +624,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -521,6 +651,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } $this->container['first_name'] = $first_name; return $this; @@ -545,6 +678,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } $this->container['last_name'] = $last_name; return $this; @@ -569,14 +705,17 @@ public function getMembershipTierId() */ public function setMembershipTierId($membership_tier_id) { + if (is_null($membership_tier_id)) { + throw new \InvalidArgumentException('non-nullable membership_tier_id cannot be null'); + } if ((mb_strlen($membership_tier_id) > 12)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling Member., must be smaller than or equal to 12.'); } if ((mb_strlen($membership_tier_id) < 12)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling Member., must be bigger than or equal to 12.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $membership_tier_id))) { - throw new \InvalidArgumentException("invalid value for $membership_tier_id when calling Member., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($membership_tier_id)))) { + throw new \InvalidArgumentException("invalid value for \$membership_tier_id when calling Member., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['membership_tier_id'] = $membership_tier_id; @@ -603,11 +742,68 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } $this->container['mobile_number'] = $mobile_number; return $this; } + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets birthday + * + * @return string + */ + public function getBirthday() + { + return $this->container['birthday']; + } + + /** + * Sets birthday + * + * @param string $birthday Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured + * + * @return self + */ + public function setBirthday($birthday) + { + if (is_null($birthday)) { + throw new \InvalidArgumentException('non-nullable birthday cannot be null'); + } + $this->container['birthday'] = $birthday; + + return $this; + } + /** * Gets points_accrued * @@ -627,6 +823,9 @@ public function getPointsAccrued() */ public function setPointsAccrued($points_accrued) { + if (is_null($points_accrued)) { + throw new \InvalidArgumentException('non-nullable points_accrued cannot be null'); + } if (($points_accrued < 0)) { throw new \InvalidArgumentException('invalid value for $points_accrued when calling Member., must be bigger than or equal to 0.'); @@ -656,12 +855,15 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } if ((mb_strlen($member_id) < 1)) { throw new \InvalidArgumentException('invalid length for $member_id when calling Member., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling Member., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling Member., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['member_id'] = $member_id; @@ -688,14 +890,17 @@ public function getMembershipTierRedeemableId() */ public function setMembershipTierRedeemableId($membership_tier_redeemable_id) { + if (is_null($membership_tier_redeemable_id)) { + throw new \InvalidArgumentException('non-nullable membership_tier_redeemable_id cannot be null'); + } if ((mb_strlen($membership_tier_redeemable_id) > 12)) { throw new \InvalidArgumentException('invalid length for $membership_tier_redeemable_id when calling Member., must be smaller than or equal to 12.'); } if ((mb_strlen($membership_tier_redeemable_id) < 12)) { throw new \InvalidArgumentException('invalid length for $membership_tier_redeemable_id when calling Member., must be bigger than or equal to 12.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $membership_tier_redeemable_id))) { - throw new \InvalidArgumentException("invalid value for $membership_tier_redeemable_id when calling Member., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($membership_tier_redeemable_id)))) { + throw new \InvalidArgumentException("invalid value for \$membership_tier_redeemable_id when calling Member., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['membership_tier_redeemable_id'] = $membership_tier_redeemable_id; @@ -709,7 +914,7 @@ public function setMembershipTierRedeemableId($membership_tier_redeemable_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -721,6 +926,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -734,7 +940,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -750,7 +956,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -762,6 +968,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MemberSearch.php b/lib/Model/MemberSearch.php index 9e82c10..200cb43 100644 --- a/lib/Model/MemberSearch.php +++ b/lib/Model/MemberSearch.php @@ -2,7 +2,7 @@ /** * MemberSearch * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MemberSearch implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,9 +61,9 @@ class MemberSearch implements ModelInterface, ArrayAccess, \JsonSerializable 'is_archive_included' => 'bool', 'page_size' => 'int', 'page_num' => 'int', - 'sort_order' => 'string', - 'sort_key' => 'string', - 'search_key' => 'string', + 'sort_order' => '\OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder', + 'sort_key' => '\OpenAPI\Client\Model\MemberSearchSortKey', + 'search_key' => '\OpenAPI\Client\Model\MemberSearchSearchKey', 'search_value' => 'string' ]; @@ -86,6 +84,28 @@ class MemberSearch implements ModelInterface, ArrayAccess, \JsonSerializable 'search_value' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'is_archive_included' => false, + 'page_size' => false, + 'page_num' => false, + 'sort_order' => false, + 'sort_key' => false, + 'search_key' => false, + 'search_value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +126,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -209,13 +281,31 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['is_archive_included'] = $data['is_archive_included'] ?? null; - $this->container['page_size'] = $data['page_size'] ?? null; - $this->container['page_num'] = $data['page_num'] ?? null; - $this->container['sort_order'] = $data['sort_order'] ?? null; - $this->container['sort_key'] = $data['sort_key'] ?? null; - $this->container['search_key'] = $data['search_key'] ?? null; - $this->container['search_value'] = $data['search_value'] ?? null; + $this->setIfExists('is_archive_included', $data ?? [], null); + $this->setIfExists('page_size', $data ?? [], null); + $this->setIfExists('page_num', $data ?? [], null); + $this->setIfExists('sort_order', $data ?? [], null); + $this->setIfExists('sort_key', $data ?? [], null); + $this->setIfExists('search_key', $data ?? [], null); + $this->setIfExists('search_value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -267,6 +357,9 @@ public function getIsArchiveIncluded() */ public function setIsArchiveIncluded($is_archive_included) { + if (is_null($is_archive_included)) { + throw new \InvalidArgumentException('non-nullable is_archive_included cannot be null'); + } $this->container['is_archive_included'] = $is_archive_included; return $this; @@ -291,6 +384,9 @@ public function getPageSize() */ public function setPageSize($page_size) { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } $this->container['page_size'] = $page_size; return $this; @@ -315,6 +411,9 @@ public function getPageNum() */ public function setPageNum($page_num) { + if (is_null($page_num)) { + throw new \InvalidArgumentException('non-nullable page_num cannot be null'); + } $this->container['page_num'] = $page_num; return $this; @@ -323,7 +422,7 @@ public function setPageNum($page_num) /** * Gets sort_order * - * @return string|null + * @return \OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder|null */ public function getSortOrder() { @@ -333,12 +432,15 @@ public function getSortOrder() /** * Sets sort_order * - * @param string|null $sort_order Denotes the sort order + * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder|null $sort_order sort_order * * @return self */ public function setSortOrder($sort_order) { + if (is_null($sort_order)) { + throw new \InvalidArgumentException('non-nullable sort_order cannot be null'); + } $this->container['sort_order'] = $sort_order; return $this; @@ -347,7 +449,7 @@ public function setSortOrder($sort_order) /** * Gets sort_key * - * @return string|null + * @return \OpenAPI\Client\Model\MemberSearchSortKey|null */ public function getSortKey() { @@ -357,12 +459,15 @@ public function getSortKey() /** * Sets sort_key * - * @param string|null $sort_key Denotes the key using which the records need to be sorted + * @param \OpenAPI\Client\Model\MemberSearchSortKey|null $sort_key sort_key * * @return self */ public function setSortKey($sort_key) { + if (is_null($sort_key)) { + throw new \InvalidArgumentException('non-nullable sort_key cannot be null'); + } $this->container['sort_key'] = $sort_key; return $this; @@ -371,7 +476,7 @@ public function setSortKey($sort_key) /** * Gets search_key * - * @return string + * @return \OpenAPI\Client\Model\MemberSearchSearchKey */ public function getSearchKey() { @@ -381,12 +486,15 @@ public function getSearchKey() /** * Sets search_key * - * @param string $search_key The search key to be used + * @param \OpenAPI\Client\Model\MemberSearchSearchKey $search_key search_key * * @return self */ public function setSearchKey($search_key) { + if (is_null($search_key)) { + throw new \InvalidArgumentException('non-nullable search_key cannot be null'); + } $this->container['search_key'] = $search_key; return $this; @@ -411,6 +519,9 @@ public function getSearchValue() */ public function setSearchValue($search_value) { + if (is_null($search_value)) { + throw new \InvalidArgumentException('non-nullable search_value cannot be null'); + } $this->container['search_value'] = $search_value; return $this; @@ -422,7 +533,7 @@ public function setSearchValue($search_value) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +545,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +559,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +575,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +587,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MemberSearchSearchKey.php b/lib/Model/MemberSearchSearchKey.php new file mode 100644 index 0000000..a25bcde --- /dev/null +++ b/lib/Model/MemberSearchSearchKey.php @@ -0,0 +1,383 @@ + + */ +class MemberSearchSearchKey implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MemberSearch_searchKey'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/MemberSearchSortKey.php b/lib/Model/MemberSearchSortKey.php new file mode 100644 index 0000000..3ecb59b --- /dev/null +++ b/lib/Model/MemberSearchSortKey.php @@ -0,0 +1,383 @@ + + */ +class MemberSearchSortKey implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MemberSearch_sortKey'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Merchant.php b/lib/Model/Merchant.php index ed25a3e..d7e4ed4 100644 --- a/lib/Model/Merchant.php +++ b/lib/Model/Merchant.php @@ -2,7 +2,7 @@ /** * Merchant * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Merchant implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -83,7 +81,7 @@ class Merchant implements ModelInterface, ArrayAccess, \JsonSerializable 'stripe_customer_id' => 'string', 'is_payment_method_provided' => 'bool', 'plan_nickname' => 'string', - 'max_sms_count' => 'double', + 'max_sms_count' => 'float', 'is_sms_agreement' => 'bool', 'is_white_labeled' => 'bool', 'is_featured' => 'bool' @@ -126,6 +124,48 @@ class Merchant implements ModelInterface, ArrayAccess, \JsonSerializable 'is_featured' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'company_name' => false, + 'address1' => false, + 'address2' => false, + 'city' => false, + 'state' => false, + 'country' => false, + 'phone_number' => false, + 'zip' => false, + 'currency_abbreviation' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'industry' => false, + 'industry_name' => false, + 'info_genesis_property_id' => false, + 'is_frozen' => false, + 'billing_contact_employee_id' => false, + 'marketing_contact_employee_id' => false, + 'technical_contact_employee_id' => false, + 'customer_service_contact_employee_id' => false, + 'stripe_customer_id' => false, + 'is_payment_method_provided' => false, + 'plan_nickname' => false, + 'max_sms_count' => false, + 'is_sms_agreement' => false, + 'is_white_labeled' => false, + 'is_featured' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -146,6 +186,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -309,33 +401,51 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['company_name'] = $data['company_name'] ?? null; - $this->container['address1'] = $data['address1'] ?? null; - $this->container['address2'] = $data['address2'] ?? null; - $this->container['city'] = $data['city'] ?? null; - $this->container['state'] = $data['state'] ?? null; - $this->container['country'] = $data['country'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['zip'] = $data['zip'] ?? null; - $this->container['currency_abbreviation'] = $data['currency_abbreviation'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['industry'] = $data['industry'] ?? null; - $this->container['industry_name'] = $data['industry_name'] ?? null; - $this->container['info_genesis_property_id'] = $data['info_genesis_property_id'] ?? null; - $this->container['is_frozen'] = $data['is_frozen'] ?? null; - $this->container['billing_contact_employee_id'] = $data['billing_contact_employee_id'] ?? null; - $this->container['marketing_contact_employee_id'] = $data['marketing_contact_employee_id'] ?? null; - $this->container['technical_contact_employee_id'] = $data['technical_contact_employee_id'] ?? null; - $this->container['customer_service_contact_employee_id'] = $data['customer_service_contact_employee_id'] ?? null; - $this->container['stripe_customer_id'] = $data['stripe_customer_id'] ?? null; - $this->container['is_payment_method_provided'] = $data['is_payment_method_provided'] ?? null; - $this->container['plan_nickname'] = $data['plan_nickname'] ?? null; - $this->container['max_sms_count'] = $data['max_sms_count'] ?? null; - $this->container['is_sms_agreement'] = $data['is_sms_agreement'] ?? null; - $this->container['is_white_labeled'] = $data['is_white_labeled'] ?? null; - $this->container['is_featured'] = $data['is_featured'] ?? null; + $this->setIfExists('company_name', $data ?? [], null); + $this->setIfExists('address1', $data ?? [], null); + $this->setIfExists('address2', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('zip', $data ?? [], null); + $this->setIfExists('currency_abbreviation', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('industry', $data ?? [], null); + $this->setIfExists('industry_name', $data ?? [], null); + $this->setIfExists('info_genesis_property_id', $data ?? [], null); + $this->setIfExists('is_frozen', $data ?? [], null); + $this->setIfExists('billing_contact_employee_id', $data ?? [], null); + $this->setIfExists('marketing_contact_employee_id', $data ?? [], null); + $this->setIfExists('technical_contact_employee_id', $data ?? [], null); + $this->setIfExists('customer_service_contact_employee_id', $data ?? [], null); + $this->setIfExists('stripe_customer_id', $data ?? [], null); + $this->setIfExists('is_payment_method_provided', $data ?? [], null); + $this->setIfExists('plan_nickname', $data ?? [], null); + $this->setIfExists('max_sms_count', $data ?? [], null); + $this->setIfExists('is_sms_agreement', $data ?? [], null); + $this->setIfExists('is_white_labeled', $data ?? [], null); + $this->setIfExists('is_featured', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -462,6 +572,9 @@ public function getCompanyName() */ public function setCompanyName($company_name) { + if (is_null($company_name)) { + throw new \InvalidArgumentException('non-nullable company_name cannot be null'); + } $this->container['company_name'] = $company_name; return $this; @@ -486,6 +599,9 @@ public function getAddress1() */ public function setAddress1($address1) { + if (is_null($address1)) { + throw new \InvalidArgumentException('non-nullable address1 cannot be null'); + } $this->container['address1'] = $address1; return $this; @@ -510,6 +626,9 @@ public function getAddress2() */ public function setAddress2($address2) { + if (is_null($address2)) { + throw new \InvalidArgumentException('non-nullable address2 cannot be null'); + } $this->container['address2'] = $address2; return $this; @@ -534,6 +653,9 @@ public function getCity() */ public function setCity($city) { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } $this->container['city'] = $city; return $this; @@ -558,6 +680,9 @@ public function getState() */ public function setState($state) { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } $this->container['state'] = $state; return $this; @@ -582,6 +707,9 @@ public function getCountry() */ public function setCountry($country) { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } $this->container['country'] = $country; return $this; @@ -606,6 +734,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -630,6 +761,9 @@ public function getZip() */ public function setZip($zip) { + if (is_null($zip)) { + throw new \InvalidArgumentException('non-nullable zip cannot be null'); + } $this->container['zip'] = $zip; return $this; @@ -654,6 +788,9 @@ public function getCurrencyAbbreviation() */ public function setCurrencyAbbreviation($currency_abbreviation) { + if (is_null($currency_abbreviation)) { + throw new \InvalidArgumentException('non-nullable currency_abbreviation cannot be null'); + } $this->container['currency_abbreviation'] = $currency_abbreviation; return $this; @@ -678,14 +815,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Merchant., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Merchant., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling Merchant., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling Merchant., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -712,6 +852,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -736,6 +879,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -760,6 +906,9 @@ public function getIndustry() */ public function setIndustry($industry) { + if (is_null($industry)) { + throw new \InvalidArgumentException('non-nullable industry cannot be null'); + } $this->container['industry'] = $industry; return $this; @@ -784,6 +933,9 @@ public function getIndustryName() */ public function setIndustryName($industry_name) { + if (is_null($industry_name)) { + throw new \InvalidArgumentException('non-nullable industry_name cannot be null'); + } $this->container['industry_name'] = $industry_name; return $this; @@ -808,6 +960,9 @@ public function getInfoGenesisPropertyId() */ public function setInfoGenesisPropertyId($info_genesis_property_id) { + if (is_null($info_genesis_property_id)) { + throw new \InvalidArgumentException('non-nullable info_genesis_property_id cannot be null'); + } $this->container['info_genesis_property_id'] = $info_genesis_property_id; return $this; @@ -832,6 +987,9 @@ public function getIsFrozen() */ public function setIsFrozen($is_frozen) { + if (is_null($is_frozen)) { + throw new \InvalidArgumentException('non-nullable is_frozen cannot be null'); + } $this->container['is_frozen'] = $is_frozen; return $this; @@ -856,6 +1014,9 @@ public function getBillingContactEmployeeId() */ public function setBillingContactEmployeeId($billing_contact_employee_id) { + if (is_null($billing_contact_employee_id)) { + throw new \InvalidArgumentException('non-nullable billing_contact_employee_id cannot be null'); + } $this->container['billing_contact_employee_id'] = $billing_contact_employee_id; return $this; @@ -880,6 +1041,9 @@ public function getMarketingContactEmployeeId() */ public function setMarketingContactEmployeeId($marketing_contact_employee_id) { + if (is_null($marketing_contact_employee_id)) { + throw new \InvalidArgumentException('non-nullable marketing_contact_employee_id cannot be null'); + } $this->container['marketing_contact_employee_id'] = $marketing_contact_employee_id; return $this; @@ -904,6 +1068,9 @@ public function getTechnicalContactEmployeeId() */ public function setTechnicalContactEmployeeId($technical_contact_employee_id) { + if (is_null($technical_contact_employee_id)) { + throw new \InvalidArgumentException('non-nullable technical_contact_employee_id cannot be null'); + } $this->container['technical_contact_employee_id'] = $technical_contact_employee_id; return $this; @@ -928,6 +1095,9 @@ public function getCustomerServiceContactEmployeeId() */ public function setCustomerServiceContactEmployeeId($customer_service_contact_employee_id) { + if (is_null($customer_service_contact_employee_id)) { + throw new \InvalidArgumentException('non-nullable customer_service_contact_employee_id cannot be null'); + } $this->container['customer_service_contact_employee_id'] = $customer_service_contact_employee_id; return $this; @@ -952,6 +1122,9 @@ public function getStripeCustomerId() */ public function setStripeCustomerId($stripe_customer_id) { + if (is_null($stripe_customer_id)) { + throw new \InvalidArgumentException('non-nullable stripe_customer_id cannot be null'); + } $this->container['stripe_customer_id'] = $stripe_customer_id; return $this; @@ -976,6 +1149,9 @@ public function getIsPaymentMethodProvided() */ public function setIsPaymentMethodProvided($is_payment_method_provided) { + if (is_null($is_payment_method_provided)) { + throw new \InvalidArgumentException('non-nullable is_payment_method_provided cannot be null'); + } $this->container['is_payment_method_provided'] = $is_payment_method_provided; return $this; @@ -1000,6 +1176,9 @@ public function getPlanNickname() */ public function setPlanNickname($plan_nickname) { + if (is_null($plan_nickname)) { + throw new \InvalidArgumentException('non-nullable plan_nickname cannot be null'); + } $this->container['plan_nickname'] = $plan_nickname; return $this; @@ -1008,7 +1187,7 @@ public function setPlanNickname($plan_nickname) /** * Gets max_sms_count * - * @return double + * @return float */ public function getMaxSmsCount() { @@ -1018,12 +1197,15 @@ public function getMaxSmsCount() /** * Sets max_sms_count * - * @param double $max_sms_count max_sms_count + * @param float $max_sms_count max_sms_count * * @return self */ public function setMaxSmsCount($max_sms_count) { + if (is_null($max_sms_count)) { + throw new \InvalidArgumentException('non-nullable max_sms_count cannot be null'); + } $this->container['max_sms_count'] = $max_sms_count; return $this; @@ -1048,6 +1230,9 @@ public function getIsSmsAgreement() */ public function setIsSmsAgreement($is_sms_agreement) { + if (is_null($is_sms_agreement)) { + throw new \InvalidArgumentException('non-nullable is_sms_agreement cannot be null'); + } $this->container['is_sms_agreement'] = $is_sms_agreement; return $this; @@ -1072,6 +1257,9 @@ public function getIsWhiteLabeled() */ public function setIsWhiteLabeled($is_white_labeled) { + if (is_null($is_white_labeled)) { + throw new \InvalidArgumentException('non-nullable is_white_labeled cannot be null'); + } $this->container['is_white_labeled'] = $is_white_labeled; return $this; @@ -1096,6 +1284,9 @@ public function getIsFeatured() */ public function setIsFeatured($is_featured) { + if (is_null($is_featured)) { + throw new \InvalidArgumentException('non-nullable is_featured cannot be null'); + } $this->container['is_featured'] = $is_featured; return $this; @@ -1107,7 +1298,7 @@ public function setIsFeatured($is_featured) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1119,6 +1310,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1132,7 +1324,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1148,7 +1340,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1160,6 +1352,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MerchantCreditSearch.php b/lib/Model/MerchantCreditSearch.php index 9806c74..dbab28c 100644 --- a/lib/Model/MerchantCreditSearch.php +++ b/lib/Model/MerchantCreditSearch.php @@ -2,7 +2,7 @@ /** * MerchantCreditSearch * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MerchantCreditSearch implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -80,6 +78,25 @@ class MerchantCreditSearch implements ModelInterface, ArrayAccess, \JsonSerializ 'key' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'is_archive_included' => false, + 'page_size' => false, + 'page_num' => false, + 'key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +117,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -194,10 +263,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['is_archive_included'] = $data['is_archive_included'] ?? null; - $this->container['page_size'] = $data['page_size'] ?? null; - $this->container['page_num'] = $data['page_num'] ?? null; - $this->container['key'] = $data['key'] ?? null; + $this->setIfExists('is_archive_included', $data ?? [], null); + $this->setIfExists('page_size', $data ?? [], null); + $this->setIfExists('page_num', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +333,9 @@ public function getIsArchiveIncluded() */ public function setIsArchiveIncluded($is_archive_included) { + if (is_null($is_archive_included)) { + throw new \InvalidArgumentException('non-nullable is_archive_included cannot be null'); + } $this->container['is_archive_included'] = $is_archive_included; return $this; @@ -270,6 +360,9 @@ public function getPageSize() */ public function setPageSize($page_size) { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } $this->container['page_size'] = $page_size; return $this; @@ -294,6 +387,9 @@ public function getPageNum() */ public function setPageNum($page_num) { + if (is_null($page_num)) { + throw new \InvalidArgumentException('non-nullable page_num cannot be null'); + } $this->container['page_num'] = $page_num; return $this; @@ -318,6 +414,9 @@ public function getKey() */ public function setKey($key) { + if (is_null($key)) { + throw new \InvalidArgumentException('non-nullable key cannot be null'); + } $this->container['key'] = $key; return $this; @@ -329,7 +428,7 @@ public function setKey($key) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -341,6 +440,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -354,7 +454,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -370,7 +470,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -382,6 +482,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MerchantNotInitialized.php b/lib/Model/MerchantNotInitialized.php index f0d3f27..61bd4d5 100644 --- a/lib/Model/MerchantNotInitialized.php +++ b/lib/Model/MerchantNotInitialized.php @@ -2,7 +2,7 @@ /** * MerchantNotInitialized * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MerchantNotInitialized implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class MerchantNotInitialized implements ModelInterface, ArrayAccess, \JsonSerial 'name' => 'string', 'message' => 'string', 'stack' => 'string', - 'http_error_code' => 'double', + 'http_error_code' => 'float', 'tracking_code' => 'string' ]; @@ -82,6 +80,26 @@ class MerchantNotInitialized implements ModelInterface, ArrayAccess, \JsonSerial 'tracking_code' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'stack' => false, + 'http_error_code' => false, + 'tracking_code' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['stack'] = $data['stack'] ?? null; - $this->container['http_error_code'] = $data['http_error_code'] ?? null; - $this->container['tracking_code'] = $data['tracking_code'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('stack', $data ?? [], null); + $this->setIfExists('http_error_code', $data ?? [], null); + $this->setIfExists('tracking_code', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -261,6 +349,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -285,6 +376,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -309,6 +403,9 @@ public function getStack() */ public function setStack($stack) { + if (is_null($stack)) { + throw new \InvalidArgumentException('non-nullable stack cannot be null'); + } $this->container['stack'] = $stack; return $this; @@ -317,7 +414,7 @@ public function setStack($stack) /** * Gets http_error_code * - * @return double + * @return float */ public function getHttpErrorCode() { @@ -327,12 +424,15 @@ public function getHttpErrorCode() /** * Sets http_error_code * - * @param double $http_error_code http_error_code + * @param float $http_error_code http_error_code * * @return self */ public function setHttpErrorCode($http_error_code) { + if (is_null($http_error_code)) { + throw new \InvalidArgumentException('non-nullable http_error_code cannot be null'); + } $this->container['http_error_code'] = $http_error_code; return $this; @@ -357,6 +457,9 @@ public function getTrackingCode() */ public function setTrackingCode($tracking_code) { + if (is_null($tracking_code)) { + throw new \InvalidArgumentException('non-nullable tracking_code cannot be null'); + } $this->container['tracking_code'] = $tracking_code; return $this; @@ -368,7 +471,7 @@ public function setTrackingCode($tracking_code) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -380,6 +483,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -393,7 +497,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -409,7 +513,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -421,6 +525,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MerchantURL.php b/lib/Model/MerchantURL.php index bb9ebbb..4c816e0 100644 --- a/lib/Model/MerchantURL.php +++ b/lib/Model/MerchantURL.php @@ -2,7 +2,7 @@ /** * MerchantURL * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MerchantURL implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class MerchantURL implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'nickname' => 'string', 'destination_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'merchant_id' => 'string', @@ -86,6 +84,28 @@ class MerchantURL implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'nickname' => false, + 'destination_url' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'merchant_id' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +126,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -209,13 +281,31 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['nickname'] = $data['nickname'] ?? null; - $this->container['destination_url'] = $data['destination_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('nickname', $data ?? [], null); + $this->setIfExists('destination_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -302,6 +392,9 @@ public function getNickname() */ public function setNickname($nickname) { + if (is_null($nickname)) { + throw new \InvalidArgumentException('non-nullable nickname cannot be null'); + } if ((mb_strlen($nickname) < 1)) { throw new \InvalidArgumentException('invalid length for $nickname when calling MerchantURL., must be bigger than or equal to 1.'); @@ -331,6 +424,9 @@ public function getDestinationUrl() */ public function setDestinationUrl($destination_url) { + if (is_null($destination_url)) { + throw new \InvalidArgumentException('non-nullable destination_url cannot be null'); + } if ((mb_strlen($destination_url) < 1)) { throw new \InvalidArgumentException('invalid length for $destination_url when calling MerchantURL., must be bigger than or equal to 1.'); @@ -344,7 +440,7 @@ public function setDestinationUrl($destination_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -354,12 +450,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -384,6 +483,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -408,6 +510,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -432,14 +537,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MerchantURL., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling MerchantURL., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling MerchantURL., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling MerchantURL., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -466,6 +574,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -477,7 +588,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -489,6 +600,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -502,7 +614,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -518,7 +630,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -530,6 +642,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Message.php b/lib/Model/Message.php index b6d38f5..13945ad 100644 --- a/lib/Model/Message.php +++ b/lib/Model/Message.php @@ -2,7 +2,7 @@ /** * Message * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Message implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -88,6 +86,29 @@ class Message implements ModelInterface, ArrayAccess, \JsonSerializable 'body' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'to_employee' => false, + 'from_employee' => false, + 'is_read' => false, + 'subject' => false, + 'body' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -214,14 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['to_employee'] = $data['to_employee'] ?? null; - $this->container['from_employee'] = $data['from_employee'] ?? null; - $this->container['is_read'] = $data['is_read'] ?? null; - $this->container['subject'] = $data['subject'] ?? null; - $this->container['body'] = $data['body'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('to_employee', $data ?? [], null); + $this->setIfExists('from_employee', $data ?? [], null); + $this->setIfExists('is_read', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -297,14 +388,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Message., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Message., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling Message., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling Message., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -331,6 +425,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -355,6 +452,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -379,6 +479,9 @@ public function getToEmployee() */ public function setToEmployee($to_employee) { + if (is_null($to_employee)) { + throw new \InvalidArgumentException('non-nullable to_employee cannot be null'); + } $this->container['to_employee'] = $to_employee; return $this; @@ -403,6 +506,9 @@ public function getFromEmployee() */ public function setFromEmployee($from_employee) { + if (is_null($from_employee)) { + throw new \InvalidArgumentException('non-nullable from_employee cannot be null'); + } $this->container['from_employee'] = $from_employee; return $this; @@ -427,6 +533,9 @@ public function getIsRead() */ public function setIsRead($is_read) { + if (is_null($is_read)) { + throw new \InvalidArgumentException('non-nullable is_read cannot be null'); + } $this->container['is_read'] = $is_read; return $this; @@ -451,6 +560,9 @@ public function getSubject() */ public function setSubject($subject) { + if (is_null($subject)) { + throw new \InvalidArgumentException('non-nullable subject cannot be null'); + } $this->container['subject'] = $subject; return $this; @@ -475,6 +587,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } $this->container['body'] = $body; return $this; @@ -486,7 +601,7 @@ public function setBody($body) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -498,6 +613,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -511,7 +627,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -527,7 +643,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -539,6 +655,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MessageDirection.php b/lib/Model/MessageDirection.php index bd5ec3c..d2fd3f8 100644 --- a/lib/Model/MessageDirection.php +++ b/lib/Model/MessageDirection.php @@ -2,7 +2,7 @@ /** * MessageDirection * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MessageDirection implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class MessageDirection implements ModelInterface, ArrayAccess, \JsonSerializable ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -181,6 +247,24 @@ public function __construct(array $data = null) { } + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + /** * Show all the invalid properties with reasons. * @@ -211,7 +295,7 @@ public function valid() * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -223,6 +307,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -236,7 +321,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -252,7 +337,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -264,6 +349,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/MessageStatus.php b/lib/Model/MessageStatus.php index c5046a2..b2ffd23 100644 --- a/lib/Model/MessageStatus.php +++ b/lib/Model/MessageStatus.php @@ -2,7 +2,7 @@ /** * MessageStatus * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class MessageStatus implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class MessageStatus implements ModelInterface, ArrayAccess, \JsonSerializable ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -181,6 +247,24 @@ public function __construct(array $data = null) { } + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + /** * Show all the invalid properties with reasons. * @@ -211,7 +295,7 @@ public function valid() * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -223,6 +307,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -236,7 +321,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -252,7 +337,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -264,6 +349,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 92a537d..e2376fc 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client\Model @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -93,4 +93,20 @@ public function listInvalidProperties(); * @return bool */ public function valid(); + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool; + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool; } diff --git a/lib/Model/ModuleError.php b/lib/Model/ModuleError.php index 0a79565..d77f2aa 100644 --- a/lib/Model/ModuleError.php +++ b/lib/Model/ModuleError.php @@ -2,7 +2,7 @@ /** * ModuleError * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ModuleError implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -73,7 +71,7 @@ class ModuleError implements ModelInterface, ArrayAccess, \JsonSerializable 'method_type' => 'string', 'stack_trace' => 'mixed', 'exception' => 'mixed', - 'severity' => 'double', + 'severity' => 'float', 'microservice_url' => 'string', 'microservice_data' => 'mixed', 'microservice_method' => 'string', @@ -116,6 +114,43 @@ class ModuleError implements ModelInterface, ArrayAccess, \JsonSerializable 'microservice_response_fields' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'message' => false, + 'stack' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'module' => false, + 'module_name' => false, + 'module_id' => false, + 'code' => false, + 'method_type' => false, + 'stack_trace' => true, + 'exception' => true, + 'severity' => false, + 'microservice_url' => false, + 'microservice_data' => true, + 'microservice_method' => false, + 'microservice_options' => true, + 'microservice_response_code' => false, + 'microservice_response_message' => false, + 'microservice_response_http_status' => false, + 'microservice_response_fields' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -136,6 +171,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -284,28 +371,46 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['stack'] = $data['stack'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['module'] = $data['module'] ?? null; - $this->container['module_name'] = $data['module_name'] ?? null; - $this->container['module_id'] = $data['module_id'] ?? null; - $this->container['code'] = $data['code'] ?? null; - $this->container['method_type'] = $data['method_type'] ?? null; - $this->container['stack_trace'] = $data['stack_trace'] ?? null; - $this->container['exception'] = $data['exception'] ?? null; - $this->container['severity'] = $data['severity'] ?? null; - $this->container['microservice_url'] = $data['microservice_url'] ?? null; - $this->container['microservice_data'] = $data['microservice_data'] ?? null; - $this->container['microservice_method'] = $data['microservice_method'] ?? null; - $this->container['microservice_options'] = $data['microservice_options'] ?? null; - $this->container['microservice_response_code'] = $data['microservice_response_code'] ?? null; - $this->container['microservice_response_message'] = $data['microservice_response_message'] ?? null; - $this->container['microservice_response_http_status'] = $data['microservice_response_http_status'] ?? null; - $this->container['microservice_response_fields'] = $data['microservice_response_fields'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('stack', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('module', $data ?? [], null); + $this->setIfExists('module_name', $data ?? [], null); + $this->setIfExists('module_id', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('method_type', $data ?? [], null); + $this->setIfExists('stack_trace', $data ?? [], null); + $this->setIfExists('exception', $data ?? [], null); + $this->setIfExists('severity', $data ?? [], null); + $this->setIfExists('microservice_url', $data ?? [], null); + $this->setIfExists('microservice_data', $data ?? [], null); + $this->setIfExists('microservice_method', $data ?? [], null); + $this->setIfExists('microservice_options', $data ?? [], null); + $this->setIfExists('microservice_response_code', $data ?? [], null); + $this->setIfExists('microservice_response_message', $data ?? [], null); + $this->setIfExists('microservice_response_http_status', $data ?? [], null); + $this->setIfExists('microservice_response_fields', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -414,6 +519,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -438,6 +546,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -462,6 +573,9 @@ public function getStack() */ public function setStack($stack) { + if (is_null($stack)) { + throw new \InvalidArgumentException('non-nullable stack cannot be null'); + } $this->container['stack'] = $stack; return $this; @@ -486,6 +600,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -510,6 +627,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -534,6 +654,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -558,6 +681,9 @@ public function getModule() */ public function setModule($module) { + if (is_null($module)) { + throw new \InvalidArgumentException('non-nullable module cannot be null'); + } $this->container['module'] = $module; return $this; @@ -582,6 +708,9 @@ public function getModuleName() */ public function setModuleName($module_name) { + if (is_null($module_name)) { + throw new \InvalidArgumentException('non-nullable module_name cannot be null'); + } $this->container['module_name'] = $module_name; return $this; @@ -606,6 +735,9 @@ public function getModuleId() */ public function setModuleId($module_id) { + if (is_null($module_id)) { + throw new \InvalidArgumentException('non-nullable module_id cannot be null'); + } $this->container['module_id'] = $module_id; return $this; @@ -630,6 +762,9 @@ public function getCode() */ public function setCode($code) { + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); + } $this->container['code'] = $code; return $this; @@ -654,6 +789,9 @@ public function getMethodType() */ public function setMethodType($method_type) { + if (is_null($method_type)) { + throw new \InvalidArgumentException('non-nullable method_type cannot be null'); + } $this->container['method_type'] = $method_type; return $this; @@ -678,6 +816,16 @@ public function getStackTrace() */ public function setStackTrace($stack_trace) { + if (is_null($stack_trace)) { + array_push($this->openAPINullablesSetToNull, 'stack_trace'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('stack_trace', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['stack_trace'] = $stack_trace; return $this; @@ -702,6 +850,16 @@ public function getException() */ public function setException($exception) { + if (is_null($exception)) { + array_push($this->openAPINullablesSetToNull, 'exception'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('exception', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['exception'] = $exception; return $this; @@ -710,7 +868,7 @@ public function setException($exception) /** * Gets severity * - * @return double + * @return float */ public function getSeverity() { @@ -720,12 +878,15 @@ public function getSeverity() /** * Sets severity * - * @param double $severity severity + * @param float $severity severity * * @return self */ public function setSeverity($severity) { + if (is_null($severity)) { + throw new \InvalidArgumentException('non-nullable severity cannot be null'); + } $this->container['severity'] = $severity; return $this; @@ -750,6 +911,9 @@ public function getMicroserviceUrl() */ public function setMicroserviceUrl($microservice_url) { + if (is_null($microservice_url)) { + throw new \InvalidArgumentException('non-nullable microservice_url cannot be null'); + } $this->container['microservice_url'] = $microservice_url; return $this; @@ -774,6 +938,16 @@ public function getMicroserviceData() */ public function setMicroserviceData($microservice_data) { + if (is_null($microservice_data)) { + array_push($this->openAPINullablesSetToNull, 'microservice_data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('microservice_data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['microservice_data'] = $microservice_data; return $this; @@ -798,6 +972,9 @@ public function getMicroserviceMethod() */ public function setMicroserviceMethod($microservice_method) { + if (is_null($microservice_method)) { + throw new \InvalidArgumentException('non-nullable microservice_method cannot be null'); + } $this->container['microservice_method'] = $microservice_method; return $this; @@ -822,6 +999,16 @@ public function getMicroserviceOptions() */ public function setMicroserviceOptions($microservice_options) { + if (is_null($microservice_options)) { + array_push($this->openAPINullablesSetToNull, 'microservice_options'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('microservice_options', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['microservice_options'] = $microservice_options; return $this; @@ -846,6 +1033,9 @@ public function getMicroserviceResponseCode() */ public function setMicroserviceResponseCode($microservice_response_code) { + if (is_null($microservice_response_code)) { + throw new \InvalidArgumentException('non-nullable microservice_response_code cannot be null'); + } $this->container['microservice_response_code'] = $microservice_response_code; return $this; @@ -870,6 +1060,9 @@ public function getMicroserviceResponseMessage() */ public function setMicroserviceResponseMessage($microservice_response_message) { + if (is_null($microservice_response_message)) { + throw new \InvalidArgumentException('non-nullable microservice_response_message cannot be null'); + } $this->container['microservice_response_message'] = $microservice_response_message; return $this; @@ -894,6 +1087,9 @@ public function getMicroserviceResponseHttpStatus() */ public function setMicroserviceResponseHttpStatus($microservice_response_http_status) { + if (is_null($microservice_response_http_status)) { + throw new \InvalidArgumentException('non-nullable microservice_response_http_status cannot be null'); + } $this->container['microservice_response_http_status'] = $microservice_response_http_status; return $this; @@ -918,6 +1114,16 @@ public function getMicroserviceResponseFields() */ public function setMicroserviceResponseFields($microservice_response_fields) { + if (is_null($microservice_response_fields)) { + array_push($this->openAPINullablesSetToNull, 'microservice_response_fields'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('microservice_response_fields', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['microservice_response_fields'] = $microservice_response_fields; return $this; @@ -929,7 +1135,7 @@ public function setMicroserviceResponseFields($microservice_response_fields) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -941,6 +1147,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -954,7 +1161,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -970,7 +1177,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -982,6 +1189,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/NewsArticle.php b/lib/Model/NewsArticle.php index 31ba08e..af3f43d 100644 --- a/lib/Model/NewsArticle.php +++ b/lib/Model/NewsArticle.php @@ -2,7 +2,7 @@ /** * NewsArticle * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class NewsArticle implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -66,7 +64,7 @@ class NewsArticle implements ModelInterface, ArrayAccess, \JsonSerializable 'url' => 'string', 'media_url' => 'string', 'published_date' => '\DateTime', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -94,6 +92,32 @@ class NewsArticle implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'order_number' => false, + 'body' => false, + 'url' => false, + 'media_url' => false, + 'published_date' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -229,17 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['body'] = $data['body'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['published_date'] = $data['published_date'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('published_date', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -336,6 +430,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling NewsArticle., must be bigger than or equal to 1.'); @@ -365,6 +462,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling NewsArticle., must be bigger than or equal to 1.'); @@ -394,6 +494,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } if ((mb_strlen($body) < 1)) { throw new \InvalidArgumentException('invalid length for $body when calling NewsArticle., must be bigger than or equal to 1.'); @@ -423,6 +526,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } $this->container['url'] = $url; return $this; @@ -447,6 +553,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -471,6 +580,9 @@ public function getPublishedDate() */ public function setPublishedDate($published_date) { + if (is_null($published_date)) { + throw new \InvalidArgumentException('non-nullable published_date cannot be null'); + } $this->container['published_date'] = $published_date; return $this; @@ -479,7 +591,7 @@ public function setPublishedDate($published_date) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -489,12 +601,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -519,6 +634,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -543,6 +661,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -567,6 +688,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -591,14 +715,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling NewsArticle., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling NewsArticle., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling NewsArticle., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling NewsArticle., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -612,7 +739,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -624,6 +751,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -637,7 +765,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -653,7 +781,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -665,6 +793,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/OptInList.php b/lib/Model/OptInList.php index 6e1218c..19626d4 100644 --- a/lib/Model/OptInList.php +++ b/lib/Model/OptInList.php @@ -2,7 +2,7 @@ /** * OptInList * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class OptInList implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,7 +72,7 @@ class OptInList implements ModelInterface, ArrayAccess, \JsonSerializable 'opt_in_confirmed_media_urls' => 'string[]', 'opt_out_confirmed_media_urls' => 'string[]', 'is_over21_required' => 'bool', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime' @@ -108,6 +106,39 @@ class OptInList implements ModelInterface, ArrayAccess, \JsonSerializable 'updated_at' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false, + 'is_active' => false, + 'list_name' => false, + 'phone_number_id' => false, + 'estimated_messages_per_month' => false, + 'opt_in_keyword' => false, + 'opt_out_keyword' => false, + 'opt_in_confirmed_response' => false, + 'opt_out_confirmed_response' => false, + 'opt_in_confirmed_customer_receives' => false, + 'opt_out_confirmed_customer_receives' => false, + 'opt_in_confirmed_media_urls' => false, + 'opt_out_confirmed_media_urls' => false, + 'is_over21_required' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -128,6 +159,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -264,24 +347,42 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['list_name'] = $data['list_name'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['estimated_messages_per_month'] = $data['estimated_messages_per_month'] ?? null; - $this->container['opt_in_keyword'] = $data['opt_in_keyword'] ?? null; - $this->container['opt_out_keyword'] = $data['opt_out_keyword'] ?? null; - $this->container['opt_in_confirmed_response'] = $data['opt_in_confirmed_response'] ?? null; - $this->container['opt_out_confirmed_response'] = $data['opt_out_confirmed_response'] ?? null; - $this->container['opt_in_confirmed_customer_receives'] = $data['opt_in_confirmed_customer_receives'] ?? null; - $this->container['opt_out_confirmed_customer_receives'] = $data['opt_out_confirmed_customer_receives'] ?? null; - $this->container['opt_in_confirmed_media_urls'] = $data['opt_in_confirmed_media_urls'] ?? null; - $this->container['opt_out_confirmed_media_urls'] = $data['opt_out_confirmed_media_urls'] ?? null; - $this->container['is_over21_required'] = $data['is_over21_required'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('list_name', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('estimated_messages_per_month', $data ?? [], null); + $this->setIfExists('opt_in_keyword', $data ?? [], null); + $this->setIfExists('opt_out_keyword', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_response', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_response', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_customer_receives', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_customer_receives', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_media_urls', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_media_urls', $data ?? [], null); + $this->setIfExists('is_over21_required', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -386,14 +487,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -449,14 +542,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling OptInList., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling OptInList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling OptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling OptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -483,6 +579,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -507,6 +606,9 @@ public function getListName() */ public function setListName($list_name) { + if (is_null($list_name)) { + throw new \InvalidArgumentException('non-nullable list_name cannot be null'); + } if ((mb_strlen($list_name) < 1)) { throw new \InvalidArgumentException('invalid length for $list_name when calling OptInList., must be bigger than or equal to 1.'); @@ -536,14 +638,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling OptInList., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling OptInList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling OptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling OptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -570,6 +675,9 @@ public function getEstimatedMessagesPerMonth() */ public function setEstimatedMessagesPerMonth($estimated_messages_per_month) { + if (is_null($estimated_messages_per_month)) { + throw new \InvalidArgumentException('non-nullable estimated_messages_per_month cannot be null'); + } if (($estimated_messages_per_month < 0)) { throw new \InvalidArgumentException('invalid value for $estimated_messages_per_month when calling OptInList., must be bigger than or equal to 0.'); @@ -599,6 +707,9 @@ public function getOptInKeyword() */ public function setOptInKeyword($opt_in_keyword) { + if (is_null($opt_in_keyword)) { + throw new \InvalidArgumentException('non-nullable opt_in_keyword cannot be null'); + } if ((mb_strlen($opt_in_keyword) > 30)) { throw new \InvalidArgumentException('invalid length for $opt_in_keyword when calling OptInList., must be smaller than or equal to 30.'); } @@ -630,6 +741,9 @@ public function getOptOutKeyword() */ public function setOptOutKeyword($opt_out_keyword) { + if (is_null($opt_out_keyword)) { + throw new \InvalidArgumentException('non-nullable opt_out_keyword cannot be null'); + } if ((mb_strlen($opt_out_keyword) > 34)) { throw new \InvalidArgumentException('invalid length for $opt_out_keyword when calling OptInList., must be smaller than or equal to 34.'); } @@ -661,6 +775,9 @@ public function getOptInConfirmedResponse() */ public function setOptInConfirmedResponse($opt_in_confirmed_response) { + if (is_null($opt_in_confirmed_response)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_response cannot be null'); + } $this->container['opt_in_confirmed_response'] = $opt_in_confirmed_response; return $this; @@ -685,6 +802,9 @@ public function getOptOutConfirmedResponse() */ public function setOptOutConfirmedResponse($opt_out_confirmed_response) { + if (is_null($opt_out_confirmed_response)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_response cannot be null'); + } $this->container['opt_out_confirmed_response'] = $opt_out_confirmed_response; return $this; @@ -709,6 +829,9 @@ public function getOptInConfirmedCustomerReceives() */ public function setOptInConfirmedCustomerReceives($opt_in_confirmed_customer_receives) { + if (is_null($opt_in_confirmed_customer_receives)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_customer_receives cannot be null'); + } $this->container['opt_in_confirmed_customer_receives'] = $opt_in_confirmed_customer_receives; return $this; @@ -733,6 +856,9 @@ public function getOptOutConfirmedCustomerReceives() */ public function setOptOutConfirmedCustomerReceives($opt_out_confirmed_customer_receives) { + if (is_null($opt_out_confirmed_customer_receives)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_customer_receives cannot be null'); + } $this->container['opt_out_confirmed_customer_receives'] = $opt_out_confirmed_customer_receives; return $this; @@ -757,6 +883,9 @@ public function getOptInConfirmedMediaUrls() */ public function setOptInConfirmedMediaUrls($opt_in_confirmed_media_urls) { + if (is_null($opt_in_confirmed_media_urls)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_media_urls cannot be null'); + } $this->container['opt_in_confirmed_media_urls'] = $opt_in_confirmed_media_urls; return $this; @@ -781,6 +910,9 @@ public function getOptOutConfirmedMediaUrls() */ public function setOptOutConfirmedMediaUrls($opt_out_confirmed_media_urls) { + if (is_null($opt_out_confirmed_media_urls)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_media_urls cannot be null'); + } $this->container['opt_out_confirmed_media_urls'] = $opt_out_confirmed_media_urls; return $this; @@ -805,6 +937,9 @@ public function getIsOver21Required() */ public function setIsOver21Required($is_over21_required) { + if (is_null($is_over21_required)) { + throw new \InvalidArgumentException('non-nullable is_over21_required cannot be null'); + } $this->container['is_over21_required'] = $is_over21_required; return $this; @@ -813,7 +948,7 @@ public function setIsOver21Required($is_over21_required) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -823,19 +958,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling OptInList., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling OptInList., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -860,14 +991,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling OptInList., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling OptInList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling OptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling OptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -894,6 +1028,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -918,6 +1055,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -929,7 +1069,7 @@ public function setUpdatedAt($updated_at) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -941,6 +1081,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -954,7 +1095,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -970,7 +1111,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -982,6 +1123,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/OptInListSource.php b/lib/Model/OptInListSource.php index c6bcf52..5074309 100644 --- a/lib/Model/OptInListSource.php +++ b/lib/Model/OptInListSource.php @@ -2,7 +2,7 @@ /** * OptInListSource * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class OptInListSource implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class OptInListSource implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'list_id' => 'string', 'source_name' => 'string', 'employee_id' => 'string', @@ -88,6 +86,29 @@ class OptInListSource implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'list_id' => false, + 'source_name' => false, + 'employee_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -214,14 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['list_id'] = $data['list_id'] ?? null; - $this->container['source_name'] = $data['source_name'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('source_name', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -236,14 +327,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['list_id'] === null) { $invalidProperties[] = "'list_id' can't be null"; } @@ -319,7 +402,7 @@ public function valid() /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -329,19 +412,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling OptInListSource., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling OptInListSource., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -366,14 +445,17 @@ public function getListId() */ public function setListId($list_id) { + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + } if ((mb_strlen($list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling OptInListSource., must be smaller than or equal to 10.'); } if ((mb_strlen($list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling OptInListSource., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $list_id))) { - throw new \InvalidArgumentException("invalid value for $list_id when calling OptInListSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($list_id)))) { + throw new \InvalidArgumentException("invalid value for \$list_id when calling OptInListSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['list_id'] = $list_id; @@ -400,6 +482,9 @@ public function getSourceName() */ public function setSourceName($source_name) { + if (is_null($source_name)) { + throw new \InvalidArgumentException('non-nullable source_name cannot be null'); + } $this->container['source_name'] = $source_name; return $this; @@ -424,14 +509,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling OptInListSource., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling OptInListSource., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling OptInListSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling OptInListSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -458,14 +546,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling OptInListSource., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling OptInListSource., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling OptInListSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling OptInListSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -492,6 +583,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -516,6 +610,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -540,6 +637,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -551,7 +651,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -563,6 +663,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -576,7 +677,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -592,7 +693,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -604,6 +705,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/OptInListSubscriber.php b/lib/Model/OptInListSubscriber.php index c538900..264f03c 100644 --- a/lib/Model/OptInListSubscriber.php +++ b/lib/Model/OptInListSubscriber.php @@ -2,7 +2,7 @@ /** * OptInListSubscriber * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class OptInListSubscriber implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,12 +61,12 @@ class OptInListSubscriber implements ModelInterface, ArrayAccess, \JsonSerializa 'caller_name' => 'string', 'caller_type' => 'string', 'opt_in_list_id' => 'string', - 'opt_in_source_id' => 'string', + 'opt_in_source_id' => '\OpenAPI\Client\Model\PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID', 'is_subscribed' => 'bool', 'is_pending_age21_verification' => 'bool', 'mobile_phone_number' => 'string', 'referring_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -102,6 +100,36 @@ class OptInListSubscriber implements ModelInterface, ArrayAccess, \JsonSerializa 'source' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'caller_name' => false, + 'caller_type' => false, + 'opt_in_list_id' => false, + 'opt_in_source_id' => false, + 'is_subscribed' => false, + 'is_pending_age21_verification' => false, + 'mobile_phone_number' => false, + 'referring_url' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'opted_status' => false, + 'source' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -122,6 +150,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -249,21 +329,39 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['caller_name'] = $data['caller_name'] ?? null; - $this->container['caller_type'] = $data['caller_type'] ?? null; - $this->container['opt_in_list_id'] = $data['opt_in_list_id'] ?? null; - $this->container['opt_in_source_id'] = $data['opt_in_source_id'] ?? null; - $this->container['is_subscribed'] = $data['is_subscribed'] ?? null; - $this->container['is_pending_age21_verification'] = $data['is_pending_age21_verification'] ?? null; - $this->container['mobile_phone_number'] = $data['mobile_phone_number'] ?? null; - $this->container['referring_url'] = $data['referring_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['opted_status'] = $data['opted_status'] ?? null; - $this->container['source'] = $data['source'] ?? null; + $this->setIfExists('caller_name', $data ?? [], null); + $this->setIfExists('caller_type', $data ?? [], null); + $this->setIfExists('opt_in_list_id', $data ?? [], null); + $this->setIfExists('opt_in_source_id', $data ?? [], null); + $this->setIfExists('is_subscribed', $data ?? [], null); + $this->setIfExists('is_pending_age21_verification', $data ?? [], null); + $this->setIfExists('mobile_phone_number', $data ?? [], null); + $this->setIfExists('referring_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('opted_status', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -312,14 +410,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -378,6 +468,9 @@ public function getCallerName() */ public function setCallerName($caller_name) { + if (is_null($caller_name)) { + throw new \InvalidArgumentException('non-nullable caller_name cannot be null'); + } $this->container['caller_name'] = $caller_name; return $this; @@ -402,6 +495,9 @@ public function getCallerType() */ public function setCallerType($caller_type) { + if (is_null($caller_type)) { + throw new \InvalidArgumentException('non-nullable caller_type cannot be null'); + } $this->container['caller_type'] = $caller_type; return $this; @@ -426,14 +522,17 @@ public function getOptInListId() */ public function setOptInListId($opt_in_list_id) { + if (is_null($opt_in_list_id)) { + throw new \InvalidArgumentException('non-nullable opt_in_list_id cannot be null'); + } if ((mb_strlen($opt_in_list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $opt_in_list_id when calling OptInListSubscriber., must be smaller than or equal to 10.'); } if ((mb_strlen($opt_in_list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $opt_in_list_id when calling OptInListSubscriber., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $opt_in_list_id))) { - throw new \InvalidArgumentException("invalid value for $opt_in_list_id when calling OptInListSubscriber., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($opt_in_list_id)))) { + throw new \InvalidArgumentException("invalid value for \$opt_in_list_id when calling OptInListSubscriber., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['opt_in_list_id'] = $opt_in_list_id; @@ -444,7 +543,7 @@ public function setOptInListId($opt_in_list_id) /** * Gets opt_in_source_id * - * @return string + * @return \OpenAPI\Client\Model\PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID */ public function getOptInSourceId() { @@ -454,12 +553,15 @@ public function getOptInSourceId() /** * Sets opt_in_source_id * - * @param string $opt_in_source_id opt_in_source_id + * @param \OpenAPI\Client\Model\PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID $opt_in_source_id opt_in_source_id * * @return self */ public function setOptInSourceId($opt_in_source_id) { + if (is_null($opt_in_source_id)) { + throw new \InvalidArgumentException('non-nullable opt_in_source_id cannot be null'); + } $this->container['opt_in_source_id'] = $opt_in_source_id; return $this; @@ -484,6 +586,9 @@ public function getIsSubscribed() */ public function setIsSubscribed($is_subscribed) { + if (is_null($is_subscribed)) { + throw new \InvalidArgumentException('non-nullable is_subscribed cannot be null'); + } $this->container['is_subscribed'] = $is_subscribed; return $this; @@ -508,6 +613,9 @@ public function getIsPendingAge21Verification() */ public function setIsPendingAge21Verification($is_pending_age21_verification) { + if (is_null($is_pending_age21_verification)) { + throw new \InvalidArgumentException('non-nullable is_pending_age21_verification cannot be null'); + } $this->container['is_pending_age21_verification'] = $is_pending_age21_verification; return $this; @@ -532,6 +640,9 @@ public function getMobilePhoneNumber() */ public function setMobilePhoneNumber($mobile_phone_number) { + if (is_null($mobile_phone_number)) { + throw new \InvalidArgumentException('non-nullable mobile_phone_number cannot be null'); + } $this->container['mobile_phone_number'] = $mobile_phone_number; return $this; @@ -556,6 +667,9 @@ public function getReferringUrl() */ public function setReferringUrl($referring_url) { + if (is_null($referring_url)) { + throw new \InvalidArgumentException('non-nullable referring_url cannot be null'); + } if ((mb_strlen($referring_url) < 0)) { throw new \InvalidArgumentException('invalid length for $referring_url when calling OptInListSubscriber., must be bigger than or equal to 0.'); @@ -569,7 +683,7 @@ public function setReferringUrl($referring_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -579,19 +693,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling OptInListSubscriber., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling OptInListSubscriber., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -616,14 +726,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling OptInListSubscriber., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling OptInListSubscriber., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling OptInListSubscriber., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling OptInListSubscriber., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -650,6 +763,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -674,6 +790,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -698,6 +817,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -722,6 +844,9 @@ public function getOptedStatus() */ public function setOptedStatus($opted_status) { + if (is_null($opted_status)) { + throw new \InvalidArgumentException('non-nullable opted_status cannot be null'); + } $this->container['opted_status'] = $opted_status; return $this; @@ -746,6 +871,9 @@ public function getSource() */ public function setSource($source) { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } $this->container['source'] = $source; return $this; @@ -757,7 +885,7 @@ public function setSource($source) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -769,6 +897,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -782,7 +911,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -798,7 +927,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -810,6 +939,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/OutboundSMS.php b/lib/Model/OutboundSMS.php index f83847e..7d05668 100644 --- a/lib/Model/OutboundSMS.php +++ b/lib/Model/OutboundSMS.php @@ -2,7 +2,7 @@ /** * OutboundSMS * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class OutboundSMS implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,9 +58,9 @@ class OutboundSMS implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'employee_id' => 'string', - 'status' => 'string', + 'status' => '\OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -70,7 +68,7 @@ class OutboundSMS implements ModelInterface, ArrayAccess, \JsonSerializable 'body' => 'string', 'phone_number_id' => 'string', 'media_urls' => 'string[]', - 'payment_object_broadcast_id' => 'string', + 'payment_object_broadcast_id' => '\OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID', 'body_template' => 'string', 'status_callback' => 'string', 'is_sent' => 'bool', @@ -116,6 +114,43 @@ class OutboundSMS implements ModelInterface, ArrayAccess, \JsonSerializable 'to' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'employee_id' => false, + 'status' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'body' => false, + 'phone_number_id' => false, + 'media_urls' => false, + 'payment_object_broadcast_id' => false, + 'body_template' => false, + 'status_callback' => false, + 'is_sent' => false, + 'sent_at' => false, + 'delivered_at' => false, + 'message_sid' => false, + 'num_segments' => false, + 'num_media' => false, + 'error_code' => true, + 'error_message' => true, + 'to' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -136,6 +171,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -284,28 +371,46 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['body'] = $data['body'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; - $this->container['payment_object_broadcast_id'] = $data['payment_object_broadcast_id'] ?? null; - $this->container['body_template'] = $data['body_template'] ?? null; - $this->container['status_callback'] = $data['status_callback'] ?? null; - $this->container['is_sent'] = $data['is_sent'] ?? null; - $this->container['sent_at'] = $data['sent_at'] ?? null; - $this->container['delivered_at'] = $data['delivered_at'] ?? null; - $this->container['message_sid'] = $data['message_sid'] ?? null; - $this->container['num_segments'] = $data['num_segments'] ?? null; - $this->container['num_media'] = $data['num_media'] ?? null; - $this->container['error_code'] = $data['error_code'] ?? null; - $this->container['error_message'] = $data['error_message'] ?? null; - $this->container['to'] = $data['to'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + $this->setIfExists('payment_object_broadcast_id', $data ?? [], null); + $this->setIfExists('body_template', $data ?? [], null); + $this->setIfExists('status_callback', $data ?? [], null); + $this->setIfExists('is_sent', $data ?? [], null); + $this->setIfExists('sent_at', $data ?? [], null); + $this->setIfExists('delivered_at', $data ?? [], null); + $this->setIfExists('message_sid', $data ?? [], null); + $this->setIfExists('num_segments', $data ?? [], null); + $this->setIfExists('num_media', $data ?? [], null); + $this->setIfExists('error_code', $data ?? [], null); + $this->setIfExists('error_message', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -320,14 +425,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['employee_id'] === null) { $invalidProperties[] = "'employee_id' can't be null"; } @@ -391,10 +488,6 @@ public function listInvalidProperties() if ($this->container['media_urls'] === null) { $invalidProperties[] = "'media_urls' can't be null"; } - if (!is_null($this->container['payment_object_broadcast_id']) && (mb_strlen($this->container['payment_object_broadcast_id']) > 10)) { - $invalidProperties[] = "invalid value for 'payment_object_broadcast_id', the character length must be smaller than or equal to 10."; - } - if ($this->container['body_template'] === null) { $invalidProperties[] = "'body_template' can't be null"; } @@ -440,7 +533,7 @@ public function valid() /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -450,19 +543,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling OutboundSMS., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling OutboundSMS., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -487,14 +576,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling OutboundSMS., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling OutboundSMS., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling OutboundSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling OutboundSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -505,7 +597,7 @@ public function setEmployeeId($employee_id) /** * Gets status * - * @return string + * @return \OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus */ public function getStatus() { @@ -515,12 +607,15 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param \OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus $status status * * @return self */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -545,14 +640,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling OutboundSMS., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling OutboundSMS., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling OutboundSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling OutboundSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -579,6 +677,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -603,6 +704,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -627,6 +731,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -651,6 +758,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } $this->container['body'] = $body; return $this; @@ -675,14 +785,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling OutboundSMS., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling OutboundSMS., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling OutboundSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling OutboundSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -709,6 +822,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -717,7 +833,7 @@ public function setMediaUrls($media_urls) /** * Gets payment_object_broadcast_id * - * @return string|null + * @return \OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID|null */ public function getPaymentObjectBroadcastId() { @@ -727,16 +843,15 @@ public function getPaymentObjectBroadcastId() /** * Sets payment_object_broadcast_id * - * @param string|null $payment_object_broadcast_id payment_object_broadcast_id + * @param \OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID|null $payment_object_broadcast_id payment_object_broadcast_id * * @return self */ public function setPaymentObjectBroadcastId($payment_object_broadcast_id) { - if (!is_null($payment_object_broadcast_id) && (mb_strlen($payment_object_broadcast_id) > 10)) { - throw new \InvalidArgumentException('invalid length for $payment_object_broadcast_id when calling OutboundSMS., must be smaller than or equal to 10.'); + if (is_null($payment_object_broadcast_id)) { + throw new \InvalidArgumentException('non-nullable payment_object_broadcast_id cannot be null'); } - $this->container['payment_object_broadcast_id'] = $payment_object_broadcast_id; return $this; @@ -761,6 +876,9 @@ public function getBodyTemplate() */ public function setBodyTemplate($body_template) { + if (is_null($body_template)) { + throw new \InvalidArgumentException('non-nullable body_template cannot be null'); + } $this->container['body_template'] = $body_template; return $this; @@ -785,6 +903,9 @@ public function getStatusCallback() */ public function setStatusCallback($status_callback) { + if (is_null($status_callback)) { + throw new \InvalidArgumentException('non-nullable status_callback cannot be null'); + } if ((mb_strlen($status_callback) < 1)) { throw new \InvalidArgumentException('invalid length for $status_callback when calling OutboundSMS., must be bigger than or equal to 1.'); @@ -814,6 +935,9 @@ public function getIsSent() */ public function setIsSent($is_sent) { + if (is_null($is_sent)) { + throw new \InvalidArgumentException('non-nullable is_sent cannot be null'); + } $this->container['is_sent'] = $is_sent; return $this; @@ -838,6 +962,9 @@ public function getSentAt() */ public function setSentAt($sent_at) { + if (is_null($sent_at)) { + throw new \InvalidArgumentException('non-nullable sent_at cannot be null'); + } $this->container['sent_at'] = $sent_at; return $this; @@ -862,6 +989,9 @@ public function getDeliveredAt() */ public function setDeliveredAt($delivered_at) { + if (is_null($delivered_at)) { + throw new \InvalidArgumentException('non-nullable delivered_at cannot be null'); + } $this->container['delivered_at'] = $delivered_at; return $this; @@ -886,6 +1016,9 @@ public function getMessageSid() */ public function setMessageSid($message_sid) { + if (is_null($message_sid)) { + throw new \InvalidArgumentException('non-nullable message_sid cannot be null'); + } $this->container['message_sid'] = $message_sid; return $this; @@ -910,8 +1043,11 @@ public function getNumSegments() */ public function setNumSegments($num_segments) { + if (is_null($num_segments)) { + throw new \InvalidArgumentException('non-nullable num_segments cannot be null'); + } - if (!is_null($num_segments) && ($num_segments < 0)) { + if (($num_segments < 0)) { throw new \InvalidArgumentException('invalid value for $num_segments when calling OutboundSMS., must be bigger than or equal to 0.'); } @@ -939,8 +1075,11 @@ public function getNumMedia() */ public function setNumMedia($num_media) { + if (is_null($num_media)) { + throw new \InvalidArgumentException('non-nullable num_media cannot be null'); + } - if (!is_null($num_media) && ($num_media < 0)) { + if (($num_media < 0)) { throw new \InvalidArgumentException('invalid value for $num_media when calling OutboundSMS., must be bigger than or equal to 0.'); } @@ -968,6 +1107,16 @@ public function getErrorCode() */ public function setErrorCode($error_code) { + if (is_null($error_code)) { + array_push($this->openAPINullablesSetToNull, 'error_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('error_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['error_code'] = $error_code; return $this; @@ -992,6 +1141,16 @@ public function getErrorMessage() */ public function setErrorMessage($error_message) { + if (is_null($error_message)) { + array_push($this->openAPINullablesSetToNull, 'error_message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('error_message', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['error_message'] = $error_message; return $this; @@ -1016,6 +1175,9 @@ public function getTo() */ public function setTo($to) { + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } $this->container['to'] = $to; return $this; @@ -1027,7 +1189,7 @@ public function setTo($to) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1039,6 +1201,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1052,7 +1215,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1068,7 +1231,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1080,6 +1243,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PaginatedWTMembers.php b/lib/Model/PaginatedWTMembers.php index 2371831..7720b70 100644 --- a/lib/Model/PaginatedWTMembers.php +++ b/lib/Model/PaginatedWTMembers.php @@ -2,7 +2,7 @@ /** * PaginatedWTMembers * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PaginatedWTMembers implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class PaginatedWTMembers implements ModelInterface, ArrayAccess, \JsonSerializab 'total' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false, + 'length' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['results'] = $data['results'] ?? null; - $this->container['length'] = $data['length'] ?? null; - $this->container['total'] = $data['total'] ?? null; + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +332,9 @@ public function getResults() */ public function setResults($results) { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } $this->container['results'] = $results; return $this; @@ -270,6 +359,9 @@ public function getLength() */ public function setLength($length) { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } $this->container['length'] = $length; return $this; @@ -294,6 +386,9 @@ public function getTotal() */ public function setTotal($total) { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } $this->container['total'] = $total; return $this; @@ -305,7 +400,7 @@ public function setTotal($total) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PaginatedWTMerchantCredits.php b/lib/Model/PaginatedWTMerchantCredits.php index 0aff87d..51495f0 100644 --- a/lib/Model/PaginatedWTMerchantCredits.php +++ b/lib/Model/PaginatedWTMerchantCredits.php @@ -2,7 +2,7 @@ /** * PaginatedWTMerchantCredits * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PaginatedWTMerchantCredits implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class PaginatedWTMerchantCredits implements ModelInterface, ArrayAccess, \JsonSe 'total' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false, + 'length' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['results'] = $data['results'] ?? null; - $this->container['length'] = $data['length'] ?? null; - $this->container['total'] = $data['total'] ?? null; + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +332,9 @@ public function getResults() */ public function setResults($results) { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } $this->container['results'] = $results; return $this; @@ -270,6 +359,9 @@ public function getLength() */ public function setLength($length) { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } $this->container['length'] = $length; return $this; @@ -294,6 +386,9 @@ public function getTotal() */ public function setTotal($total) { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } $this->container['total'] = $total; return $this; @@ -305,7 +400,7 @@ public function setTotal($total) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PaginationRequestWithIDAndWithoutSortOptions.php b/lib/Model/PaginationRequestWithIDAndWithoutSortOptions.php index 11e0d6e..5fc11e5 100644 --- a/lib/Model/PaginationRequestWithIDAndWithoutSortOptions.php +++ b/lib/Model/PaginationRequestWithIDAndWithoutSortOptions.php @@ -2,7 +2,7 @@ /** * PaginationRequestWithIDAndWithoutSortOptions * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PaginationRequestWithIDAndWithoutSortOptions implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class PaginationRequestWithIDAndWithoutSortOptions implements ModelInterface, Ar 'id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'page_size' => false, + 'page_num' => false, + 'id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['page_size'] = $data['page_size'] ?? null; - $this->container['page_num'] = $data['page_num'] ?? null; - $this->container['id'] = $data['id'] ?? null; + $this->setIfExists('page_size', $data ?? [], null); + $this->setIfExists('page_num', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -252,6 +338,9 @@ public function getPageSize() */ public function setPageSize($page_size) { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } $this->container['page_size'] = $page_size; return $this; @@ -276,6 +365,9 @@ public function getPageNum() */ public function setPageNum($page_num) { + if (is_null($page_num)) { + throw new \InvalidArgumentException('non-nullable page_num cannot be null'); + } $this->container['page_num'] = $page_num; return $this; @@ -300,14 +392,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 12)) { throw new \InvalidArgumentException('invalid length for $id when calling PaginationRequestWithIDAndWithoutSortOptions., must be smaller than or equal to 12.'); } if ((mb_strlen($id) < 12)) { throw new \InvalidArgumentException('invalid length for $id when calling PaginationRequestWithIDAndWithoutSortOptions., must be bigger than or equal to 12.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling PaginationRequestWithIDAndWithoutSortOptions., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling PaginationRequestWithIDAndWithoutSortOptions., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -321,7 +416,7 @@ public function setId($id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -333,6 +428,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -346,7 +442,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -362,7 +458,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -374,6 +470,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PaginationRequestWithSortOptions.php b/lib/Model/PaginationRequestWithSortOptions.php index 01213bc..e29a519 100644 --- a/lib/Model/PaginationRequestWithSortOptions.php +++ b/lib/Model/PaginationRequestWithSortOptions.php @@ -2,7 +2,7 @@ /** * PaginationRequestWithSortOptions * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PaginationRequestWithSortOptions implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class PaginationRequestWithSortOptions implements ModelInterface, ArrayAccess, \ 'page_size' => 'int', 'page_num' => 'int', 'sort_key' => 'string', - 'sort_order' => 'string' + 'sort_order' => '\OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder' ]; /** @@ -82,6 +80,26 @@ class PaginationRequestWithSortOptions implements ModelInterface, ArrayAccess, \ 'sort_order' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'is_archive_included' => false, + 'page_size' => false, + 'page_num' => false, + 'sort_key' => false, + 'sort_order' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -183,7 +253,7 @@ public function getModelName() return self::$openAPIModelName; } - const SORT_KEY_CREATED_AT = 'createdAt'; + public const SORT_KEY_CREATED_AT = 'createdAt'; /** * Gets allowable values of the enum @@ -212,11 +282,29 @@ public function getSortKeyAllowableValues() */ public function __construct(array $data = null) { - $this->container['is_archive_included'] = $data['is_archive_included'] ?? null; - $this->container['page_size'] = $data['page_size'] ?? null; - $this->container['page_num'] = $data['page_num'] ?? null; - $this->container['sort_key'] = $data['sort_key'] ?? null; - $this->container['sort_order'] = $data['sort_order'] ?? null; + $this->setIfExists('is_archive_included', $data ?? [], null); + $this->setIfExists('page_size', $data ?? [], null); + $this->setIfExists('page_num', $data ?? [], null); + $this->setIfExists('sort_key', $data ?? [], null); + $this->setIfExists('sort_order', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -271,6 +359,9 @@ public function getIsArchiveIncluded() */ public function setIsArchiveIncluded($is_archive_included) { + if (is_null($is_archive_included)) { + throw new \InvalidArgumentException('non-nullable is_archive_included cannot be null'); + } $this->container['is_archive_included'] = $is_archive_included; return $this; @@ -295,6 +386,9 @@ public function getPageSize() */ public function setPageSize($page_size) { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } $this->container['page_size'] = $page_size; return $this; @@ -319,6 +413,9 @@ public function getPageNum() */ public function setPageNum($page_num) { + if (is_null($page_num)) { + throw new \InvalidArgumentException('non-nullable page_num cannot be null'); + } $this->container['page_num'] = $page_num; return $this; @@ -343,8 +440,11 @@ public function getSortKey() */ public function setSortKey($sort_key) { + if (is_null($sort_key)) { + throw new \InvalidArgumentException('non-nullable sort_key cannot be null'); + } $allowedValues = $this->getSortKeyAllowableValues(); - if (!is_null($sort_key) && !in_array($sort_key, $allowedValues, true)) { + if (!in_array($sort_key, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value '%s' for 'sort_key', must be one of '%s'", @@ -361,7 +461,7 @@ public function setSortKey($sort_key) /** * Gets sort_order * - * @return string|null + * @return \OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder|null */ public function getSortOrder() { @@ -371,12 +471,15 @@ public function getSortOrder() /** * Sets sort_order * - * @param string|null $sort_order Denotes the sort order + * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder|null $sort_order sort_order * * @return self */ public function setSortOrder($sort_order) { + if (is_null($sort_order)) { + throw new \InvalidArgumentException('non-nullable sort_order cannot be null'); + } $this->container['sort_order'] = $sort_order; return $this; @@ -388,7 +491,7 @@ public function setSortOrder($sort_order) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -400,6 +503,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -413,7 +517,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -429,7 +533,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -441,6 +545,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PaginationRequestWithSortOptionsSortOrder.php b/lib/Model/PaginationRequestWithSortOptionsSortOrder.php new file mode 100644 index 0000000..883800a --- /dev/null +++ b/lib/Model/PaginationRequestWithSortOptionsSortOrder.php @@ -0,0 +1,383 @@ + + */ +class PaginationRequestWithSortOptionsSortOrder implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaginationRequestWithSortOptions_sortOrder'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PaymentDesign.php b/lib/Model/PaymentDesign.php index 8780446..874481c 100644 --- a/lib/Model/PaymentDesign.php +++ b/lib/Model/PaymentDesign.php @@ -2,7 +2,7 @@ /** * PaymentDesign * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PaymentDesign implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,7 +59,7 @@ class PaymentDesign implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'border_color' => 'string', - 'border_style_type' => 'string', + 'border_style_type' => '\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType', 'border_size' => 'string', 'border_radius' => 'int', 'font_color' => 'string', @@ -74,7 +72,7 @@ class PaymentDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'background_image_url' => 'string', 'company_logo_url' => 'string', 'employee_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -110,6 +108,40 @@ class PaymentDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'border_color' => false, + 'border_style_type' => false, + 'border_size' => false, + 'border_radius' => false, + 'font_color' => false, + 'font_type' => false, + 'abbreviation' => false, + 'acronym' => false, + 'icon' => false, + 'design_name' => false, + 'display_name' => false, + 'background_image_url' => false, + 'company_logo_url' => false, + 'employee_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -130,6 +162,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -269,25 +353,43 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['border_color'] = $data['border_color'] ?? null; - $this->container['border_style_type'] = $data['border_style_type'] ?? null; - $this->container['border_size'] = $data['border_size'] ?? null; - $this->container['border_radius'] = $data['border_radius'] ?? null; - $this->container['font_color'] = $data['font_color'] ?? null; - $this->container['font_type'] = $data['font_type'] ?? null; - $this->container['abbreviation'] = $data['abbreviation'] ?? null; - $this->container['acronym'] = $data['acronym'] ?? null; - $this->container['icon'] = $data['icon'] ?? null; - $this->container['design_name'] = $data['design_name'] ?? null; - $this->container['display_name'] = $data['display_name'] ?? null; - $this->container['background_image_url'] = $data['background_image_url'] ?? null; - $this->container['company_logo_url'] = $data['company_logo_url'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('border_color', $data ?? [], null); + $this->setIfExists('border_style_type', $data ?? [], null); + $this->setIfExists('border_size', $data ?? [], null); + $this->setIfExists('border_radius', $data ?? [], null); + $this->setIfExists('font_color', $data ?? [], null); + $this->setIfExists('font_type', $data ?? [], null); + $this->setIfExists('abbreviation', $data ?? [], null); + $this->setIfExists('acronym', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('design_name', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('background_image_url', $data ?? [], null); + $this->setIfExists('company_logo_url', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -394,14 +496,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -460,9 +554,12 @@ public function getBorderColor() */ public function setBorderColor($border_color) { + if (is_null($border_color)) { + throw new \InvalidArgumentException('non-nullable border_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $border_color))) { - throw new \InvalidArgumentException("invalid value for $border_color when calling PaymentDesign., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($border_color)))) { + throw new \InvalidArgumentException("invalid value for \$border_color when calling PaymentDesign., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['border_color'] = $border_color; @@ -473,7 +570,7 @@ public function setBorderColor($border_color) /** * Gets border_style_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType */ public function getBorderStyleType() { @@ -483,12 +580,15 @@ public function getBorderStyleType() /** * Sets border_style_type * - * @param string $border_style_type border_style_type + * @param \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType $border_style_type border_style_type * * @return self */ public function setBorderStyleType($border_style_type) { + if (is_null($border_style_type)) { + throw new \InvalidArgumentException('non-nullable border_style_type cannot be null'); + } $this->container['border_style_type'] = $border_style_type; return $this; @@ -513,6 +613,9 @@ public function getBorderSize() */ public function setBorderSize($border_size) { + if (is_null($border_size)) { + throw new \InvalidArgumentException('non-nullable border_size cannot be null'); + } if ((mb_strlen($border_size) < 1)) { throw new \InvalidArgumentException('invalid length for $border_size when calling PaymentDesign., must be bigger than or equal to 1.'); @@ -542,6 +645,9 @@ public function getBorderRadius() */ public function setBorderRadius($border_radius) { + if (is_null($border_radius)) { + throw new \InvalidArgumentException('non-nullable border_radius cannot be null'); + } if (($border_radius > 20)) { throw new \InvalidArgumentException('invalid value for $border_radius when calling PaymentDesign., must be smaller than or equal to 20.'); @@ -574,9 +680,12 @@ public function getFontColor() */ public function setFontColor($font_color) { + if (is_null($font_color)) { + throw new \InvalidArgumentException('non-nullable font_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $font_color))) { - throw new \InvalidArgumentException("invalid value for $font_color when calling PaymentDesign., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($font_color)))) { + throw new \InvalidArgumentException("invalid value for \$font_color when calling PaymentDesign., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['font_color'] = $font_color; @@ -603,6 +712,9 @@ public function getFontType() */ public function setFontType($font_type) { + if (is_null($font_type)) { + throw new \InvalidArgumentException('non-nullable font_type cannot be null'); + } if ((mb_strlen($font_type) < 1)) { throw new \InvalidArgumentException('invalid length for $font_type when calling PaymentDesign., must be bigger than or equal to 1.'); @@ -632,6 +744,9 @@ public function getAbbreviation() */ public function setAbbreviation($abbreviation) { + if (is_null($abbreviation)) { + throw new \InvalidArgumentException('non-nullable abbreviation cannot be null'); + } if ((mb_strlen($abbreviation) < 1)) { throw new \InvalidArgumentException('invalid length for $abbreviation when calling PaymentDesign., must be bigger than or equal to 1.'); @@ -661,6 +776,9 @@ public function getAcronym() */ public function setAcronym($acronym) { + if (is_null($acronym)) { + throw new \InvalidArgumentException('non-nullable acronym cannot be null'); + } if ((mb_strlen($acronym) < 1)) { throw new \InvalidArgumentException('invalid length for $acronym when calling PaymentDesign., must be bigger than or equal to 1.'); @@ -690,6 +808,9 @@ public function getIcon() */ public function setIcon($icon) { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } if ((mb_strlen($icon) < 1)) { throw new \InvalidArgumentException('invalid length for $icon when calling PaymentDesign., must be bigger than or equal to 1.'); @@ -719,6 +840,9 @@ public function getDesignName() */ public function setDesignName($design_name) { + if (is_null($design_name)) { + throw new \InvalidArgumentException('non-nullable design_name cannot be null'); + } if ((mb_strlen($design_name) < 1)) { throw new \InvalidArgumentException('invalid length for $design_name when calling PaymentDesign., must be bigger than or equal to 1.'); @@ -748,6 +872,9 @@ public function getDisplayName() */ public function setDisplayName($display_name) { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } if ((mb_strlen($display_name) < 1)) { throw new \InvalidArgumentException('invalid length for $display_name when calling PaymentDesign., must be bigger than or equal to 1.'); @@ -777,6 +904,9 @@ public function getBackgroundImageUrl() */ public function setBackgroundImageUrl($background_image_url) { + if (is_null($background_image_url)) { + throw new \InvalidArgumentException('non-nullable background_image_url cannot be null'); + } $this->container['background_image_url'] = $background_image_url; return $this; @@ -801,6 +931,9 @@ public function getCompanyLogoUrl() */ public function setCompanyLogoUrl($company_logo_url) { + if (is_null($company_logo_url)) { + throw new \InvalidArgumentException('non-nullable company_logo_url cannot be null'); + } $this->container['company_logo_url'] = $company_logo_url; return $this; @@ -825,14 +958,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PaymentDesign., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PaymentDesign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling PaymentDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling PaymentDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -843,7 +979,7 @@ public function setEmployeeId($employee_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -853,19 +989,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling PaymentDesign., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling PaymentDesign., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -890,14 +1022,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PaymentDesign., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PaymentDesign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling PaymentDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling PaymentDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -924,6 +1059,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -948,6 +1086,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -972,6 +1113,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -983,7 +1127,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -995,6 +1139,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1008,7 +1153,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1024,7 +1169,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1036,6 +1181,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Performance.php b/lib/Model/Performance.php index a8e0bc6..695caf3 100644 --- a/lib/Model/Performance.php +++ b/lib/Model/Performance.php @@ -2,7 +2,7 @@ /** * Performance * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Performance implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,10 +67,10 @@ class Performance implements ModelInterface, ArrayAccess, \JsonSerializable 'is_sold_out' => 'bool', 'media_url' => 'string', 'payment_design_id' => 'string', - 'max_comp_tickets' => 'double', + 'max_comp_tickets' => 'float', 'ticket_expiration_date_time' => '\DateTime', 'redemption_instructions' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -106,6 +104,38 @@ class Performance implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'body' => false, + 'start_date_time' => false, + 'price' => false, + 'url' => false, + 'order_number' => false, + 'is_sold_out' => false, + 'media_url' => false, + 'payment_design_id' => false, + 'max_comp_tickets' => false, + 'ticket_expiration_date_time' => false, + 'redemption_instructions' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -126,6 +156,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -259,23 +341,41 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['body'] = $data['body'] ?? null; - $this->container['start_date_time'] = $data['start_date_time'] ?? null; - $this->container['price'] = $data['price'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['is_sold_out'] = $data['is_sold_out'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['max_comp_tickets'] = $data['max_comp_tickets'] ?? null; - $this->container['ticket_expiration_date_time'] = $data['ticket_expiration_date_time'] ?? null; - $this->container['redemption_instructions'] = $data['redemption_instructions'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('start_date_time', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('is_sold_out', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('max_comp_tickets', $data ?? [], null); + $this->setIfExists('ticket_expiration_date_time', $data ?? [], null); + $this->setIfExists('redemption_instructions', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -393,6 +493,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling Performance., must be bigger than or equal to 1.'); @@ -422,6 +525,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } if ((mb_strlen($body) < 1)) { throw new \InvalidArgumentException('invalid length for $body when calling Performance., must be bigger than or equal to 1.'); @@ -451,6 +557,9 @@ public function getStartDateTime() */ public function setStartDateTime($start_date_time) { + if (is_null($start_date_time)) { + throw new \InvalidArgumentException('non-nullable start_date_time cannot be null'); + } $this->container['start_date_time'] = $start_date_time; return $this; @@ -475,6 +584,9 @@ public function getPrice() */ public function setPrice($price) { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } $this->container['price'] = $price; @@ -501,6 +613,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } $this->container['url'] = $url; return $this; @@ -525,6 +640,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling Performance., must be bigger than or equal to 1.'); @@ -554,6 +672,9 @@ public function getIsSoldOut() */ public function setIsSoldOut($is_sold_out) { + if (is_null($is_sold_out)) { + throw new \InvalidArgumentException('non-nullable is_sold_out cannot be null'); + } $this->container['is_sold_out'] = $is_sold_out; return $this; @@ -578,6 +699,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -602,14 +726,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { - if (!is_null($payment_design_id) && (mb_strlen($payment_design_id) > 10)) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } + if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling Performance., must be smaller than or equal to 10.'); } - if (!is_null($payment_design_id) && (mb_strlen($payment_design_id) < 10)) { + if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling Performance., must be bigger than or equal to 10.'); } - if (!is_null($payment_design_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling Performance., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling Performance., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -620,7 +747,7 @@ public function setPaymentDesignId($payment_design_id) /** * Gets max_comp_tickets * - * @return double|null + * @return float|null */ public function getMaxCompTickets() { @@ -630,12 +757,15 @@ public function getMaxCompTickets() /** * Sets max_comp_tickets * - * @param double|null $max_comp_tickets max_comp_tickets + * @param float|null $max_comp_tickets max_comp_tickets * * @return self */ public function setMaxCompTickets($max_comp_tickets) { + if (is_null($max_comp_tickets)) { + throw new \InvalidArgumentException('non-nullable max_comp_tickets cannot be null'); + } $this->container['max_comp_tickets'] = $max_comp_tickets; return $this; @@ -660,6 +790,9 @@ public function getTicketExpirationDateTime() */ public function setTicketExpirationDateTime($ticket_expiration_date_time) { + if (is_null($ticket_expiration_date_time)) { + throw new \InvalidArgumentException('non-nullable ticket_expiration_date_time cannot be null'); + } $this->container['ticket_expiration_date_time'] = $ticket_expiration_date_time; return $this; @@ -684,6 +817,9 @@ public function getRedemptionInstructions() */ public function setRedemptionInstructions($redemption_instructions) { + if (is_null($redemption_instructions)) { + throw new \InvalidArgumentException('non-nullable redemption_instructions cannot be null'); + } $this->container['redemption_instructions'] = $redemption_instructions; return $this; @@ -692,7 +828,7 @@ public function setRedemptionInstructions($redemption_instructions) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -702,12 +838,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -732,6 +871,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -756,6 +898,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -780,6 +925,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -804,14 +952,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Performance., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Performance., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Performance., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Performance., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -825,7 +976,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -837,6 +988,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -850,7 +1002,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -866,7 +1018,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -878,6 +1030,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PhoneNumber.php b/lib/Model/PhoneNumber.php index a985ab6..e260f32 100644 --- a/lib/Model/PhoneNumber.php +++ b/lib/Model/PhoneNumber.php @@ -2,7 +2,7 @@ /** * PhoneNumber * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,7 +74,7 @@ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable 'is_short_code' => 'bool', 'twilio_sid' => 'string', 'twilio_account_sid' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -116,6 +114,43 @@ class PhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable 'is_approved' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message_footer' => false, + 'help_response' => false, + 'stop_response' => false, + 'company_name' => false, + 'privacy_policy_url' => false, + 'terms_of_service_url' => false, + 'help_desk_keyword' => false, + 'help_desk_queue_response' => false, + 'is_connected_to_watson' => false, + 'watson_conversation_workplace_id' => false, + 'watson_username' => false, + 'watson_password' => false, + 'mobile_number' => false, + 'is_short_code' => false, + 'twilio_sid' => false, + 'twilio_account_sid' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'is_approved' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -136,6 +171,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -284,28 +371,46 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['message_footer'] = $data['message_footer'] ?? null; - $this->container['help_response'] = $data['help_response'] ?? null; - $this->container['stop_response'] = $data['stop_response'] ?? null; - $this->container['company_name'] = $data['company_name'] ?? null; - $this->container['privacy_policy_url'] = $data['privacy_policy_url'] ?? null; - $this->container['terms_of_service_url'] = $data['terms_of_service_url'] ?? null; - $this->container['help_desk_keyword'] = $data['help_desk_keyword'] ?? null; - $this->container['help_desk_queue_response'] = $data['help_desk_queue_response'] ?? null; - $this->container['is_connected_to_watson'] = $data['is_connected_to_watson'] ?? null; - $this->container['watson_conversation_workplace_id'] = $data['watson_conversation_workplace_id'] ?? null; - $this->container['watson_username'] = $data['watson_username'] ?? null; - $this->container['watson_password'] = $data['watson_password'] ?? null; - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['is_short_code'] = $data['is_short_code'] ?? null; - $this->container['twilio_sid'] = $data['twilio_sid'] ?? null; - $this->container['twilio_account_sid'] = $data['twilio_account_sid'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['is_approved'] = $data['is_approved'] ?? null; + $this->setIfExists('message_footer', $data ?? [], null); + $this->setIfExists('help_response', $data ?? [], null); + $this->setIfExists('stop_response', $data ?? [], null); + $this->setIfExists('company_name', $data ?? [], null); + $this->setIfExists('privacy_policy_url', $data ?? [], null); + $this->setIfExists('terms_of_service_url', $data ?? [], null); + $this->setIfExists('help_desk_keyword', $data ?? [], null); + $this->setIfExists('help_desk_queue_response', $data ?? [], null); + $this->setIfExists('is_connected_to_watson', $data ?? [], null); + $this->setIfExists('watson_conversation_workplace_id', $data ?? [], null); + $this->setIfExists('watson_username', $data ?? [], null); + $this->setIfExists('watson_password', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('is_short_code', $data ?? [], null); + $this->setIfExists('twilio_sid', $data ?? [], null); + $this->setIfExists('twilio_account_sid', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('is_approved', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -376,14 +481,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -445,6 +542,9 @@ public function getMessageFooter() */ public function setMessageFooter($message_footer) { + if (is_null($message_footer)) { + throw new \InvalidArgumentException('non-nullable message_footer cannot be null'); + } if ((mb_strlen($message_footer) < 1)) { throw new \InvalidArgumentException('invalid length for $message_footer when calling PhoneNumber., must be bigger than or equal to 1.'); @@ -474,6 +574,9 @@ public function getHelpResponse() */ public function setHelpResponse($help_response) { + if (is_null($help_response)) { + throw new \InvalidArgumentException('non-nullable help_response cannot be null'); + } $this->container['help_response'] = $help_response; return $this; @@ -498,6 +601,9 @@ public function getStopResponse() */ public function setStopResponse($stop_response) { + if (is_null($stop_response)) { + throw new \InvalidArgumentException('non-nullable stop_response cannot be null'); + } $this->container['stop_response'] = $stop_response; return $this; @@ -522,6 +628,9 @@ public function getCompanyName() */ public function setCompanyName($company_name) { + if (is_null($company_name)) { + throw new \InvalidArgumentException('non-nullable company_name cannot be null'); + } if ((mb_strlen($company_name) < 1)) { throw new \InvalidArgumentException('invalid length for $company_name when calling PhoneNumber., must be bigger than or equal to 1.'); @@ -551,6 +660,9 @@ public function getPrivacyPolicyUrl() */ public function setPrivacyPolicyUrl($privacy_policy_url) { + if (is_null($privacy_policy_url)) { + throw new \InvalidArgumentException('non-nullable privacy_policy_url cannot be null'); + } $this->container['privacy_policy_url'] = $privacy_policy_url; return $this; @@ -575,6 +687,9 @@ public function getTermsOfServiceUrl() */ public function setTermsOfServiceUrl($terms_of_service_url) { + if (is_null($terms_of_service_url)) { + throw new \InvalidArgumentException('non-nullable terms_of_service_url cannot be null'); + } $this->container['terms_of_service_url'] = $terms_of_service_url; return $this; @@ -599,6 +714,9 @@ public function getHelpDeskKeyword() */ public function setHelpDeskKeyword($help_desk_keyword) { + if (is_null($help_desk_keyword)) { + throw new \InvalidArgumentException('non-nullable help_desk_keyword cannot be null'); + } $this->container['help_desk_keyword'] = $help_desk_keyword; return $this; @@ -623,6 +741,9 @@ public function getHelpDeskQueueResponse() */ public function setHelpDeskQueueResponse($help_desk_queue_response) { + if (is_null($help_desk_queue_response)) { + throw new \InvalidArgumentException('non-nullable help_desk_queue_response cannot be null'); + } $this->container['help_desk_queue_response'] = $help_desk_queue_response; return $this; @@ -647,6 +768,9 @@ public function getIsConnectedToWatson() */ public function setIsConnectedToWatson($is_connected_to_watson) { + if (is_null($is_connected_to_watson)) { + throw new \InvalidArgumentException('non-nullable is_connected_to_watson cannot be null'); + } $this->container['is_connected_to_watson'] = $is_connected_to_watson; return $this; @@ -671,6 +795,9 @@ public function getWatsonConversationWorkplaceId() */ public function setWatsonConversationWorkplaceId($watson_conversation_workplace_id) { + if (is_null($watson_conversation_workplace_id)) { + throw new \InvalidArgumentException('non-nullable watson_conversation_workplace_id cannot be null'); + } $this->container['watson_conversation_workplace_id'] = $watson_conversation_workplace_id; return $this; @@ -695,6 +822,9 @@ public function getWatsonUsername() */ public function setWatsonUsername($watson_username) { + if (is_null($watson_username)) { + throw new \InvalidArgumentException('non-nullable watson_username cannot be null'); + } $this->container['watson_username'] = $watson_username; return $this; @@ -719,6 +849,9 @@ public function getWatsonPassword() */ public function setWatsonPassword($watson_password) { + if (is_null($watson_password)) { + throw new \InvalidArgumentException('non-nullable watson_password cannot be null'); + } $this->container['watson_password'] = $watson_password; return $this; @@ -743,6 +876,9 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } $this->container['mobile_number'] = $mobile_number; return $this; @@ -767,6 +903,9 @@ public function getIsShortCode() */ public function setIsShortCode($is_short_code) { + if (is_null($is_short_code)) { + throw new \InvalidArgumentException('non-nullable is_short_code cannot be null'); + } $this->container['is_short_code'] = $is_short_code; return $this; @@ -791,6 +930,9 @@ public function getTwilioSid() */ public function setTwilioSid($twilio_sid) { + if (is_null($twilio_sid)) { + throw new \InvalidArgumentException('non-nullable twilio_sid cannot be null'); + } $this->container['twilio_sid'] = $twilio_sid; return $this; @@ -815,6 +957,9 @@ public function getTwilioAccountSid() */ public function setTwilioAccountSid($twilio_account_sid) { + if (is_null($twilio_account_sid)) { + throw new \InvalidArgumentException('non-nullable twilio_account_sid cannot be null'); + } $this->container['twilio_account_sid'] = $twilio_account_sid; return $this; @@ -823,7 +968,7 @@ public function setTwilioAccountSid($twilio_account_sid) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -833,19 +978,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling PhoneNumber., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling PhoneNumber., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -870,14 +1011,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PhoneNumber., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PhoneNumber., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling PhoneNumber., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling PhoneNumber., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -904,6 +1048,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -928,6 +1075,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -952,6 +1102,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -976,6 +1129,9 @@ public function getIsApproved() */ public function setIsApproved($is_approved) { + if (is_null($is_approved)) { + throw new \InvalidArgumentException('non-nullable is_approved cannot be null'); + } $this->container['is_approved'] = $is_approved; return $this; @@ -987,7 +1143,7 @@ public function setIsApproved($is_approved) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -999,6 +1155,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1012,7 +1169,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1028,7 +1185,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1040,6 +1197,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PhoneNumberCapabilities.php b/lib/Model/PhoneNumberCapabilities.php index e7ce2c0..107ed32 100644 --- a/lib/Model/PhoneNumberCapabilities.php +++ b/lib/Model/PhoneNumberCapabilities.php @@ -2,7 +2,7 @@ /** * PhoneNumberCapabilities * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PhoneNumberCapabilities implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -80,6 +78,25 @@ class PhoneNumberCapabilities implements ModelInterface, ArrayAccess, \JsonSeria 'mms' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'fax' => false, + 'voice' => false, + 'sms' => false, + 'mms' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +117,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -194,10 +263,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['fax'] = $data['fax'] ?? null; - $this->container['voice'] = $data['voice'] ?? null; - $this->container['sms'] = $data['sms'] ?? null; - $this->container['mms'] = $data['mms'] ?? null; + $this->setIfExists('fax', $data ?? [], null); + $this->setIfExists('voice', $data ?? [], null); + $this->setIfExists('sms', $data ?? [], null); + $this->setIfExists('mms', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -255,6 +342,9 @@ public function getFax() */ public function setFax($fax) { + if (is_null($fax)) { + throw new \InvalidArgumentException('non-nullable fax cannot be null'); + } $this->container['fax'] = $fax; return $this; @@ -279,6 +369,9 @@ public function getVoice() */ public function setVoice($voice) { + if (is_null($voice)) { + throw new \InvalidArgumentException('non-nullable voice cannot be null'); + } $this->container['voice'] = $voice; return $this; @@ -303,6 +396,9 @@ public function getSms() */ public function setSms($sms) { + if (is_null($sms)) { + throw new \InvalidArgumentException('non-nullable sms cannot be null'); + } $this->container['sms'] = $sms; return $this; @@ -327,6 +423,9 @@ public function getMms() */ public function setMms($mms) { + if (is_null($mms)) { + throw new \InvalidArgumentException('non-nullable mms cannot be null'); + } $this->container['mms'] = $mms; return $this; @@ -338,7 +437,7 @@ public function setMms($mms) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -350,6 +449,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -363,7 +463,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -379,7 +479,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -391,6 +491,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive.php b/lib/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive.php index df435d7..f6d4f2b 100644 --- a/lib/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive.php +++ b/lib/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive.php @@ -2,7 +2,7 @@ /** * PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherC protected static $openAPITypes = [ 'title' => 'string', 'notes' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'display_value' => 'string', 'merchants_reference_id' => 'string', 'valid_only_at_pos_register_ids' => 'string[]', @@ -99,6 +97,34 @@ class PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherC 'cell_phone' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'notes' => false, + 'value_type' => false, + 'display_value' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'start_date_time' => false, + 'expiration_date_time' => false, + 'source_id' => false, + 'member_id' => false, + 'offer_amount_cents' => false, + 'cell_phone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -119,6 +145,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -240,19 +318,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['start_date_time'] = $data['start_date_time'] ?? null; - $this->container['expiration_date_time'] = $data['expiration_date_time'] ?? null; - $this->container['source_id'] = $data['source_id'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['offer_amount_cents'] = $data['offer_amount_cents'] ?? null; - $this->container['cell_phone'] = $data['cell_phone'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('start_date_time', $data ?? [], null); + $this->setIfExists('expiration_date_time', $data ?? [], null); + $this->setIfExists('source_id', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('offer_amount_cents', $data ?? [], null); + $this->setIfExists('cell_phone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -346,6 +442,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive., must be bigger than or equal to 1.'); @@ -375,6 +474,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -383,7 +485,7 @@ public function setNotes($notes) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -393,12 +495,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -423,6 +528,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } $this->container['display_value'] = $display_value; return $this; @@ -447,6 +555,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -471,6 +582,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -495,14 +609,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -529,6 +646,9 @@ public function getStartDateTime() */ public function setStartDateTime($start_date_time) { + if (is_null($start_date_time)) { + throw new \InvalidArgumentException('non-nullable start_date_time cannot be null'); + } $this->container['start_date_time'] = $start_date_time; return $this; @@ -553,6 +673,9 @@ public function getExpirationDateTime() */ public function setExpirationDateTime($expiration_date_time) { + if (is_null($expiration_date_time)) { + throw new \InvalidArgumentException('non-nullable expiration_date_time cannot be null'); + } $this->container['expiration_date_time'] = $expiration_date_time; return $this; @@ -577,6 +700,9 @@ public function getSourceId() */ public function setSourceId($source_id) { + if (is_null($source_id)) { + throw new \InvalidArgumentException('non-nullable source_id cannot be null'); + } $this->container['source_id'] = $source_id; return $this; @@ -601,9 +727,12 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -630,6 +759,9 @@ public function getOfferAmountCents() */ public function setOfferAmountCents($offer_amount_cents) { + if (is_null($offer_amount_cents)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents cannot be null'); + } if (($offer_amount_cents < 0)) { throw new \InvalidArgumentException('invalid value for $offer_amount_cents when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherIsActive., must be bigger than or equal to 0.'); @@ -659,6 +791,9 @@ public function getCellPhone() */ public function setCellPhone($cell_phone) { + if (is_null($cell_phone)) { + throw new \InvalidArgumentException('non-nullable cell_phone cannot be null'); + } $this->container['cell_phone'] = $cell_phone; return $this; @@ -670,7 +805,7 @@ public function setCellPhone($cell_phone) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -682,6 +817,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -695,7 +831,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -711,7 +847,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -723,6 +859,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.php b/lib/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.php index 7f8f1fd..877e7bc 100644 --- a/lib/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.php +++ b/lib/Model/PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.php @@ -2,7 +2,7 @@ /** * PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherC protected static $openAPITypes = [ 'title' => 'string', 'notes' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'display_value' => 'string', 'merchants_reference_id' => 'string', 'valid_only_at_pos_register_ids' => 'string[]', @@ -97,6 +95,33 @@ class PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherC 'cell_phone' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'notes' => false, + 'value_type' => false, + 'display_value' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'start_date_time' => false, + 'expiration_date_time' => false, + 'member_id' => false, + 'offer_amount_cents' => false, + 'cell_phone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -117,6 +142,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -235,18 +312,36 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['start_date_time'] = $data['start_date_time'] ?? null; - $this->container['expiration_date_time'] = $data['expiration_date_time'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['offer_amount_cents'] = $data['offer_amount_cents'] ?? null; - $this->container['cell_phone'] = $data['cell_phone'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('start_date_time', $data ?? [], null); + $this->setIfExists('expiration_date_time', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('offer_amount_cents', $data ?? [], null); + $this->setIfExists('cell_phone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -337,6 +432,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID., must be bigger than or equal to 1.'); @@ -366,6 +464,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -374,7 +475,7 @@ public function setNotes($notes) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -384,12 +485,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -414,6 +518,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } $this->container['display_value'] = $display_value; return $this; @@ -438,6 +545,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -462,6 +572,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -486,14 +599,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -520,6 +636,9 @@ public function getStartDateTime() */ public function setStartDateTime($start_date_time) { + if (is_null($start_date_time)) { + throw new \InvalidArgumentException('non-nullable start_date_time cannot be null'); + } $this->container['start_date_time'] = $start_date_time; return $this; @@ -544,6 +663,9 @@ public function getExpirationDateTime() */ public function setExpirationDateTime($expiration_date_time) { + if (is_null($expiration_date_time)) { + throw new \InvalidArgumentException('non-nullable expiration_date_time cannot be null'); + } $this->container['expiration_date_time'] = $expiration_date_time; return $this; @@ -568,9 +690,12 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -597,6 +722,9 @@ public function getOfferAmountCents() */ public function setOfferAmountCents($offer_amount_cents) { + if (is_null($offer_amount_cents)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents cannot be null'); + } if (($offer_amount_cents < 0)) { throw new \InvalidArgumentException('invalid value for $offer_amount_cents when calling PickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID., must be bigger than or equal to 0.'); @@ -626,6 +754,9 @@ public function getCellPhone() */ public function setCellPhone($cell_phone) { + if (is_null($cell_phone)) { + throw new \InvalidArgumentException('non-nullable cell_phone cannot be null'); + } $this->container['cell_phone'] = $cell_phone; return $this; @@ -637,7 +768,7 @@ public function setCellPhone($cell_phone) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -649,6 +780,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -662,7 +794,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -678,7 +810,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -690,6 +822,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickMSEmployeeAPIKeyCreateParamsExcludeKeyofMSEmployeeAPIKeyCreateParamsEmployeeID.php b/lib/Model/PickMSEmployeeAPIKeyCreateParamsExcludeKeyofMSEmployeeAPIKeyCreateParamsEmployeeID.php index d1faa7d..467f548 100644 --- a/lib/Model/PickMSEmployeeAPIKeyCreateParamsExcludeKeyofMSEmployeeAPIKeyCreateParamsEmployeeID.php +++ b/lib/Model/PickMSEmployeeAPIKeyCreateParamsExcludeKeyofMSEmployeeAPIKeyCreateParamsEmployeeID.php @@ -2,7 +2,7 @@ /** * PickMSEmployeeAPIKeyCreateParamsExcludeKeyofMSEmployeeAPIKeyCreateParamsEmployeeID * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickMSEmployeeAPIKeyCreateParamsExcludeKeyofMSEmployeeAPIKeyCreateParamsEmployeeID implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -77,6 +75,23 @@ class PickMSEmployeeAPIKeyCreateParamsExcludeKeyofMSEmployeeAPIKeyCreateParamsEm 'description' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +112,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -185,8 +252,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +331,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling PickMSEmployeeAPIKeyCreateParamsExcludeKeyofMSEmployeeAPIKeyCreateParamsEmployeeID., must be bigger than or equal to 1.'); @@ -275,6 +363,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling PickMSEmployeeAPIKeyCreateParamsExcludeKeyofMSEmployeeAPIKeyCreateParamsEmployeeID., must be bigger than or equal to 1.'); @@ -291,7 +382,7 @@ public function setDescription($description) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -303,6 +394,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -316,7 +408,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,7 +424,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -344,6 +436,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickMSEmployeeAPIKeyUpdateParamsExcludeKeyofMSEmployeeAPIKeyUpdateParamsId.php b/lib/Model/PickMSEmployeeAPIKeyUpdateParamsExcludeKeyofMSEmployeeAPIKeyUpdateParamsId.php index 18fc608..5bd624a 100644 --- a/lib/Model/PickMSEmployeeAPIKeyUpdateParamsExcludeKeyofMSEmployeeAPIKeyUpdateParamsId.php +++ b/lib/Model/PickMSEmployeeAPIKeyUpdateParamsExcludeKeyofMSEmployeeAPIKeyUpdateParamsId.php @@ -2,7 +2,7 @@ /** * PickMSEmployeeAPIKeyUpdateParamsExcludeKeyofMSEmployeeAPIKeyUpdateParamsId * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickMSEmployeeAPIKeyUpdateParamsExcludeKeyofMSEmployeeAPIKeyUpdateParamsId implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -77,6 +75,23 @@ class PickMSEmployeeAPIKeyUpdateParamsExcludeKeyofMSEmployeeAPIKeyUpdateParamsId 'description' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +112,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -185,8 +252,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +331,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling PickMSEmployeeAPIKeyUpdateParamsExcludeKeyofMSEmployeeAPIKeyUpdateParamsId., must be bigger than or equal to 1.'); @@ -275,6 +363,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling PickMSEmployeeAPIKeyUpdateParamsExcludeKeyofMSEmployeeAPIKeyUpdateParamsId., must be bigger than or equal to 1.'); @@ -291,7 +382,7 @@ public function setDescription($description) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -303,6 +394,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -316,7 +408,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,7 +424,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -344,6 +436,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.php b/lib/Model/PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.php index c9bab7f..e863bd3 100644 --- a/lib/Model/PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.php +++ b/lib/Model/PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.php @@ -2,7 +2,7 @@ /** * PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -65,6 +63,8 @@ class PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifi 'last_name' => 'string', 'membership_tier_id' => 'string', 'mobile_number' => 'string', + 'email' => 'string', + 'birthday' => 'string', 'points_accrued' => 'int' ]; @@ -80,9 +80,33 @@ class PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifi 'last_name' => null, 'membership_tier_id' => null, 'mobile_number' => null, + 'email' => null, + 'birthday' => null, 'points_accrued' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'membership_tier_id' => false, + 'mobile_number' => false, + 'email' => false, + 'birthday' => false, + 'points_accrued' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -103,6 +127,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -114,6 +190,8 @@ public static function openAPIFormats() 'last_name' => 'lastName', 'membership_tier_id' => 'membershipTierID', 'mobile_number' => 'mobileNumber', + 'email' => 'email', + 'birthday' => 'birthday', 'points_accrued' => 'pointsAccrued' ]; @@ -127,6 +205,8 @@ public static function openAPIFormats() 'last_name' => 'setLastName', 'membership_tier_id' => 'setMembershipTierId', 'mobile_number' => 'setMobileNumber', + 'email' => 'setEmail', + 'birthday' => 'setBirthday', 'points_accrued' => 'setPointsAccrued' ]; @@ -140,6 +220,8 @@ public static function openAPIFormats() 'last_name' => 'getLastName', 'membership_tier_id' => 'getMembershipTierId', 'mobile_number' => 'getMobileNumber', + 'email' => 'getEmail', + 'birthday' => 'getBirthday', 'points_accrued' => 'getPointsAccrued' ]; @@ -200,11 +282,31 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['membership_tier_id'] = $data['membership_tier_id'] ?? null; - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['points_accrued'] = $data['points_accrued'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('membership_tier_id', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('birthday', $data ?? [], null); + $this->setIfExists('points_accrued', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -234,6 +336,12 @@ public function listInvalidProperties() if ($this->container['mobile_number'] === null) { $invalidProperties[] = "'mobile_number' can't be null"; } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['birthday'] === null) { + $invalidProperties[] = "'birthday' can't be null"; + } if ($this->container['points_accrued'] === null) { $invalidProperties[] = "'points_accrued' can't be null"; } @@ -275,6 +383,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } $this->container['first_name'] = $first_name; return $this; @@ -299,6 +410,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } $this->container['last_name'] = $last_name; return $this; @@ -323,14 +437,17 @@ public function getMembershipTierId() */ public function setMembershipTierId($membership_tier_id) { + if (is_null($membership_tier_id)) { + throw new \InvalidArgumentException('non-nullable membership_tier_id cannot be null'); + } if ((mb_strlen($membership_tier_id) > 10)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier., must be smaller than or equal to 10.'); } if ((mb_strlen($membership_tier_id) < 10)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $membership_tier_id))) { - throw new \InvalidArgumentException("invalid value for $membership_tier_id when calling PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($membership_tier_id)))) { + throw new \InvalidArgumentException("invalid value for \$membership_tier_id when calling PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['membership_tier_id'] = $membership_tier_id; @@ -357,11 +474,68 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } $this->container['mobile_number'] = $mobile_number; return $this; } + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets birthday + * + * @return string + */ + public function getBirthday() + { + return $this->container['birthday']; + } + + /** + * Sets birthday + * + * @param string $birthday Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured + * + * @return self + */ + public function setBirthday($birthday) + { + if (is_null($birthday)) { + throw new \InvalidArgumentException('non-nullable birthday cannot be null'); + } + $this->container['birthday'] = $birthday; + + return $this; + } + /** * Gets points_accrued * @@ -381,6 +555,9 @@ public function getPointsAccrued() */ public function setPointsAccrued($points_accrued) { + if (is_null($points_accrued)) { + throw new \InvalidArgumentException('non-nullable points_accrued cannot be null'); + } if (($points_accrued < 0)) { throw new \InvalidArgumentException('invalid value for $points_accrued when calling PickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier., must be bigger than or equal to 0.'); @@ -397,7 +574,7 @@ public function setPointsAccrued($points_accrued) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -409,6 +586,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -422,7 +600,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -438,7 +616,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -450,6 +628,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickMSMemberExcludeKeyofMSMemberMemberIdentifier.php b/lib/Model/PickMSMemberExcludeKeyofMSMemberMemberIdentifier.php index 5238738..d25c9b5 100644 --- a/lib/Model/PickMSMemberExcludeKeyofMSMemberMemberIdentifier.php +++ b/lib/Model/PickMSMemberExcludeKeyofMSMemberMemberIdentifier.php @@ -2,7 +2,7 @@ /** * PickMSMemberExcludeKeyofMSMemberMemberIdentifier * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickMSMemberExcludeKeyofMSMemberMemberIdentifier implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -70,6 +68,8 @@ class PickMSMemberExcludeKeyofMSMemberMemberIdentifier implements ModelInterface 'last_name' => 'string', 'membership_tier_id' => 'string', 'mobile_number' => 'string', + 'email' => 'string', + 'birthday' => 'string', 'points_accrued' => 'int' ]; @@ -90,9 +90,38 @@ class PickMSMemberExcludeKeyofMSMemberMemberIdentifier implements ModelInterface 'last_name' => null, 'membership_tier_id' => null, 'mobile_number' => null, + 'email' => null, + 'birthday' => null, 'points_accrued' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'first_name' => false, + 'last_name' => false, + 'membership_tier_id' => false, + 'mobile_number' => false, + 'email' => false, + 'birthday' => false, + 'points_accrued' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -113,6 +142,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -129,6 +210,8 @@ public static function openAPIFormats() 'last_name' => 'lastName', 'membership_tier_id' => 'membershipTierID', 'mobile_number' => 'mobileNumber', + 'email' => 'email', + 'birthday' => 'birthday', 'points_accrued' => 'pointsAccrued' ]; @@ -147,6 +230,8 @@ public static function openAPIFormats() 'last_name' => 'setLastName', 'membership_tier_id' => 'setMembershipTierId', 'mobile_number' => 'setMobileNumber', + 'email' => 'setEmail', + 'birthday' => 'setBirthday', 'points_accrued' => 'setPointsAccrued' ]; @@ -165,6 +250,8 @@ public static function openAPIFormats() 'last_name' => 'getLastName', 'membership_tier_id' => 'getMembershipTierId', 'mobile_number' => 'getMobileNumber', + 'email' => 'getEmail', + 'birthday' => 'getBirthday', 'points_accrued' => 'getPointsAccrued' ]; @@ -225,16 +312,36 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['membership_tier_id'] = $data['membership_tier_id'] ?? null; - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['points_accrued'] = $data['points_accrued'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('membership_tier_id', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('birthday', $data ?? [], null); + $this->setIfExists('points_accrued', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -303,6 +410,12 @@ public function listInvalidProperties() if ($this->container['mobile_number'] === null) { $invalidProperties[] = "'mobile_number' can't be null"; } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['birthday'] === null) { + $invalidProperties[] = "'birthday' can't be null"; + } if ($this->container['points_accrued'] === null) { $invalidProperties[] = "'points_accrued' can't be null"; } @@ -344,14 +457,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -378,14 +494,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -412,6 +531,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -436,6 +558,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -460,6 +585,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -484,6 +612,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } $this->container['first_name'] = $first_name; return $this; @@ -508,6 +639,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } $this->container['last_name'] = $last_name; return $this; @@ -532,14 +666,17 @@ public function getMembershipTierId() */ public function setMembershipTierId($membership_tier_id) { + if (is_null($membership_tier_id)) { + throw new \InvalidArgumentException('non-nullable membership_tier_id cannot be null'); + } if ((mb_strlen($membership_tier_id) > 10)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must be smaller than or equal to 10.'); } if ((mb_strlen($membership_tier_id) < 10)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $membership_tier_id))) { - throw new \InvalidArgumentException("invalid value for $membership_tier_id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($membership_tier_id)))) { + throw new \InvalidArgumentException("invalid value for \$membership_tier_id when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['membership_tier_id'] = $membership_tier_id; @@ -566,11 +703,68 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } $this->container['mobile_number'] = $mobile_number; return $this; } + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets birthday + * + * @return string + */ + public function getBirthday() + { + return $this->container['birthday']; + } + + /** + * Sets birthday + * + * @param string $birthday Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured + * + * @return self + */ + public function setBirthday($birthday) + { + if (is_null($birthday)) { + throw new \InvalidArgumentException('non-nullable birthday cannot be null'); + } + $this->container['birthday'] = $birthday; + + return $this; + } + /** * Gets points_accrued * @@ -590,6 +784,9 @@ public function getPointsAccrued() */ public function setPointsAccrued($points_accrued) { + if (is_null($points_accrued)) { + throw new \InvalidArgumentException('non-nullable points_accrued cannot be null'); + } if (($points_accrued < 0)) { throw new \InvalidArgumentException('invalid value for $points_accrued when calling PickMSMemberExcludeKeyofMSMemberMemberIdentifier., must be bigger than or equal to 0.'); @@ -606,7 +803,7 @@ public function setPointsAccrued($points_accrued) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -618,6 +815,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -631,7 +829,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -647,7 +845,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -659,6 +857,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier.php b/lib/Model/PickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier.php index 59c0bb0..b91bfa2 100644 --- a/lib/Model/PickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier.php +++ b/lib/Model/PickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier.php @@ -2,7 +2,7 @@ /** * PickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -77,6 +75,23 @@ class PickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationPara 'credit_amount' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'mobile_number' => false, + 'credit_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +112,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -185,8 +252,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['credit_amount'] = $data['credit_amount'] ?? null; + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('credit_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +331,9 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } if ((mb_strlen($mobile_number) < 1)) { throw new \InvalidArgumentException('invalid length for $mobile_number when calling PickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier., must be bigger than or equal to 1.'); @@ -275,6 +363,9 @@ public function getCreditAmount() */ public function setCreditAmount($credit_amount) { + if (is_null($credit_amount)) { + throw new \InvalidArgumentException('non-nullable credit_amount cannot be null'); + } if (($credit_amount < 0)) { throw new \InvalidArgumentException('invalid value for $credit_amount when calling PickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier., must be bigger than or equal to 0.'); @@ -291,7 +382,7 @@ public function setCreditAmount($credit_amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -303,6 +394,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -316,7 +408,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,7 +424,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -344,6 +436,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier.php b/lib/Model/PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier.php index 643d734..000fc02 100644 --- a/lib/Model/PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier.php +++ b/lib/Model/PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier.php @@ -2,7 +2,7 @@ /** * PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -87,6 +85,28 @@ class PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier implement 'credit_amount' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'mobile_number' => false, + 'credit_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -107,6 +127,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -210,13 +282,31 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['credit_amount'] = $data['credit_amount'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('credit_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -315,14 +405,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -349,14 +442,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -383,6 +479,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -407,6 +506,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -431,6 +533,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -455,6 +560,9 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } if ((mb_strlen($mobile_number) < 1)) { throw new \InvalidArgumentException('invalid length for $mobile_number when calling PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier., must be bigger than or equal to 1.'); @@ -484,6 +592,9 @@ public function getCreditAmount() */ public function setCreditAmount($credit_amount) { + if (is_null($credit_amount)) { + throw new \InvalidArgumentException('non-nullable credit_amount cannot be null'); + } if (($credit_amount < 0)) { throw new \InvalidArgumentException('invalid value for $credit_amount when calling PickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier., must be bigger than or equal to 0.'); @@ -500,7 +611,7 @@ public function setCreditAmount($credit_amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -512,6 +623,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -525,7 +637,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -541,7 +653,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -553,6 +665,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortOptionsSortKey.php b/lib/Model/PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortOptionsSortKey.php index 2b721dc..d84e2b4 100644 --- a/lib/Model/PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortOptionsSortKey.php +++ b/lib/Model/PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortOptionsSortKey.php @@ -2,7 +2,7 @@ /** * PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortOptionsSortKey * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortOptionsSortKey implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortO 'is_archive_included' => 'bool', 'page_size' => 'int', 'page_num' => 'int', - 'sort_order' => 'string' + 'sort_order' => '\OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder' ]; /** @@ -81,6 +79,25 @@ class PickPaginationRequestWithSortOptionsExcludeKeyofPaginationRequestWithSortO 'sort_order' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'is_archive_included' => false, + 'page_size' => false, + 'page_num' => false, + 'sort_order' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -101,6 +118,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -195,10 +264,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['is_archive_included'] = $data['is_archive_included'] ?? null; - $this->container['page_size'] = $data['page_size'] ?? null; - $this->container['page_num'] = $data['page_num'] ?? null; - $this->container['sort_order'] = $data['sort_order'] ?? null; + $this->setIfExists('is_archive_included', $data ?? [], null); + $this->setIfExists('page_size', $data ?? [], null); + $this->setIfExists('page_num', $data ?? [], null); + $this->setIfExists('sort_order', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -244,6 +331,9 @@ public function getIsArchiveIncluded() */ public function setIsArchiveIncluded($is_archive_included) { + if (is_null($is_archive_included)) { + throw new \InvalidArgumentException('non-nullable is_archive_included cannot be null'); + } $this->container['is_archive_included'] = $is_archive_included; return $this; @@ -268,6 +358,9 @@ public function getPageSize() */ public function setPageSize($page_size) { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } $this->container['page_size'] = $page_size; return $this; @@ -292,6 +385,9 @@ public function getPageNum() */ public function setPageNum($page_num) { + if (is_null($page_num)) { + throw new \InvalidArgumentException('non-nullable page_num cannot be null'); + } $this->container['page_num'] = $page_num; return $this; @@ -300,7 +396,7 @@ public function setPageNum($page_num) /** * Gets sort_order * - * @return string|null + * @return \OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder|null */ public function getSortOrder() { @@ -310,12 +406,15 @@ public function getSortOrder() /** * Sets sort_order * - * @param string|null $sort_order Denotes the sort order + * @param \OpenAPI\Client\Model\PaginationRequestWithSortOptionsSortOrder|null $sort_order sort_order * * @return self */ public function setSortOrder($sort_order) { + if (is_null($sort_order)) { + throw new \InvalidArgumentException('non-nullable sort_order cannot be null'); + } $this->container['sort_order'] = $sort_order; return $this; @@ -327,7 +426,7 @@ public function setSortOrder($sort_order) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -339,6 +438,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -352,7 +452,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -368,7 +468,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -380,6 +480,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded.php b/lib/Model/PickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded.php index 0be7070..9a1436c 100644 --- a/lib/Model/PickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded.php +++ b/lib/Model/PickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded.php @@ -2,7 +2,7 @@ /** * PickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -77,6 +75,23 @@ class PickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithou 'page_num' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'page_size' => false, + 'page_num' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +112,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -185,8 +252,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['page_size'] = $data['page_size'] ?? null; - $this->container['page_num'] = $data['page_num'] ?? null; + $this->setIfExists('page_size', $data ?? [], null); + $this->setIfExists('page_num', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -232,6 +317,9 @@ public function getPageSize() */ public function setPageSize($page_size) { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } $this->container['page_size'] = $page_size; return $this; @@ -256,6 +344,9 @@ public function getPageNum() */ public function setPageNum($page_num) { + if (is_null($page_num)) { + throw new \InvalidArgumentException('non-nullable page_num cannot be null'); + } $this->container['page_num'] = $page_num; return $this; @@ -267,7 +358,7 @@ public function setPageNum($page_num) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -279,6 +370,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -292,7 +384,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -308,7 +400,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -320,6 +412,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickSSImportedListRecipientFromMembershipTierImportExcludeKeyofSSImportedListRecipientFromMembershipTierImportEmployeeIDOrTierID.php b/lib/Model/PickSSImportedListRecipientFromMembershipTierImportExcludeKeyofSSImportedListRecipientFromMembershipTierImportEmployeeIDOrTierID.php index 93ecfb1..c5dc5ff 100644 --- a/lib/Model/PickSSImportedListRecipientFromMembershipTierImportExcludeKeyofSSImportedListRecipientFromMembershipTierImportEmployeeIDOrTierID.php +++ b/lib/Model/PickSSImportedListRecipientFromMembershipTierImportExcludeKeyofSSImportedListRecipientFromMembershipTierImportEmployeeIDOrTierID.php @@ -2,7 +2,7 @@ /** * PickSSImportedListRecipientFromMembershipTierImportExcludeKeyofSSImportedListRecipientFromMembershipTierImportEmployeeIDOrTierID * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickSSImportedListRecipientFromMembershipTierImportExcludeKeyofSSImportedListRecipientFromMembershipTierImportEmployeeIDOrTierID implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -77,6 +75,23 @@ class PickSSImportedListRecipientFromMembershipTierImportExcludeKeyofSSImportedL 'phone_number_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'list_name' => false, + 'phone_number_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +112,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -185,8 +252,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['list_name'] = $data['list_name'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; + $this->setIfExists('list_name', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -250,6 +335,9 @@ public function getListName() */ public function setListName($list_name) { + if (is_null($list_name)) { + throw new \InvalidArgumentException('non-nullable list_name cannot be null'); + } $this->container['list_name'] = $list_name; return $this; @@ -274,14 +362,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickSSImportedListRecipientFromMembershipTierImportExcludeKeyofSSImportedListRecipientFromMembershipTierImportEmployeeIDOrTierID., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickSSImportedListRecipientFromMembershipTierImportExcludeKeyofSSImportedListRecipientFromMembershipTierImportEmployeeIDOrTierID., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling PickSSImportedListRecipientFromMembershipTierImportExcludeKeyofSSImportedListRecipientFromMembershipTierImportEmployeeIDOrTierID., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling PickSSImportedListRecipientFromMembershipTierImportExcludeKeyofSSImportedListRecipientFromMembershipTierImportEmployeeIDOrTierID., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -295,7 +386,7 @@ public function setPhoneNumberId($phone_number_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -307,6 +398,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -320,7 +412,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -336,7 +428,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -348,6 +440,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId.php b/lib/Model/PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId.php index 1631a81..2b426b1 100644 --- a/lib/Model/PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId.php +++ b/lib/Model/PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId.php @@ -2,7 +2,7 @@ /** * PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -81,6 +79,25 @@ class PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId imp 'phone_number_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false, + 'is_active' => false, + 'list_name' => false, + 'phone_number_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -101,6 +118,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -195,10 +264,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['list_name'] = $data['list_name'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('list_name', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -280,14 +367,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -314,6 +404,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -338,6 +431,9 @@ public function getListName() */ public function setListName($list_name) { + if (is_null($list_name)) { + throw new \InvalidArgumentException('non-nullable list_name cannot be null'); + } $this->container['list_name'] = $list_name; return $this; @@ -362,14 +458,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling PickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -383,7 +482,7 @@ public function setPhoneNumberId($phone_number_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -395,6 +494,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -408,7 +508,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -424,7 +524,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -436,6 +536,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId.php b/lib/Model/PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId.php index b0381f4..da8a572 100644 --- a/lib/Model/PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId.php +++ b/lib/Model/PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId.php @@ -2,7 +2,7 @@ /** * PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -97,6 +95,33 @@ class PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId imp 'watson_password' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message_footer' => false, + 'help_response' => false, + 'stop_response' => false, + 'company_name' => false, + 'privacy_policy_url' => false, + 'terms_of_service_url' => false, + 'help_desk_keyword' => false, + 'help_desk_queue_response' => false, + 'is_connected_to_watson' => false, + 'watson_conversation_workplace_id' => false, + 'watson_username' => false, + 'watson_password' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -117,6 +142,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -235,18 +312,36 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['message_footer'] = $data['message_footer'] ?? null; - $this->container['help_response'] = $data['help_response'] ?? null; - $this->container['stop_response'] = $data['stop_response'] ?? null; - $this->container['company_name'] = $data['company_name'] ?? null; - $this->container['privacy_policy_url'] = $data['privacy_policy_url'] ?? null; - $this->container['terms_of_service_url'] = $data['terms_of_service_url'] ?? null; - $this->container['help_desk_keyword'] = $data['help_desk_keyword'] ?? null; - $this->container['help_desk_queue_response'] = $data['help_desk_queue_response'] ?? null; - $this->container['is_connected_to_watson'] = $data['is_connected_to_watson'] ?? null; - $this->container['watson_conversation_workplace_id'] = $data['watson_conversation_workplace_id'] ?? null; - $this->container['watson_username'] = $data['watson_username'] ?? null; - $this->container['watson_password'] = $data['watson_password'] ?? null; + $this->setIfExists('message_footer', $data ?? [], null); + $this->setIfExists('help_response', $data ?? [], null); + $this->setIfExists('stop_response', $data ?? [], null); + $this->setIfExists('company_name', $data ?? [], null); + $this->setIfExists('privacy_policy_url', $data ?? [], null); + $this->setIfExists('terms_of_service_url', $data ?? [], null); + $this->setIfExists('help_desk_keyword', $data ?? [], null); + $this->setIfExists('help_desk_queue_response', $data ?? [], null); + $this->setIfExists('is_connected_to_watson', $data ?? [], null); + $this->setIfExists('watson_conversation_workplace_id', $data ?? [], null); + $this->setIfExists('watson_username', $data ?? [], null); + $this->setIfExists('watson_password', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -336,6 +431,9 @@ public function getMessageFooter() */ public function setMessageFooter($message_footer) { + if (is_null($message_footer)) { + throw new \InvalidArgumentException('non-nullable message_footer cannot be null'); + } if ((mb_strlen($message_footer) < 1)) { throw new \InvalidArgumentException('invalid length for $message_footer when calling PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId., must be bigger than or equal to 1.'); @@ -365,6 +463,9 @@ public function getHelpResponse() */ public function setHelpResponse($help_response) { + if (is_null($help_response)) { + throw new \InvalidArgumentException('non-nullable help_response cannot be null'); + } $this->container['help_response'] = $help_response; return $this; @@ -389,6 +490,9 @@ public function getStopResponse() */ public function setStopResponse($stop_response) { + if (is_null($stop_response)) { + throw new \InvalidArgumentException('non-nullable stop_response cannot be null'); + } $this->container['stop_response'] = $stop_response; return $this; @@ -413,6 +517,9 @@ public function getCompanyName() */ public function setCompanyName($company_name) { + if (is_null($company_name)) { + throw new \InvalidArgumentException('non-nullable company_name cannot be null'); + } if ((mb_strlen($company_name) < 1)) { throw new \InvalidArgumentException('invalid length for $company_name when calling PickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId., must be bigger than or equal to 1.'); @@ -442,6 +549,9 @@ public function getPrivacyPolicyUrl() */ public function setPrivacyPolicyUrl($privacy_policy_url) { + if (is_null($privacy_policy_url)) { + throw new \InvalidArgumentException('non-nullable privacy_policy_url cannot be null'); + } $this->container['privacy_policy_url'] = $privacy_policy_url; return $this; @@ -466,6 +576,9 @@ public function getTermsOfServiceUrl() */ public function setTermsOfServiceUrl($terms_of_service_url) { + if (is_null($terms_of_service_url)) { + throw new \InvalidArgumentException('non-nullable terms_of_service_url cannot be null'); + } $this->container['terms_of_service_url'] = $terms_of_service_url; return $this; @@ -490,6 +603,9 @@ public function getHelpDeskKeyword() */ public function setHelpDeskKeyword($help_desk_keyword) { + if (is_null($help_desk_keyword)) { + throw new \InvalidArgumentException('non-nullable help_desk_keyword cannot be null'); + } $this->container['help_desk_keyword'] = $help_desk_keyword; return $this; @@ -514,6 +630,9 @@ public function getHelpDeskQueueResponse() */ public function setHelpDeskQueueResponse($help_desk_queue_response) { + if (is_null($help_desk_queue_response)) { + throw new \InvalidArgumentException('non-nullable help_desk_queue_response cannot be null'); + } $this->container['help_desk_queue_response'] = $help_desk_queue_response; return $this; @@ -538,6 +657,9 @@ public function getIsConnectedToWatson() */ public function setIsConnectedToWatson($is_connected_to_watson) { + if (is_null($is_connected_to_watson)) { + throw new \InvalidArgumentException('non-nullable is_connected_to_watson cannot be null'); + } $this->container['is_connected_to_watson'] = $is_connected_to_watson; return $this; @@ -562,6 +684,9 @@ public function getWatsonConversationWorkplaceId() */ public function setWatsonConversationWorkplaceId($watson_conversation_workplace_id) { + if (is_null($watson_conversation_workplace_id)) { + throw new \InvalidArgumentException('non-nullable watson_conversation_workplace_id cannot be null'); + } $this->container['watson_conversation_workplace_id'] = $watson_conversation_workplace_id; return $this; @@ -586,6 +711,9 @@ public function getWatsonUsername() */ public function setWatsonUsername($watson_username) { + if (is_null($watson_username)) { + throw new \InvalidArgumentException('non-nullable watson_username cannot be null'); + } $this->container['watson_username'] = $watson_username; return $this; @@ -610,6 +738,9 @@ public function getWatsonPassword() */ public function setWatsonPassword($watson_password) { + if (is_null($watson_password)) { + throw new \InvalidArgumentException('non-nullable watson_password cannot be null'); + } $this->container['watson_password'] = $watson_password; return $this; @@ -621,7 +752,7 @@ public function setWatsonPassword($watson_password) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -633,6 +764,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -646,7 +778,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -662,7 +794,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -674,6 +806,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs.php b/lib/Model/PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs.php index 4971c62..037e871 100644 --- a/lib/Model/PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs.php +++ b/lib/Model/PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs.php @@ -2,7 +2,7 @@ /** * PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -95,6 +93,32 @@ class PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOr 'is_over21_required' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'is_active' => false, + 'list_name' => false, + 'phone_number_id' => false, + 'estimated_messages_per_month' => false, + 'opt_in_keyword' => false, + 'opt_out_keyword' => false, + 'opt_in_confirmed_response' => false, + 'opt_out_confirmed_response' => false, + 'opt_in_confirmed_customer_receives' => false, + 'opt_out_confirmed_customer_receives' => false, + 'is_over21_required' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -115,6 +139,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -230,17 +306,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['list_name'] = $data['list_name'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['estimated_messages_per_month'] = $data['estimated_messages_per_month'] ?? null; - $this->container['opt_in_keyword'] = $data['opt_in_keyword'] ?? null; - $this->container['opt_out_keyword'] = $data['opt_out_keyword'] ?? null; - $this->container['opt_in_confirmed_response'] = $data['opt_in_confirmed_response'] ?? null; - $this->container['opt_out_confirmed_response'] = $data['opt_out_confirmed_response'] ?? null; - $this->container['opt_in_confirmed_customer_receives'] = $data['opt_in_confirmed_customer_receives'] ?? null; - $this->container['opt_out_confirmed_customer_receives'] = $data['opt_out_confirmed_customer_receives'] ?? null; - $this->container['is_over21_required'] = $data['is_over21_required'] ?? null; + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('list_name', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('estimated_messages_per_month', $data ?? [], null); + $this->setIfExists('opt_in_keyword', $data ?? [], null); + $this->setIfExists('opt_out_keyword', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_response', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_response', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_customer_receives', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_customer_receives', $data ?? [], null); + $this->setIfExists('is_over21_required', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -355,6 +449,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -379,6 +476,9 @@ public function getListName() */ public function setListName($list_name) { + if (is_null($list_name)) { + throw new \InvalidArgumentException('non-nullable list_name cannot be null'); + } if ((mb_strlen($list_name) < 1)) { throw new \InvalidArgumentException('invalid length for $list_name when calling PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs., must be bigger than or equal to 1.'); @@ -408,14 +508,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -442,6 +545,9 @@ public function getEstimatedMessagesPerMonth() */ public function setEstimatedMessagesPerMonth($estimated_messages_per_month) { + if (is_null($estimated_messages_per_month)) { + throw new \InvalidArgumentException('non-nullable estimated_messages_per_month cannot be null'); + } if (($estimated_messages_per_month < 0)) { throw new \InvalidArgumentException('invalid value for $estimated_messages_per_month when calling PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs., must be bigger than or equal to 0.'); @@ -471,6 +577,9 @@ public function getOptInKeyword() */ public function setOptInKeyword($opt_in_keyword) { + if (is_null($opt_in_keyword)) { + throw new \InvalidArgumentException('non-nullable opt_in_keyword cannot be null'); + } if ((mb_strlen($opt_in_keyword) > 30)) { throw new \InvalidArgumentException('invalid length for $opt_in_keyword when calling PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs., must be smaller than or equal to 30.'); } @@ -502,6 +611,9 @@ public function getOptOutKeyword() */ public function setOptOutKeyword($opt_out_keyword) { + if (is_null($opt_out_keyword)) { + throw new \InvalidArgumentException('non-nullable opt_out_keyword cannot be null'); + } if ((mb_strlen($opt_out_keyword) > 34)) { throw new \InvalidArgumentException('invalid length for $opt_out_keyword when calling PickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeIDOrOptInConfirmedMediaURLsOrOptOutConfirmedMediaURLs., must be smaller than or equal to 34.'); } @@ -533,6 +645,9 @@ public function getOptInConfirmedResponse() */ public function setOptInConfirmedResponse($opt_in_confirmed_response) { + if (is_null($opt_in_confirmed_response)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_response cannot be null'); + } $this->container['opt_in_confirmed_response'] = $opt_in_confirmed_response; return $this; @@ -557,6 +672,9 @@ public function getOptOutConfirmedResponse() */ public function setOptOutConfirmedResponse($opt_out_confirmed_response) { + if (is_null($opt_out_confirmed_response)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_response cannot be null'); + } $this->container['opt_out_confirmed_response'] = $opt_out_confirmed_response; return $this; @@ -581,6 +699,9 @@ public function getOptInConfirmedCustomerReceives() */ public function setOptInConfirmedCustomerReceives($opt_in_confirmed_customer_receives) { + if (is_null($opt_in_confirmed_customer_receives)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_customer_receives cannot be null'); + } $this->container['opt_in_confirmed_customer_receives'] = $opt_in_confirmed_customer_receives; return $this; @@ -605,6 +726,9 @@ public function getOptOutConfirmedCustomerReceives() */ public function setOptOutConfirmedCustomerReceives($opt_out_confirmed_customer_receives) { + if (is_null($opt_out_confirmed_customer_receives)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_customer_receives cannot be null'); + } $this->container['opt_out_confirmed_customer_receives'] = $opt_out_confirmed_customer_receives; return $this; @@ -629,6 +753,9 @@ public function getIsOver21Required() */ public function setIsOver21Required($is_over21_required) { + if (is_null($is_over21_required)) { + throw new \InvalidArgumentException('non-nullable is_over21_required cannot be null'); + } $this->container['is_over21_required'] = $is_over21_required; return $this; @@ -640,7 +767,7 @@ public function setIsOver21Required($is_over21_required) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -652,6 +779,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -665,7 +793,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -681,7 +809,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -693,6 +821,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount.php b/lib/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount.php index 234cf5d..0ce6f4a 100644 --- a/lib/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount.php +++ b/lib/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount.php @@ -2,7 +2,7 @@ /** * PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParams 'caller_name' => 'string', 'caller_type' => 'string', 'opt_in_list_id' => 'string', - 'opt_in_source_id' => 'string', + 'opt_in_source_id' => '\OpenAPI\Client\Model\PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID', 'is_subscribed' => 'bool', 'is_pending_age21_verification' => 'bool', 'mobile_phone_number' => 'string', @@ -89,6 +87,29 @@ class PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParams 'referring_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'caller_name' => false, + 'caller_type' => false, + 'opt_in_list_id' => false, + 'opt_in_source_id' => false, + 'is_subscribed' => false, + 'is_pending_age21_verification' => false, + 'mobile_phone_number' => false, + 'referring_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -109,6 +130,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -215,14 +288,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['caller_name'] = $data['caller_name'] ?? null; - $this->container['caller_type'] = $data['caller_type'] ?? null; - $this->container['opt_in_list_id'] = $data['opt_in_list_id'] ?? null; - $this->container['opt_in_source_id'] = $data['opt_in_source_id'] ?? null; - $this->container['is_subscribed'] = $data['is_subscribed'] ?? null; - $this->container['is_pending_age21_verification'] = $data['is_pending_age21_verification'] ?? null; - $this->container['mobile_phone_number'] = $data['mobile_phone_number'] ?? null; - $this->container['referring_url'] = $data['referring_url'] ?? null; + $this->setIfExists('caller_name', $data ?? [], null); + $this->setIfExists('caller_type', $data ?? [], null); + $this->setIfExists('opt_in_list_id', $data ?? [], null); + $this->setIfExists('opt_in_source_id', $data ?? [], null); + $this->setIfExists('is_subscribed', $data ?? [], null); + $this->setIfExists('is_pending_age21_verification', $data ?? [], null); + $this->setIfExists('mobile_phone_number', $data ?? [], null); + $this->setIfExists('referring_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -302,6 +393,9 @@ public function getCallerName() */ public function setCallerName($caller_name) { + if (is_null($caller_name)) { + throw new \InvalidArgumentException('non-nullable caller_name cannot be null'); + } $this->container['caller_name'] = $caller_name; return $this; @@ -326,6 +420,9 @@ public function getCallerType() */ public function setCallerType($caller_type) { + if (is_null($caller_type)) { + throw new \InvalidArgumentException('non-nullable caller_type cannot be null'); + } $this->container['caller_type'] = $caller_type; return $this; @@ -350,14 +447,17 @@ public function getOptInListId() */ public function setOptInListId($opt_in_list_id) { + if (is_null($opt_in_list_id)) { + throw new \InvalidArgumentException('non-nullable opt_in_list_id cannot be null'); + } if ((mb_strlen($opt_in_list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $opt_in_list_id when calling PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount., must be smaller than or equal to 10.'); } if ((mb_strlen($opt_in_list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $opt_in_list_id when calling PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $opt_in_list_id))) { - throw new \InvalidArgumentException("invalid value for $opt_in_list_id when calling PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($opt_in_list_id)))) { + throw new \InvalidArgumentException("invalid value for \$opt_in_list_id when calling PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['opt_in_list_id'] = $opt_in_list_id; @@ -368,7 +468,7 @@ public function setOptInListId($opt_in_list_id) /** * Gets opt_in_source_id * - * @return string + * @return \OpenAPI\Client\Model\PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID */ public function getOptInSourceId() { @@ -378,12 +478,15 @@ public function getOptInSourceId() /** * Sets opt_in_source_id * - * @param string $opt_in_source_id opt_in_source_id + * @param \OpenAPI\Client\Model\PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID $opt_in_source_id opt_in_source_id * * @return self */ public function setOptInSourceId($opt_in_source_id) { + if (is_null($opt_in_source_id)) { + throw new \InvalidArgumentException('non-nullable opt_in_source_id cannot be null'); + } $this->container['opt_in_source_id'] = $opt_in_source_id; return $this; @@ -408,6 +511,9 @@ public function getIsSubscribed() */ public function setIsSubscribed($is_subscribed) { + if (is_null($is_subscribed)) { + throw new \InvalidArgumentException('non-nullable is_subscribed cannot be null'); + } $this->container['is_subscribed'] = $is_subscribed; return $this; @@ -432,6 +538,9 @@ public function getIsPendingAge21Verification() */ public function setIsPendingAge21Verification($is_pending_age21_verification) { + if (is_null($is_pending_age21_verification)) { + throw new \InvalidArgumentException('non-nullable is_pending_age21_verification cannot be null'); + } $this->container['is_pending_age21_verification'] = $is_pending_age21_verification; return $this; @@ -456,6 +565,9 @@ public function getMobilePhoneNumber() */ public function setMobilePhoneNumber($mobile_phone_number) { + if (is_null($mobile_phone_number)) { + throw new \InvalidArgumentException('non-nullable mobile_phone_number cannot be null'); + } $this->container['mobile_phone_number'] = $mobile_phone_number; return $this; @@ -480,6 +592,9 @@ public function getReferringUrl() */ public function setReferringUrl($referring_url) { + if (is_null($referring_url)) { + throw new \InvalidArgumentException('non-nullable referring_url cannot be null'); + } if ((mb_strlen($referring_url) < 0)) { throw new \InvalidArgumentException('invalid length for $referring_url when calling PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCount., must be bigger than or equal to 0.'); @@ -496,7 +611,7 @@ public function setReferringUrl($referring_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -508,6 +623,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -521,7 +637,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -537,7 +653,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -549,6 +665,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID.php b/lib/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID.php new file mode 100644 index 0000000..349c034 --- /dev/null +++ b/lib/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID.php @@ -0,0 +1,382 @@ + + */ +class PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceID implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pick_SSOptInListMemberUpdateParams_Exclude_keyofSSOptInListMemberUpdateParams_merchantCreatedAt_or_maxSMSCount___optInSourceID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId.php b/lib/Model/PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId.php index 8c07e8f..b7863ad 100644 --- a/lib/Model/PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId.php +++ b/lib/Model/PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId.php @@ -2,7 +2,7 @@ /** * PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -101,6 +99,35 @@ class PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId implement 'is_over21_required' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false, + 'is_active' => false, + 'list_name' => false, + 'phone_number_id' => false, + 'estimated_messages_per_month' => false, + 'opt_in_keyword' => false, + 'opt_out_keyword' => false, + 'opt_in_confirmed_response' => false, + 'opt_out_confirmed_response' => false, + 'opt_in_confirmed_customer_receives' => false, + 'opt_out_confirmed_customer_receives' => false, + 'opt_in_confirmed_media_urls' => false, + 'opt_out_confirmed_media_urls' => false, + 'is_over21_required' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -121,6 +148,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -245,20 +324,38 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['list_name'] = $data['list_name'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['estimated_messages_per_month'] = $data['estimated_messages_per_month'] ?? null; - $this->container['opt_in_keyword'] = $data['opt_in_keyword'] ?? null; - $this->container['opt_out_keyword'] = $data['opt_out_keyword'] ?? null; - $this->container['opt_in_confirmed_response'] = $data['opt_in_confirmed_response'] ?? null; - $this->container['opt_out_confirmed_response'] = $data['opt_out_confirmed_response'] ?? null; - $this->container['opt_in_confirmed_customer_receives'] = $data['opt_in_confirmed_customer_receives'] ?? null; - $this->container['opt_out_confirmed_customer_receives'] = $data['opt_out_confirmed_customer_receives'] ?? null; - $this->container['opt_in_confirmed_media_urls'] = $data['opt_in_confirmed_media_urls'] ?? null; - $this->container['opt_out_confirmed_media_urls'] = $data['opt_out_confirmed_media_urls'] ?? null; - $this->container['is_over21_required'] = $data['is_over21_required'] ?? null; + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('list_name', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('estimated_messages_per_month', $data ?? [], null); + $this->setIfExists('opt_in_keyword', $data ?? [], null); + $this->setIfExists('opt_out_keyword', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_response', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_response', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_customer_receives', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_customer_receives', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_media_urls', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_media_urls', $data ?? [], null); + $this->setIfExists('is_over21_required', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -394,14 +491,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -428,6 +528,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -452,6 +555,9 @@ public function getListName() */ public function setListName($list_name) { + if (is_null($list_name)) { + throw new \InvalidArgumentException('non-nullable list_name cannot be null'); + } if ((mb_strlen($list_name) < 1)) { throw new \InvalidArgumentException('invalid length for $list_name when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must be bigger than or equal to 1.'); @@ -481,14 +587,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -515,6 +624,9 @@ public function getEstimatedMessagesPerMonth() */ public function setEstimatedMessagesPerMonth($estimated_messages_per_month) { + if (is_null($estimated_messages_per_month)) { + throw new \InvalidArgumentException('non-nullable estimated_messages_per_month cannot be null'); + } if (($estimated_messages_per_month < 0)) { throw new \InvalidArgumentException('invalid value for $estimated_messages_per_month when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must be bigger than or equal to 0.'); @@ -544,6 +656,9 @@ public function getOptInKeyword() */ public function setOptInKeyword($opt_in_keyword) { + if (is_null($opt_in_keyword)) { + throw new \InvalidArgumentException('non-nullable opt_in_keyword cannot be null'); + } if ((mb_strlen($opt_in_keyword) > 30)) { throw new \InvalidArgumentException('invalid length for $opt_in_keyword when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must be smaller than or equal to 30.'); } @@ -575,6 +690,9 @@ public function getOptOutKeyword() */ public function setOptOutKeyword($opt_out_keyword) { + if (is_null($opt_out_keyword)) { + throw new \InvalidArgumentException('non-nullable opt_out_keyword cannot be null'); + } if ((mb_strlen($opt_out_keyword) > 34)) { throw new \InvalidArgumentException('invalid length for $opt_out_keyword when calling PickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId., must be smaller than or equal to 34.'); } @@ -606,6 +724,9 @@ public function getOptInConfirmedResponse() */ public function setOptInConfirmedResponse($opt_in_confirmed_response) { + if (is_null($opt_in_confirmed_response)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_response cannot be null'); + } $this->container['opt_in_confirmed_response'] = $opt_in_confirmed_response; return $this; @@ -630,6 +751,9 @@ public function getOptOutConfirmedResponse() */ public function setOptOutConfirmedResponse($opt_out_confirmed_response) { + if (is_null($opt_out_confirmed_response)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_response cannot be null'); + } $this->container['opt_out_confirmed_response'] = $opt_out_confirmed_response; return $this; @@ -654,6 +778,9 @@ public function getOptInConfirmedCustomerReceives() */ public function setOptInConfirmedCustomerReceives($opt_in_confirmed_customer_receives) { + if (is_null($opt_in_confirmed_customer_receives)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_customer_receives cannot be null'); + } $this->container['opt_in_confirmed_customer_receives'] = $opt_in_confirmed_customer_receives; return $this; @@ -678,6 +805,9 @@ public function getOptOutConfirmedCustomerReceives() */ public function setOptOutConfirmedCustomerReceives($opt_out_confirmed_customer_receives) { + if (is_null($opt_out_confirmed_customer_receives)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_customer_receives cannot be null'); + } $this->container['opt_out_confirmed_customer_receives'] = $opt_out_confirmed_customer_receives; return $this; @@ -702,6 +832,9 @@ public function getOptInConfirmedMediaUrls() */ public function setOptInConfirmedMediaUrls($opt_in_confirmed_media_urls) { + if (is_null($opt_in_confirmed_media_urls)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_media_urls cannot be null'); + } $this->container['opt_in_confirmed_media_urls'] = $opt_in_confirmed_media_urls; return $this; @@ -726,6 +859,9 @@ public function getOptOutConfirmedMediaUrls() */ public function setOptOutConfirmedMediaUrls($opt_out_confirmed_media_urls) { + if (is_null($opt_out_confirmed_media_urls)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_media_urls cannot be null'); + } $this->container['opt_out_confirmed_media_urls'] = $opt_out_confirmed_media_urls; return $this; @@ -750,6 +886,9 @@ public function getIsOver21Required() */ public function setIsOver21Required($is_over21_required) { + if (is_null($is_over21_required)) { + throw new \InvalidArgumentException('non-nullable is_over21_required cannot be null'); + } $this->container['is_over21_required'] = $is_over21_required; return $this; @@ -761,7 +900,7 @@ public function setIsOver21Required($is_over21_required) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -773,6 +912,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -786,7 +926,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -802,7 +942,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -814,6 +954,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId.php b/lib/Model/PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId.php index 6655dc8..a377106 100644 --- a/lib/Model/PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId.php +++ b/lib/Model/PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId.php @@ -2,7 +2,7 @@ /** * PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -79,6 +77,24 @@ class PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId imple 'source_name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false, + 'list_id' => false, + 'source_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -99,6 +115,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -190,9 +258,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['list_id'] = $data['list_id'] ?? null; - $this->container['source_name'] = $data['source_name'] ?? null; + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('source_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -271,14 +357,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -305,14 +394,17 @@ public function getListId() */ public function setListId($list_id) { + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + } if ((mb_strlen($list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId., must be smaller than or equal to 10.'); } if ((mb_strlen($list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $list_id))) { - throw new \InvalidArgumentException("invalid value for $list_id when calling PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($list_id)))) { + throw new \InvalidArgumentException("invalid value for \$list_id when calling PickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['list_id'] = $list_id; @@ -339,6 +431,9 @@ public function getSourceName() */ public function setSourceName($source_name) { + if (is_null($source_name)) { + throw new \InvalidArgumentException('non-nullable source_name cannot be null'); + } $this->container['source_name'] = $source_name; return $this; @@ -350,7 +445,7 @@ public function setSourceName($source_name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -362,6 +457,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -375,7 +471,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -391,7 +487,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -403,6 +499,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.php b/lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.php index bd0b92c..9df59bc 100644 --- a/lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.php +++ b/lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.php @@ -2,7 +2,7 @@ /** * PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone implem protected static $openAPITypes = [ 'id' => 'string', 'employee_id' => 'string', - 'status' => 'string', + 'status' => '\OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -71,7 +69,7 @@ class PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone implem 'body' => 'string', 'phone_number_id' => 'string', 'media_urls' => 'string[]', - 'payment_object_broadcast_id' => 'string', + 'payment_object_broadcast_id' => '\OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID', 'body_template' => 'string', 'status_callback' => 'string', 'is_sent' => 'bool', @@ -115,6 +113,42 @@ class PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone implem 'error_message' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'employee_id' => false, + 'status' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'body' => false, + 'phone_number_id' => false, + 'media_urls' => false, + 'payment_object_broadcast_id' => false, + 'body_template' => false, + 'status_callback' => false, + 'is_sent' => false, + 'sent_at' => false, + 'delivered_at' => false, + 'message_sid' => false, + 'num_segments' => false, + 'num_media' => false, + 'error_code' => true, + 'error_message' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -135,6 +169,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -280,27 +366,45 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['body'] = $data['body'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; - $this->container['payment_object_broadcast_id'] = $data['payment_object_broadcast_id'] ?? null; - $this->container['body_template'] = $data['body_template'] ?? null; - $this->container['status_callback'] = $data['status_callback'] ?? null; - $this->container['is_sent'] = $data['is_sent'] ?? null; - $this->container['sent_at'] = $data['sent_at'] ?? null; - $this->container['delivered_at'] = $data['delivered_at'] ?? null; - $this->container['message_sid'] = $data['message_sid'] ?? null; - $this->container['num_segments'] = $data['num_segments'] ?? null; - $this->container['num_media'] = $data['num_media'] ?? null; - $this->container['error_code'] = $data['error_code'] ?? null; - $this->container['error_message'] = $data['error_message'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + $this->setIfExists('payment_object_broadcast_id', $data ?? [], null); + $this->setIfExists('body_template', $data ?? [], null); + $this->setIfExists('status_callback', $data ?? [], null); + $this->setIfExists('is_sent', $data ?? [], null); + $this->setIfExists('sent_at', $data ?? [], null); + $this->setIfExists('delivered_at', $data ?? [], null); + $this->setIfExists('message_sid', $data ?? [], null); + $this->setIfExists('num_segments', $data ?? [], null); + $this->setIfExists('num_media', $data ?? [], null); + $this->setIfExists('error_code', $data ?? [], null); + $this->setIfExists('error_message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -386,10 +490,6 @@ public function listInvalidProperties() if ($this->container['media_urls'] === null) { $invalidProperties[] = "'media_urls' can't be null"; } - if (!is_null($this->container['payment_object_broadcast_id']) && (mb_strlen($this->container['payment_object_broadcast_id']) > 10)) { - $invalidProperties[] = "invalid value for 'payment_object_broadcast_id', the character length must be smaller than or equal to 10."; - } - if ($this->container['body_template'] === null) { $invalidProperties[] = "'body_template' can't be null"; } @@ -448,6 +548,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must be smaller than or equal to 10.'); } @@ -479,14 +582,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -497,7 +603,7 @@ public function setEmployeeId($employee_id) /** * Gets status * - * @return string + * @return \OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus */ public function getStatus() { @@ -507,12 +613,15 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param \OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus $status status * * @return self */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -537,14 +646,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -571,6 +683,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -595,6 +710,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -619,6 +737,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -643,6 +764,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } $this->container['body'] = $body; return $this; @@ -667,14 +791,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -701,6 +828,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -709,7 +839,7 @@ public function setMediaUrls($media_urls) /** * Gets payment_object_broadcast_id * - * @return string|null + * @return \OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID|null */ public function getPaymentObjectBroadcastId() { @@ -719,16 +849,15 @@ public function getPaymentObjectBroadcastId() /** * Sets payment_object_broadcast_id * - * @param string|null $payment_object_broadcast_id payment_object_broadcast_id + * @param \OpenAPI\Client\Model\PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID|null $payment_object_broadcast_id payment_object_broadcast_id * * @return self */ public function setPaymentObjectBroadcastId($payment_object_broadcast_id) { - if (!is_null($payment_object_broadcast_id) && (mb_strlen($payment_object_broadcast_id) > 10)) { - throw new \InvalidArgumentException('invalid length for $payment_object_broadcast_id when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must be smaller than or equal to 10.'); + if (is_null($payment_object_broadcast_id)) { + throw new \InvalidArgumentException('non-nullable payment_object_broadcast_id cannot be null'); } - $this->container['payment_object_broadcast_id'] = $payment_object_broadcast_id; return $this; @@ -753,6 +882,9 @@ public function getBodyTemplate() */ public function setBodyTemplate($body_template) { + if (is_null($body_template)) { + throw new \InvalidArgumentException('non-nullable body_template cannot be null'); + } $this->container['body_template'] = $body_template; return $this; @@ -777,6 +909,9 @@ public function getStatusCallback() */ public function setStatusCallback($status_callback) { + if (is_null($status_callback)) { + throw new \InvalidArgumentException('non-nullable status_callback cannot be null'); + } if ((mb_strlen($status_callback) < 1)) { throw new \InvalidArgumentException('invalid length for $status_callback when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must be bigger than or equal to 1.'); @@ -806,6 +941,9 @@ public function getIsSent() */ public function setIsSent($is_sent) { + if (is_null($is_sent)) { + throw new \InvalidArgumentException('non-nullable is_sent cannot be null'); + } $this->container['is_sent'] = $is_sent; return $this; @@ -830,6 +968,9 @@ public function getSentAt() */ public function setSentAt($sent_at) { + if (is_null($sent_at)) { + throw new \InvalidArgumentException('non-nullable sent_at cannot be null'); + } $this->container['sent_at'] = $sent_at; return $this; @@ -854,6 +995,9 @@ public function getDeliveredAt() */ public function setDeliveredAt($delivered_at) { + if (is_null($delivered_at)) { + throw new \InvalidArgumentException('non-nullable delivered_at cannot be null'); + } $this->container['delivered_at'] = $delivered_at; return $this; @@ -878,6 +1022,9 @@ public function getMessageSid() */ public function setMessageSid($message_sid) { + if (is_null($message_sid)) { + throw new \InvalidArgumentException('non-nullable message_sid cannot be null'); + } $this->container['message_sid'] = $message_sid; return $this; @@ -902,8 +1049,11 @@ public function getNumSegments() */ public function setNumSegments($num_segments) { + if (is_null($num_segments)) { + throw new \InvalidArgumentException('non-nullable num_segments cannot be null'); + } - if (!is_null($num_segments) && ($num_segments < 0)) { + if (($num_segments < 0)) { throw new \InvalidArgumentException('invalid value for $num_segments when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must be bigger than or equal to 0.'); } @@ -931,8 +1081,11 @@ public function getNumMedia() */ public function setNumMedia($num_media) { + if (is_null($num_media)) { + throw new \InvalidArgumentException('non-nullable num_media cannot be null'); + } - if (!is_null($num_media) && ($num_media < 0)) { + if (($num_media < 0)) { throw new \InvalidArgumentException('invalid value for $num_media when calling PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone., must be bigger than or equal to 0.'); } @@ -960,6 +1113,16 @@ public function getErrorCode() */ public function setErrorCode($error_code) { + if (is_null($error_code)) { + array_push($this->openAPINullablesSetToNull, 'error_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('error_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['error_code'] = $error_code; return $this; @@ -984,6 +1147,16 @@ public function getErrorMessage() */ public function setErrorMessage($error_message) { + if (is_null($error_message)) { + array_push($this->openAPINullablesSetToNull, 'error_message'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('error_message', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['error_message'] = $error_message; return $this; @@ -995,7 +1168,7 @@ public function setErrorMessage($error_message) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1007,6 +1180,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1020,7 +1194,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1036,7 +1210,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1048,6 +1222,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID.php b/lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID.php new file mode 100644 index 0000000..405b83e --- /dev/null +++ b/lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID.php @@ -0,0 +1,382 @@ + + */ +class PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastID implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pick_SSOutboundMessageLog_Exclude_keyofSSOutboundMessageLog_toCellPhone___paymentObjectBroadcastID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus.php b/lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus.php new file mode 100644 index 0000000..cd7147c --- /dev/null +++ b/lib/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus.php @@ -0,0 +1,382 @@ + + */ +class PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatus implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pick_SSOutboundMessageLog_Exclude_keyofSSOutboundMessageLog_toCellPhone___status'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID.php b/lib/Model/PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID.php index c64bce7..e95856b 100644 --- a/lib/Model/PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID.php +++ b/lib/Model/PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID.php @@ -2,7 +2,7 @@ /** * PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCrea */ protected static $openAPITypes = [ 'title' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'payment_design_id' => 'string', 'max_uses' => 'int', 'discount_value' => 'int' @@ -83,6 +81,26 @@ class PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCrea 'discount_value' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'value_type' => false, + 'payment_design_id' => false, + 'max_uses' => false, + 'discount_value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -103,6 +121,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -200,11 +270,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['max_uses'] = $data['max_uses'] ?? null; - $this->container['discount_value'] = $data['discount_value'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('max_uses', $data ?? [], null); + $this->setIfExists('discount_value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -289,6 +377,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID., must be bigger than or equal to 1.'); @@ -302,7 +393,7 @@ public function setTitle($title) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -312,12 +403,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -342,14 +436,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -376,6 +473,9 @@ public function getMaxUses() */ public function setMaxUses($max_uses) { + if (is_null($max_uses)) { + throw new \InvalidArgumentException('non-nullable max_uses cannot be null'); + } if (($max_uses < 0)) { throw new \InvalidArgumentException('invalid value for $max_uses when calling PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID., must be bigger than or equal to 0.'); @@ -405,6 +505,9 @@ public function getDiscountValue() */ public function setDiscountValue($discount_value) { + if (is_null($discount_value)) { + throw new \InvalidArgumentException('non-nullable discount_value cannot be null'); + } if (($discount_value < 0)) { throw new \InvalidArgumentException('invalid value for $discount_value when calling PickVSAdvertisementCreditCreateParamsExcludeKeyofVSAdvertisementCreditCreateParamsEmployeeID., must be bigger than or equal to 0.'); @@ -421,7 +524,7 @@ public function setDiscountValue($discount_value) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -433,6 +536,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -446,7 +550,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -462,7 +566,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -474,6 +578,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.php b/lib/Model/PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.php index 4624f68..766f26f 100644 --- a/lib/Model/PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.php +++ b/lib/Model/PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.php @@ -2,7 +2,7 @@ /** * PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,8 +60,8 @@ class PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemed */ protected static $openAPITypes = [ 'id' => 'string', - 'transaction_type' => 'string', - 'register_id' => 'string', + 'transaction_type' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType', + 'register_id' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID', 'redeemed_source' => 'string', 'redeemed_transaction_id' => 'string', 'redeemed_amount' => 'int', @@ -107,6 +105,38 @@ class PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemed 'advertisement_credit_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'transaction_type' => false, + 'register_id' => false, + 'redeemed_source' => false, + 'redeemed_transaction_id' => false, + 'redeemed_amount' => false, + 'is_redeemed' => false, + 'refunded_transaction_id' => false, + 'refunded_amount' => false, + 'status' => false, + 'authorized_against_check_number' => false, + 'authorized_amount' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'advertisement_credit_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -127,6 +157,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -260,23 +342,41 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['redeemed_source'] = $data['redeemed_source'] ?? null; - $this->container['redeemed_transaction_id'] = $data['redeemed_transaction_id'] ?? null; - $this->container['redeemed_amount'] = $data['redeemed_amount'] ?? null; - $this->container['is_redeemed'] = $data['is_redeemed'] ?? null; - $this->container['refunded_transaction_id'] = $data['refunded_transaction_id'] ?? null; - $this->container['refunded_amount'] = $data['refunded_amount'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['authorized_against_check_number'] = $data['authorized_against_check_number'] ?? null; - $this->container['authorized_amount'] = $data['authorized_amount'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['advertisement_credit_id'] = $data['advertisement_credit_id'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('redeemed_source', $data ?? [], null); + $this->setIfExists('redeemed_transaction_id', $data ?? [], null); + $this->setIfExists('redeemed_amount', $data ?? [], null); + $this->setIfExists('is_redeemed', $data ?? [], null); + $this->setIfExists('refunded_transaction_id', $data ?? [], null); + $this->setIfExists('refunded_amount', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('authorized_against_check_number', $data ?? [], null); + $this->setIfExists('authorized_amount', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('advertisement_credit_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -417,6 +517,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must be smaller than or equal to 10.'); } @@ -432,7 +535,7 @@ public function setId($id) /** * Gets transaction_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType */ public function getTransactionType() { @@ -442,12 +545,15 @@ public function getTransactionType() /** * Sets transaction_type * - * @param string $transaction_type The type of the transaction - only redemption at the moment + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType $transaction_type transaction_type * * @return self */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -456,7 +562,7 @@ public function setTransactionType($transaction_type) /** * Gets register_id * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID */ public function getRegisterId() { @@ -466,12 +572,15 @@ public function getRegisterId() /** * Sets register_id * - * @param string $register_id The ID of the register where the transaction occurred + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID $register_id register_id * * @return self */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -496,6 +605,9 @@ public function getRedeemedSource() */ public function setRedeemedSource($redeemed_source) { + if (is_null($redeemed_source)) { + throw new \InvalidArgumentException('non-nullable redeemed_source cannot be null'); + } $this->container['redeemed_source'] = $redeemed_source; return $this; @@ -520,6 +632,9 @@ public function getRedeemedTransactionId() */ public function setRedeemedTransactionId($redeemed_transaction_id) { + if (is_null($redeemed_transaction_id)) { + throw new \InvalidArgumentException('non-nullable redeemed_transaction_id cannot be null'); + } $this->container['redeemed_transaction_id'] = $redeemed_transaction_id; return $this; @@ -544,6 +659,9 @@ public function getRedeemedAmount() */ public function setRedeemedAmount($redeemed_amount) { + if (is_null($redeemed_amount)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount cannot be null'); + } if (($redeemed_amount < 0)) { throw new \InvalidArgumentException('invalid value for $redeemed_amount when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must be bigger than or equal to 0.'); @@ -573,6 +691,9 @@ public function getIsRedeemed() */ public function setIsRedeemed($is_redeemed) { + if (is_null($is_redeemed)) { + throw new \InvalidArgumentException('non-nullable is_redeemed cannot be null'); + } $this->container['is_redeemed'] = $is_redeemed; return $this; @@ -597,6 +718,9 @@ public function getRefundedTransactionId() */ public function setRefundedTransactionId($refunded_transaction_id) { + if (is_null($refunded_transaction_id)) { + throw new \InvalidArgumentException('non-nullable refunded_transaction_id cannot be null'); + } $this->container['refunded_transaction_id'] = $refunded_transaction_id; return $this; @@ -621,6 +745,9 @@ public function getRefundedAmount() */ public function setRefundedAmount($refunded_amount) { + if (is_null($refunded_amount)) { + throw new \InvalidArgumentException('non-nullable refunded_amount cannot be null'); + } if (($refunded_amount < 0)) { throw new \InvalidArgumentException('invalid value for $refunded_amount when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must be bigger than or equal to 0.'); @@ -650,6 +777,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -674,6 +804,9 @@ public function getAuthorizedAgainstCheckNumber() */ public function setAuthorizedAgainstCheckNumber($authorized_against_check_number) { + if (is_null($authorized_against_check_number)) { + throw new \InvalidArgumentException('non-nullable authorized_against_check_number cannot be null'); + } $this->container['authorized_against_check_number'] = $authorized_against_check_number; return $this; @@ -698,6 +831,9 @@ public function getAuthorizedAmount() */ public function setAuthorizedAmount($authorized_amount) { + if (is_null($authorized_amount)) { + throw new \InvalidArgumentException('non-nullable authorized_amount cannot be null'); + } if (($authorized_amount < 0)) { throw new \InvalidArgumentException('invalid value for $authorized_amount when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must be bigger than or equal to 0.'); @@ -727,14 +863,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -761,6 +900,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -785,6 +927,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -809,6 +954,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -833,14 +981,17 @@ public function getAdvertisementCreditId() */ public function setAdvertisementCreditId($advertisement_credit_id) { + if (is_null($advertisement_credit_id)) { + throw new \InvalidArgumentException('non-nullable advertisement_credit_id cannot be null'); + } if ((mb_strlen($advertisement_credit_id) > 10)) { throw new \InvalidArgumentException('invalid length for $advertisement_credit_id when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must be smaller than or equal to 10.'); } if ((mb_strlen($advertisement_credit_id) < 10)) { throw new \InvalidArgumentException('invalid length for $advertisement_credit_id when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $advertisement_credit_id))) { - throw new \InvalidArgumentException("invalid value for $advertisement_credit_id when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($advertisement_credit_id)))) { + throw new \InvalidArgumentException("invalid value for \$advertisement_credit_id when calling PickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['advertisement_credit_id'] = $advertisement_credit_id; @@ -854,7 +1005,7 @@ public function setAdvertisementCreditId($advertisement_credit_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -866,6 +1017,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -879,7 +1031,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -895,7 +1047,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -907,6 +1059,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.php b/lib/Model/PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.php index b3e9dd9..6ae8354 100644 --- a/lib/Model/PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.php +++ b/lib/Model/PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.php @@ -2,7 +2,7 @@ /** * PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpda */ protected static $openAPITypes = [ 'title' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'payment_design_id' => 'string', 'max_uses' => 'int', 'discount_value' => 'int' @@ -83,6 +81,26 @@ class PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpda 'discount_value' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'value_type' => false, + 'payment_design_id' => false, + 'max_uses' => false, + 'discount_value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -103,6 +121,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -200,11 +270,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['max_uses'] = $data['max_uses'] ?? null; - $this->container['discount_value'] = $data['discount_value'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('max_uses', $data ?? [], null); + $this->setIfExists('discount_value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -289,6 +377,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId., must be bigger than or equal to 1.'); @@ -302,7 +393,7 @@ public function setTitle($title) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -312,12 +403,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -342,14 +436,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -376,6 +473,9 @@ public function getMaxUses() */ public function setMaxUses($max_uses) { + if (is_null($max_uses)) { + throw new \InvalidArgumentException('non-nullable max_uses cannot be null'); + } if (($max_uses < 0)) { throw new \InvalidArgumentException('invalid value for $max_uses when calling PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId., must be bigger than or equal to 0.'); @@ -405,6 +505,9 @@ public function getDiscountValue() */ public function setDiscountValue($discount_value) { + if (is_null($discount_value)) { + throw new \InvalidArgumentException('non-nullable discount_value cannot be null'); + } if (($discount_value < 0)) { throw new \InvalidArgumentException('invalid value for $discount_value when calling PickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId., must be bigger than or equal to 0.'); @@ -421,7 +524,7 @@ public function setDiscountValue($discount_value) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -433,6 +536,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -446,7 +550,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -462,7 +566,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -474,6 +578,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.php b/lib/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.php index 2854587..30a5cfd 100644 --- a/lib/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.php +++ b/lib/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.php @@ -2,7 +2,7 @@ /** * PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExp 'id' => 'string', 'title' => 'string', 'notes' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'is_loaded' => 'bool', 'display_value' => 'string', 'merchants_reference_id' => 'string', @@ -97,6 +95,33 @@ class PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExp 'number_of_vouchers_in_file' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'title' => false, + 'notes' => false, + 'value_type' => false, + 'is_loaded' => false, + 'display_value' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'employee_id' => false, + 'reinvestment_sum' => false, + 'number_of_vouchers_in_file' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -117,6 +142,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -235,18 +312,36 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['is_loaded'] = $data['is_loaded'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['reinvestment_sum'] = $data['reinvestment_sum'] ?? null; - $this->container['number_of_vouchers_in_file'] = $data['number_of_vouchers_in_file'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('is_loaded', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('reinvestment_sum', $data ?? [], null); + $this->setIfExists('number_of_vouchers_in_file', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -363,6 +458,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must be smaller than or equal to 10.'); } @@ -394,6 +492,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must be bigger than or equal to 1.'); @@ -423,6 +524,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -431,7 +535,7 @@ public function setNotes($notes) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -441,12 +545,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -471,6 +578,9 @@ public function getIsLoaded() */ public function setIsLoaded($is_loaded) { + if (is_null($is_loaded)) { + throw new \InvalidArgumentException('non-nullable is_loaded cannot be null'); + } $this->container['is_loaded'] = $is_loaded; return $this; @@ -495,6 +605,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } $this->container['display_value'] = $display_value; return $this; @@ -519,6 +632,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -543,6 +659,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -567,14 +686,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -601,14 +723,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -635,6 +760,9 @@ public function getReinvestmentSum() */ public function setReinvestmentSum($reinvestment_sum) { + if (is_null($reinvestment_sum)) { + throw new \InvalidArgumentException('non-nullable reinvestment_sum cannot be null'); + } if (($reinvestment_sum < 0)) { throw new \InvalidArgumentException('invalid value for $reinvestment_sum when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must be bigger than or equal to 0.'); @@ -664,6 +792,9 @@ public function getNumberOfVouchersInFile() */ public function setNumberOfVouchersInFile($number_of_vouchers_in_file) { + if (is_null($number_of_vouchers_in_file)) { + throw new \InvalidArgumentException('non-nullable number_of_vouchers_in_file cannot be null'); + } if (($number_of_vouchers_in_file < 0)) { throw new \InvalidArgumentException('invalid value for $number_of_vouchers_in_file when calling PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate., must be bigger than or equal to 0.'); @@ -680,7 +811,7 @@ public function setNumberOfVouchersInFile($number_of_vouchers_in_file) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -692,6 +823,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -705,7 +837,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -721,7 +853,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -733,6 +865,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.php b/lib/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.php new file mode 100644 index 0000000..787bf6d --- /dev/null +++ b/lib/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType.php @@ -0,0 +1,382 @@ + + */ +class PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pick_VSCampaignUpdateParams_Exclude_keyofVSCampaignUpdateParams_startDate_or_expirationDate___valueType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType.php b/lib/Model/PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType.php index 024fda9..cc1534a 100644 --- a/lib/Model/PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType.php +++ b/lib/Model/PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType.php @@ -2,7 +2,7 @@ /** * PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -111,6 +109,40 @@ class PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyT 'numerical_decrease_frequency' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'start_date' => false, + 'expiration_date' => false, + 'id' => false, + 'title' => false, + 'notes' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'employee_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'starting_value' => false, + 'max_budget' => false, + 'temporal_decrease_amount' => false, + 'temporal_decrease_frequency' => false, + 'numerical_decrease_amount' => false, + 'numerical_decrease_frequency' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -131,6 +163,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -270,25 +354,43 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['start_date'] = $data['start_date'] ?? null; - $this->container['expiration_date'] = $data['expiration_date'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['starting_value'] = $data['starting_value'] ?? null; - $this->container['max_budget'] = $data['max_budget'] ?? null; - $this->container['temporal_decrease_amount'] = $data['temporal_decrease_amount'] ?? null; - $this->container['temporal_decrease_frequency'] = $data['temporal_decrease_frequency'] ?? null; - $this->container['numerical_decrease_amount'] = $data['numerical_decrease_amount'] ?? null; - $this->container['numerical_decrease_frequency'] = $data['numerical_decrease_frequency'] ?? null; + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('starting_value', $data ?? [], null); + $this->setIfExists('max_budget', $data ?? [], null); + $this->setIfExists('temporal_decrease_amount', $data ?? [], null); + $this->setIfExists('temporal_decrease_frequency', $data ?? [], null); + $this->setIfExists('numerical_decrease_amount', $data ?? [], null); + $this->setIfExists('numerical_decrease_frequency', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -451,6 +553,9 @@ public function getStartDate() */ public function setStartDate($start_date) { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } $this->container['start_date'] = $start_date; return $this; @@ -475,6 +580,9 @@ public function getExpirationDate() */ public function setExpirationDate($expiration_date) { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } $this->container['expiration_date'] = $expiration_date; return $this; @@ -499,6 +607,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be smaller than or equal to 10.'); } @@ -530,6 +641,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be bigger than or equal to 1.'); @@ -559,6 +673,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -583,6 +700,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -607,6 +727,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -631,14 +754,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -665,14 +791,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -699,14 +828,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -733,6 +865,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -757,6 +892,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -781,6 +919,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -805,6 +946,9 @@ public function getStartingValue() */ public function setStartingValue($starting_value) { + if (is_null($starting_value)) { + throw new \InvalidArgumentException('non-nullable starting_value cannot be null'); + } if (($starting_value < 0)) { throw new \InvalidArgumentException('invalid value for $starting_value when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be bigger than or equal to 0.'); @@ -834,6 +978,9 @@ public function getMaxBudget() */ public function setMaxBudget($max_budget) { + if (is_null($max_budget)) { + throw new \InvalidArgumentException('non-nullable max_budget cannot be null'); + } if (($max_budget < 0)) { throw new \InvalidArgumentException('invalid value for $max_budget when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be bigger than or equal to 0.'); @@ -863,6 +1010,9 @@ public function getTemporalDecreaseAmount() */ public function setTemporalDecreaseAmount($temporal_decrease_amount) { + if (is_null($temporal_decrease_amount)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_amount cannot be null'); + } if (($temporal_decrease_amount < 0)) { throw new \InvalidArgumentException('invalid value for $temporal_decrease_amount when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be bigger than or equal to 0.'); @@ -892,6 +1042,9 @@ public function getTemporalDecreaseFrequency() */ public function setTemporalDecreaseFrequency($temporal_decrease_frequency) { + if (is_null($temporal_decrease_frequency)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_frequency cannot be null'); + } if (($temporal_decrease_frequency < 0)) { throw new \InvalidArgumentException('invalid value for $temporal_decrease_frequency when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be bigger than or equal to 0.'); @@ -921,8 +1074,11 @@ public function getNumericalDecreaseAmount() */ public function setNumericalDecreaseAmount($numerical_decrease_amount) { + if (is_null($numerical_decrease_amount)) { + throw new \InvalidArgumentException('non-nullable numerical_decrease_amount cannot be null'); + } - if (!is_null($numerical_decrease_amount) && ($numerical_decrease_amount < 0)) { + if (($numerical_decrease_amount < 0)) { throw new \InvalidArgumentException('invalid value for $numerical_decrease_amount when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be bigger than or equal to 0.'); } @@ -950,8 +1106,11 @@ public function getNumericalDecreaseFrequency() */ public function setNumericalDecreaseFrequency($numerical_decrease_frequency) { + if (is_null($numerical_decrease_frequency)) { + throw new \InvalidArgumentException('non-nullable numerical_decrease_frequency cannot be null'); + } - if (!is_null($numerical_decrease_frequency) && ($numerical_decrease_frequency < 0)) { + if (($numerical_decrease_frequency < 0)) { throw new \InvalidArgumentException('invalid value for $numerical_decrease_frequency when calling PickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType., must be bigger than or equal to 0.'); } @@ -966,7 +1125,7 @@ public function setNumericalDecreaseFrequency($numerical_decrease_frequency) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -978,6 +1137,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -991,7 +1151,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1007,7 +1167,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1019,6 +1179,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID.php b/lib/Model/PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID.php index 3c0fab5..816551b 100644 --- a/lib/Model/PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID.php +++ b/lib/Model/PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID.php @@ -2,7 +2,7 @@ /** * PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmpl */ protected static $openAPITypes = [ 'border_color' => 'string', - 'border_style_type' => 'string', + 'border_style_type' => '\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType', 'border_size' => 'string', 'border_radius' => 'int', 'font_color' => 'string', @@ -99,6 +97,34 @@ class PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmpl 'company_logo_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'border_color' => false, + 'border_style_type' => false, + 'border_size' => false, + 'border_radius' => false, + 'font_color' => false, + 'font_type' => false, + 'abbreviation' => false, + 'acronym' => false, + 'icon' => false, + 'design_name' => false, + 'display_name' => false, + 'background_image_url' => false, + 'company_logo_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -119,6 +145,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -240,19 +318,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['border_color'] = $data['border_color'] ?? null; - $this->container['border_style_type'] = $data['border_style_type'] ?? null; - $this->container['border_size'] = $data['border_size'] ?? null; - $this->container['border_radius'] = $data['border_radius'] ?? null; - $this->container['font_color'] = $data['font_color'] ?? null; - $this->container['font_type'] = $data['font_type'] ?? null; - $this->container['abbreviation'] = $data['abbreviation'] ?? null; - $this->container['acronym'] = $data['acronym'] ?? null; - $this->container['icon'] = $data['icon'] ?? null; - $this->container['design_name'] = $data['design_name'] ?? null; - $this->container['display_name'] = $data['display_name'] ?? null; - $this->container['background_image_url'] = $data['background_image_url'] ?? null; - $this->container['company_logo_url'] = $data['company_logo_url'] ?? null; + $this->setIfExists('border_color', $data ?? [], null); + $this->setIfExists('border_style_type', $data ?? [], null); + $this->setIfExists('border_size', $data ?? [], null); + $this->setIfExists('border_radius', $data ?? [], null); + $this->setIfExists('font_color', $data ?? [], null); + $this->setIfExists('font_type', $data ?? [], null); + $this->setIfExists('abbreviation', $data ?? [], null); + $this->setIfExists('acronym', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('design_name', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('background_image_url', $data ?? [], null); + $this->setIfExists('company_logo_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -375,9 +471,12 @@ public function getBorderColor() */ public function setBorderColor($border_color) { + if (is_null($border_color)) { + throw new \InvalidArgumentException('non-nullable border_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $border_color))) { - throw new \InvalidArgumentException("invalid value for $border_color when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($border_color)))) { + throw new \InvalidArgumentException("invalid value for \$border_color when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['border_color'] = $border_color; @@ -388,7 +487,7 @@ public function setBorderColor($border_color) /** * Gets border_style_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType */ public function getBorderStyleType() { @@ -398,12 +497,15 @@ public function getBorderStyleType() /** * Sets border_style_type * - * @param string $border_style_type border_style_type + * @param \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType $border_style_type border_style_type * * @return self */ public function setBorderStyleType($border_style_type) { + if (is_null($border_style_type)) { + throw new \InvalidArgumentException('non-nullable border_style_type cannot be null'); + } $this->container['border_style_type'] = $border_style_type; return $this; @@ -428,6 +530,9 @@ public function getBorderSize() */ public function setBorderSize($border_size) { + if (is_null($border_size)) { + throw new \InvalidArgumentException('non-nullable border_size cannot be null'); + } if ((mb_strlen($border_size) < 1)) { throw new \InvalidArgumentException('invalid length for $border_size when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must be bigger than or equal to 1.'); @@ -457,6 +562,9 @@ public function getBorderRadius() */ public function setBorderRadius($border_radius) { + if (is_null($border_radius)) { + throw new \InvalidArgumentException('non-nullable border_radius cannot be null'); + } if (($border_radius > 20)) { throw new \InvalidArgumentException('invalid value for $border_radius when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must be smaller than or equal to 20.'); @@ -489,9 +597,12 @@ public function getFontColor() */ public function setFontColor($font_color) { + if (is_null($font_color)) { + throw new \InvalidArgumentException('non-nullable font_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $font_color))) { - throw new \InvalidArgumentException("invalid value for $font_color when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($font_color)))) { + throw new \InvalidArgumentException("invalid value for \$font_color when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['font_color'] = $font_color; @@ -518,6 +629,9 @@ public function getFontType() */ public function setFontType($font_type) { + if (is_null($font_type)) { + throw new \InvalidArgumentException('non-nullable font_type cannot be null'); + } if ((mb_strlen($font_type) < 1)) { throw new \InvalidArgumentException('invalid length for $font_type when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must be bigger than or equal to 1.'); @@ -547,6 +661,9 @@ public function getAbbreviation() */ public function setAbbreviation($abbreviation) { + if (is_null($abbreviation)) { + throw new \InvalidArgumentException('non-nullable abbreviation cannot be null'); + } if ((mb_strlen($abbreviation) < 1)) { throw new \InvalidArgumentException('invalid length for $abbreviation when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must be bigger than or equal to 1.'); @@ -576,6 +693,9 @@ public function getAcronym() */ public function setAcronym($acronym) { + if (is_null($acronym)) { + throw new \InvalidArgumentException('non-nullable acronym cannot be null'); + } if ((mb_strlen($acronym) < 1)) { throw new \InvalidArgumentException('invalid length for $acronym when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must be bigger than or equal to 1.'); @@ -605,6 +725,9 @@ public function getIcon() */ public function setIcon($icon) { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } if ((mb_strlen($icon) < 1)) { throw new \InvalidArgumentException('invalid length for $icon when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must be bigger than or equal to 1.'); @@ -634,6 +757,9 @@ public function getDesignName() */ public function setDesignName($design_name) { + if (is_null($design_name)) { + throw new \InvalidArgumentException('non-nullable design_name cannot be null'); + } if ((mb_strlen($design_name) < 1)) { throw new \InvalidArgumentException('invalid length for $design_name when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must be bigger than or equal to 1.'); @@ -663,6 +789,9 @@ public function getDisplayName() */ public function setDisplayName($display_name) { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } if ((mb_strlen($display_name) < 1)) { throw new \InvalidArgumentException('invalid length for $display_name when calling PickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsEmployeeID., must be bigger than or equal to 1.'); @@ -692,6 +821,9 @@ public function getBackgroundImageUrl() */ public function setBackgroundImageUrl($background_image_url) { + if (is_null($background_image_url)) { + throw new \InvalidArgumentException('non-nullable background_image_url cannot be null'); + } $this->container['background_image_url'] = $background_image_url; return $this; @@ -716,6 +848,9 @@ public function getCompanyLogoUrl() */ public function setCompanyLogoUrl($company_logo_url) { + if (is_null($company_logo_url)) { + throw new \InvalidArgumentException('non-nullable company_logo_url cannot be null'); + } $this->container['company_logo_url'] = $company_logo_url; return $this; @@ -727,7 +862,7 @@ public function setCompanyLogoUrl($company_logo_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -739,6 +874,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -752,7 +888,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -768,7 +904,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -780,6 +916,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.php b/lib/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.php index cc8338e..cea0019 100644 --- a/lib/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.php +++ b/lib/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.php @@ -2,7 +2,7 @@ /** * PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId i */ protected static $openAPITypes = [ 'border_color' => 'string', - 'border_style_type' => 'string', + 'border_style_type' => '\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType', 'border_size' => 'string', 'border_radius' => 'int', 'font_color' => 'string', @@ -99,6 +97,34 @@ class PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId i 'company_logo_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'border_color' => false, + 'border_style_type' => false, + 'border_size' => false, + 'border_radius' => false, + 'font_color' => false, + 'font_type' => false, + 'abbreviation' => false, + 'acronym' => false, + 'icon' => false, + 'design_name' => false, + 'display_name' => false, + 'background_image_url' => false, + 'company_logo_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -119,6 +145,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -240,19 +318,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['border_color'] = $data['border_color'] ?? null; - $this->container['border_style_type'] = $data['border_style_type'] ?? null; - $this->container['border_size'] = $data['border_size'] ?? null; - $this->container['border_radius'] = $data['border_radius'] ?? null; - $this->container['font_color'] = $data['font_color'] ?? null; - $this->container['font_type'] = $data['font_type'] ?? null; - $this->container['abbreviation'] = $data['abbreviation'] ?? null; - $this->container['acronym'] = $data['acronym'] ?? null; - $this->container['icon'] = $data['icon'] ?? null; - $this->container['design_name'] = $data['design_name'] ?? null; - $this->container['display_name'] = $data['display_name'] ?? null; - $this->container['background_image_url'] = $data['background_image_url'] ?? null; - $this->container['company_logo_url'] = $data['company_logo_url'] ?? null; + $this->setIfExists('border_color', $data ?? [], null); + $this->setIfExists('border_style_type', $data ?? [], null); + $this->setIfExists('border_size', $data ?? [], null); + $this->setIfExists('border_radius', $data ?? [], null); + $this->setIfExists('font_color', $data ?? [], null); + $this->setIfExists('font_type', $data ?? [], null); + $this->setIfExists('abbreviation', $data ?? [], null); + $this->setIfExists('acronym', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('design_name', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('background_image_url', $data ?? [], null); + $this->setIfExists('company_logo_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -375,9 +471,12 @@ public function getBorderColor() */ public function setBorderColor($border_color) { + if (is_null($border_color)) { + throw new \InvalidArgumentException('non-nullable border_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $border_color))) { - throw new \InvalidArgumentException("invalid value for $border_color when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($border_color)))) { + throw new \InvalidArgumentException("invalid value for \$border_color when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['border_color'] = $border_color; @@ -388,7 +487,7 @@ public function setBorderColor($border_color) /** * Gets border_style_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType */ public function getBorderStyleType() { @@ -398,12 +497,15 @@ public function getBorderStyleType() /** * Sets border_style_type * - * @param string $border_style_type border_style_type + * @param \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType $border_style_type border_style_type * * @return self */ public function setBorderStyleType($border_style_type) { + if (is_null($border_style_type)) { + throw new \InvalidArgumentException('non-nullable border_style_type cannot be null'); + } $this->container['border_style_type'] = $border_style_type; return $this; @@ -428,6 +530,9 @@ public function getBorderSize() */ public function setBorderSize($border_size) { + if (is_null($border_size)) { + throw new \InvalidArgumentException('non-nullable border_size cannot be null'); + } if ((mb_strlen($border_size) < 1)) { throw new \InvalidArgumentException('invalid length for $border_size when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must be bigger than or equal to 1.'); @@ -457,6 +562,9 @@ public function getBorderRadius() */ public function setBorderRadius($border_radius) { + if (is_null($border_radius)) { + throw new \InvalidArgumentException('non-nullable border_radius cannot be null'); + } if (($border_radius > 20)) { throw new \InvalidArgumentException('invalid value for $border_radius when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must be smaller than or equal to 20.'); @@ -489,9 +597,12 @@ public function getFontColor() */ public function setFontColor($font_color) { + if (is_null($font_color)) { + throw new \InvalidArgumentException('non-nullable font_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $font_color))) { - throw new \InvalidArgumentException("invalid value for $font_color when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($font_color)))) { + throw new \InvalidArgumentException("invalid value for \$font_color when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['font_color'] = $font_color; @@ -518,6 +629,9 @@ public function getFontType() */ public function setFontType($font_type) { + if (is_null($font_type)) { + throw new \InvalidArgumentException('non-nullable font_type cannot be null'); + } if ((mb_strlen($font_type) < 1)) { throw new \InvalidArgumentException('invalid length for $font_type when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must be bigger than or equal to 1.'); @@ -547,6 +661,9 @@ public function getAbbreviation() */ public function setAbbreviation($abbreviation) { + if (is_null($abbreviation)) { + throw new \InvalidArgumentException('non-nullable abbreviation cannot be null'); + } if ((mb_strlen($abbreviation) < 1)) { throw new \InvalidArgumentException('invalid length for $abbreviation when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must be bigger than or equal to 1.'); @@ -576,6 +693,9 @@ public function getAcronym() */ public function setAcronym($acronym) { + if (is_null($acronym)) { + throw new \InvalidArgumentException('non-nullable acronym cannot be null'); + } if ((mb_strlen($acronym) < 1)) { throw new \InvalidArgumentException('invalid length for $acronym when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must be bigger than or equal to 1.'); @@ -605,6 +725,9 @@ public function getIcon() */ public function setIcon($icon) { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } if ((mb_strlen($icon) < 1)) { throw new \InvalidArgumentException('invalid length for $icon when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must be bigger than or equal to 1.'); @@ -634,6 +757,9 @@ public function getDesignName() */ public function setDesignName($design_name) { + if (is_null($design_name)) { + throw new \InvalidArgumentException('non-nullable design_name cannot be null'); + } if ((mb_strlen($design_name) < 1)) { throw new \InvalidArgumentException('invalid length for $design_name when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must be bigger than or equal to 1.'); @@ -663,6 +789,9 @@ public function getDisplayName() */ public function setDisplayName($display_name) { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } if ((mb_strlen($display_name) < 1)) { throw new \InvalidArgumentException('invalid length for $display_name when calling PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId., must be bigger than or equal to 1.'); @@ -692,6 +821,9 @@ public function getBackgroundImageUrl() */ public function setBackgroundImageUrl($background_image_url) { + if (is_null($background_image_url)) { + throw new \InvalidArgumentException('non-nullable background_image_url cannot be null'); + } $this->container['background_image_url'] = $background_image_url; return $this; @@ -716,6 +848,9 @@ public function getCompanyLogoUrl() */ public function setCompanyLogoUrl($company_logo_url) { + if (is_null($company_logo_url)) { + throw new \InvalidArgumentException('non-nullable company_logo_url cannot be null'); + } $this->container['company_logo_url'] = $company_logo_url; return $this; @@ -727,7 +862,7 @@ public function setCompanyLogoUrl($company_logo_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -739,6 +874,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -752,7 +888,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -768,7 +904,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -780,6 +916,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.php b/lib/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.php new file mode 100644 index 0000000..3777fa5 --- /dev/null +++ b/lib/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType.php @@ -0,0 +1,382 @@ + + */ +class PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pick_VSPaymentDesignUpdateParams_Exclude_keyofVSPaymentDesignUpdateParams_id___borderStyleType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.php b/lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.php index c85b3f3..c7996fc 100644 --- a/lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.php +++ b/lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.php @@ -2,7 +2,7 @@ /** * PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -67,8 +65,8 @@ class PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLast 'cell_phone_number' => 'string', 'offer_amount_cents' => 'int', 'order_number' => 'int', - 'transaction_type' => 'string', - 'register_id' => 'string', + 'transaction_type' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType', + 'register_id' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID', 'redeemed_source' => 'string', 'redeemed_transaction_id' => 'string', 'redeemed_amount' => 'int', @@ -117,6 +115,43 @@ class PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLast 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'campaign_id' => false, + 'member_id' => false, + 'cell_phone_number' => false, + 'offer_amount_cents' => false, + 'order_number' => false, + 'transaction_type' => false, + 'register_id' => false, + 'redeemed_source' => false, + 'redeemed_transaction_id' => false, + 'redeemed_amount' => false, + 'is_redeemed' => false, + 'refunded_transaction_id' => false, + 'refunded_amount' => false, + 'status' => false, + 'customer_id' => false, + 'authorized_against_check_number' => false, + 'authorized_amount' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -137,6 +172,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -285,28 +372,46 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['campaign_id'] = $data['campaign_id'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['cell_phone_number'] = $data['cell_phone_number'] ?? null; - $this->container['offer_amount_cents'] = $data['offer_amount_cents'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['redeemed_source'] = $data['redeemed_source'] ?? null; - $this->container['redeemed_transaction_id'] = $data['redeemed_transaction_id'] ?? null; - $this->container['redeemed_amount'] = $data['redeemed_amount'] ?? null; - $this->container['is_redeemed'] = $data['is_redeemed'] ?? null; - $this->container['refunded_transaction_id'] = $data['refunded_transaction_id'] ?? null; - $this->container['refunded_amount'] = $data['refunded_amount'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['customer_id'] = $data['customer_id'] ?? null; - $this->container['authorized_against_check_number'] = $data['authorized_against_check_number'] ?? null; - $this->container['authorized_amount'] = $data['authorized_amount'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('cell_phone_number', $data ?? [], null); + $this->setIfExists('offer_amount_cents', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('redeemed_source', $data ?? [], null); + $this->setIfExists('redeemed_transaction_id', $data ?? [], null); + $this->setIfExists('redeemed_amount', $data ?? [], null); + $this->setIfExists('is_redeemed', $data ?? [], null); + $this->setIfExists('refunded_transaction_id', $data ?? [], null); + $this->setIfExists('refunded_amount', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('customer_id', $data ?? [], null); + $this->setIfExists('authorized_against_check_number', $data ?? [], null); + $this->setIfExists('authorized_amount', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -465,6 +570,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must be smaller than or equal to 10.'); } @@ -496,14 +604,17 @@ public function getCampaignId() */ public function setCampaignId($campaign_id) { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } if ((mb_strlen($campaign_id) > 10)) { throw new \InvalidArgumentException('invalid length for $campaign_id when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must be smaller than or equal to 10.'); } if ((mb_strlen($campaign_id) < 10)) { throw new \InvalidArgumentException('invalid length for $campaign_id when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $campaign_id))) { - throw new \InvalidArgumentException("invalid value for $campaign_id when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($campaign_id)))) { + throw new \InvalidArgumentException("invalid value for \$campaign_id when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['campaign_id'] = $campaign_id; @@ -530,9 +641,12 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -559,6 +673,9 @@ public function getCellPhoneNumber() */ public function setCellPhoneNumber($cell_phone_number) { + if (is_null($cell_phone_number)) { + throw new \InvalidArgumentException('non-nullable cell_phone_number cannot be null'); + } $this->container['cell_phone_number'] = $cell_phone_number; return $this; @@ -583,6 +700,9 @@ public function getOfferAmountCents() */ public function setOfferAmountCents($offer_amount_cents) { + if (is_null($offer_amount_cents)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents cannot be null'); + } if (($offer_amount_cents < 0)) { throw new \InvalidArgumentException('invalid value for $offer_amount_cents when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must be bigger than or equal to 0.'); @@ -612,6 +732,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 0)) { throw new \InvalidArgumentException('invalid value for $order_number when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must be bigger than or equal to 0.'); @@ -625,7 +748,7 @@ public function setOrderNumber($order_number) /** * Gets transaction_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType */ public function getTransactionType() { @@ -635,12 +758,15 @@ public function getTransactionType() /** * Sets transaction_type * - * @param string $transaction_type The type of the transaction - only redemption at the moment + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType $transaction_type transaction_type * * @return self */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -649,7 +775,7 @@ public function setTransactionType($transaction_type) /** * Gets register_id * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID */ public function getRegisterId() { @@ -659,12 +785,15 @@ public function getRegisterId() /** * Sets register_id * - * @param string $register_id The ID of the register where the transaction occurred + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID $register_id register_id * * @return self */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -689,6 +818,9 @@ public function getRedeemedSource() */ public function setRedeemedSource($redeemed_source) { + if (is_null($redeemed_source)) { + throw new \InvalidArgumentException('non-nullable redeemed_source cannot be null'); + } $this->container['redeemed_source'] = $redeemed_source; return $this; @@ -713,6 +845,9 @@ public function getRedeemedTransactionId() */ public function setRedeemedTransactionId($redeemed_transaction_id) { + if (is_null($redeemed_transaction_id)) { + throw new \InvalidArgumentException('non-nullable redeemed_transaction_id cannot be null'); + } $this->container['redeemed_transaction_id'] = $redeemed_transaction_id; return $this; @@ -737,6 +872,9 @@ public function getRedeemedAmount() */ public function setRedeemedAmount($redeemed_amount) { + if (is_null($redeemed_amount)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount cannot be null'); + } if (($redeemed_amount < 0)) { throw new \InvalidArgumentException('invalid value for $redeemed_amount when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must be bigger than or equal to 0.'); @@ -766,6 +904,9 @@ public function getIsRedeemed() */ public function setIsRedeemed($is_redeemed) { + if (is_null($is_redeemed)) { + throw new \InvalidArgumentException('non-nullable is_redeemed cannot be null'); + } $this->container['is_redeemed'] = $is_redeemed; return $this; @@ -790,6 +931,9 @@ public function getRefundedTransactionId() */ public function setRefundedTransactionId($refunded_transaction_id) { + if (is_null($refunded_transaction_id)) { + throw new \InvalidArgumentException('non-nullable refunded_transaction_id cannot be null'); + } $this->container['refunded_transaction_id'] = $refunded_transaction_id; return $this; @@ -814,6 +958,9 @@ public function getRefundedAmount() */ public function setRefundedAmount($refunded_amount) { + if (is_null($refunded_amount)) { + throw new \InvalidArgumentException('non-nullable refunded_amount cannot be null'); + } if (($refunded_amount < 0)) { throw new \InvalidArgumentException('invalid value for $refunded_amount when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must be bigger than or equal to 0.'); @@ -843,6 +990,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -867,6 +1017,9 @@ public function getCustomerId() */ public function setCustomerId($customer_id) { + if (is_null($customer_id)) { + throw new \InvalidArgumentException('non-nullable customer_id cannot be null'); + } $this->container['customer_id'] = $customer_id; return $this; @@ -891,6 +1044,9 @@ public function getAuthorizedAgainstCheckNumber() */ public function setAuthorizedAgainstCheckNumber($authorized_against_check_number) { + if (is_null($authorized_against_check_number)) { + throw new \InvalidArgumentException('non-nullable authorized_against_check_number cannot be null'); + } $this->container['authorized_against_check_number'] = $authorized_against_check_number; return $this; @@ -915,6 +1071,9 @@ public function getAuthorizedAmount() */ public function setAuthorizedAmount($authorized_amount) { + if (is_null($authorized_amount)) { + throw new \InvalidArgumentException('non-nullable authorized_amount cannot be null'); + } if (($authorized_amount < 0)) { throw new \InvalidArgumentException('invalid value for $authorized_amount when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must be bigger than or equal to 0.'); @@ -944,14 +1103,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -978,6 +1140,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -1002,6 +1167,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -1026,6 +1194,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -1037,7 +1208,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1049,6 +1220,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1062,7 +1234,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1078,7 +1250,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1090,6 +1262,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.php b/lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.php new file mode 100644 index 0000000..7136010 --- /dev/null +++ b/lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID.php @@ -0,0 +1,383 @@ + + */ +class PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pick_VSStaticVoucher_Exclude_keyofVSStaticVoucher_redeemedAt_or_refundedAt_or_lastViewedAt___registerID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.php b/lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.php new file mode 100644 index 0000000..249473a --- /dev/null +++ b/lib/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType.php @@ -0,0 +1,383 @@ + + */ +class PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pick_VSStaticVoucher_Exclude_keyofVSStaticVoucher_redeemedAt_or_refundedAt_or_lastViewedAt___transactionType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId.php b/lib/Model/PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId.php index c790619..fbe0626 100644 --- a/lib/Model/PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId.php +++ b/lib/Model/PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId.php @@ -2,7 +2,7 @@ /** * PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -79,6 +77,24 @@ class PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParams 'email_address' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email_address' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -99,6 +115,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -190,9 +258,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -255,6 +341,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId., must be bigger than or equal to 1.'); @@ -284,6 +373,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling PickWTEmailSubscriberUpdateParamsExcludeKeyofWTEmailSubscriberUpdateParamsId., must be bigger than or equal to 1.'); @@ -313,6 +405,9 @@ public function getEmailAddress() */ public function setEmailAddress($email_address) { + if (is_null($email_address)) { + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -324,7 +419,7 @@ public function setEmailAddress($email_address) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -336,6 +431,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -349,7 +445,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -365,7 +461,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -377,6 +473,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.php b/lib/Model/PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.php index 81d5ed4..47e76a2 100644 --- a/lib/Model/PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.php +++ b/lib/Model/PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.php @@ -2,7 +2,7 @@ /** * PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,14 +67,14 @@ class PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail implements ModelInte 'wallet_sequence_number' => 'int', 'job_title' => 'string', 'department' => 'string', - 'schedule_start_day' => 'string', - 'schedule_start_hour' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_start_minute' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_start_meridiem' => 'string', - 'schedule_end_day' => 'string', - 'schedule_end_hour' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_end_minute' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_end_meridiem' => 'string' + 'schedule_start_day' => '\OpenAPI\Client\Model\EmployeeScheduleStartDay', + 'schedule_start_hour' => '\OpenAPI\Client\Model\EmployeeScheduleStartHour', + 'schedule_start_minute' => '\OpenAPI\Client\Model\EmployeeScheduleStartMinute', + 'schedule_start_meridiem' => '\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem', + 'schedule_end_day' => '\OpenAPI\Client\Model\EmployeeScheduleStartDay', + 'schedule_end_hour' => '\OpenAPI\Client\Model\EmployeeScheduleStartHour', + 'schedule_end_minute' => '\OpenAPI\Client\Model\EmployeeScheduleStartMinute', + 'schedule_end_meridiem' => '\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem' ]; /** @@ -105,6 +103,37 @@ class PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail implements ModelInte 'schedule_end_meridiem' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false, + 'first_name' => false, + 'last_name' => false, + 'phone_number' => false, + 'is_public_representative' => false, + 'wallet_sequence_number' => false, + 'job_title' => false, + 'department' => false, + 'schedule_start_day' => false, + 'schedule_start_hour' => false, + 'schedule_start_minute' => false, + 'schedule_start_meridiem' => false, + 'schedule_end_day' => false, + 'schedule_end_hour' => false, + 'schedule_end_minute' => false, + 'schedule_end_meridiem' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -125,6 +154,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -255,22 +336,40 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['is_public_representative'] = $data['is_public_representative'] ?? null; - $this->container['wallet_sequence_number'] = $data['wallet_sequence_number'] ?? null; - $this->container['job_title'] = $data['job_title'] ?? null; - $this->container['department'] = $data['department'] ?? null; - $this->container['schedule_start_day'] = $data['schedule_start_day'] ?? null; - $this->container['schedule_start_hour'] = $data['schedule_start_hour'] ?? null; - $this->container['schedule_start_minute'] = $data['schedule_start_minute'] ?? null; - $this->container['schedule_start_meridiem'] = $data['schedule_start_meridiem'] ?? null; - $this->container['schedule_end_day'] = $data['schedule_end_day'] ?? null; - $this->container['schedule_end_hour'] = $data['schedule_end_hour'] ?? null; - $this->container['schedule_end_minute'] = $data['schedule_end_minute'] ?? null; - $this->container['schedule_end_meridiem'] = $data['schedule_end_meridiem'] ?? null; + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('is_public_representative', $data ?? [], null); + $this->setIfExists('wallet_sequence_number', $data ?? [], null); + $this->setIfExists('job_title', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('schedule_start_day', $data ?? [], null); + $this->setIfExists('schedule_start_hour', $data ?? [], null); + $this->setIfExists('schedule_start_minute', $data ?? [], null); + $this->setIfExists('schedule_start_meridiem', $data ?? [], null); + $this->setIfExists('schedule_end_day', $data ?? [], null); + $this->setIfExists('schedule_end_hour', $data ?? [], null); + $this->setIfExists('schedule_end_minute', $data ?? [], null); + $this->setIfExists('schedule_end_meridiem', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -360,6 +459,9 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) < 0)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail., must be bigger than or equal to 0.'); @@ -389,6 +491,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail., must be bigger than or equal to 1.'); @@ -418,6 +523,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail., must be bigger than or equal to 1.'); @@ -447,6 +555,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -471,6 +582,9 @@ public function getIsPublicRepresentative() */ public function setIsPublicRepresentative($is_public_representative) { + if (is_null($is_public_representative)) { + throw new \InvalidArgumentException('non-nullable is_public_representative cannot be null'); + } $this->container['is_public_representative'] = $is_public_representative; return $this; @@ -495,6 +609,9 @@ public function getWalletSequenceNumber() */ public function setWalletSequenceNumber($wallet_sequence_number) { + if (is_null($wallet_sequence_number)) { + throw new \InvalidArgumentException('non-nullable wallet_sequence_number cannot be null'); + } $this->container['wallet_sequence_number'] = $wallet_sequence_number; return $this; @@ -519,6 +636,9 @@ public function getJobTitle() */ public function setJobTitle($job_title) { + if (is_null($job_title)) { + throw new \InvalidArgumentException('non-nullable job_title cannot be null'); + } if ((mb_strlen($job_title) < 0)) { throw new \InvalidArgumentException('invalid length for $job_title when calling PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail., must be bigger than or equal to 0.'); @@ -548,6 +668,9 @@ public function getDepartment() */ public function setDepartment($department) { + if (is_null($department)) { + throw new \InvalidArgumentException('non-nullable department cannot be null'); + } if ((mb_strlen($department) < 0)) { throw new \InvalidArgumentException('invalid length for $department when calling PickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail., must be bigger than or equal to 0.'); @@ -561,7 +684,7 @@ public function setDepartment($department) /** * Gets schedule_start_day * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartDay|null */ public function getScheduleStartDay() { @@ -571,12 +694,15 @@ public function getScheduleStartDay() /** * Sets schedule_start_day * - * @param string|null $schedule_start_day schedule_start_day + * @param \OpenAPI\Client\Model\EmployeeScheduleStartDay|null $schedule_start_day schedule_start_day * * @return self */ public function setScheduleStartDay($schedule_start_day) { + if (is_null($schedule_start_day)) { + throw new \InvalidArgumentException('non-nullable schedule_start_day cannot be null'); + } $this->container['schedule_start_day'] = $schedule_start_day; return $this; @@ -585,7 +711,7 @@ public function setScheduleStartDay($schedule_start_day) /** * Gets schedule_start_hour * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartHour|null */ public function getScheduleStartHour() { @@ -595,12 +721,15 @@ public function getScheduleStartHour() /** * Sets schedule_start_hour * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_start_hour schedule_start_hour + * @param \OpenAPI\Client\Model\EmployeeScheduleStartHour|null $schedule_start_hour schedule_start_hour * * @return self */ public function setScheduleStartHour($schedule_start_hour) { + if (is_null($schedule_start_hour)) { + throw new \InvalidArgumentException('non-nullable schedule_start_hour cannot be null'); + } $this->container['schedule_start_hour'] = $schedule_start_hour; return $this; @@ -609,7 +738,7 @@ public function setScheduleStartHour($schedule_start_hour) /** * Gets schedule_start_minute * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null */ public function getScheduleStartMinute() { @@ -619,12 +748,15 @@ public function getScheduleStartMinute() /** * Sets schedule_start_minute * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_start_minute schedule_start_minute + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null $schedule_start_minute schedule_start_minute * * @return self */ public function setScheduleStartMinute($schedule_start_minute) { + if (is_null($schedule_start_minute)) { + throw new \InvalidArgumentException('non-nullable schedule_start_minute cannot be null'); + } $this->container['schedule_start_minute'] = $schedule_start_minute; return $this; @@ -633,7 +765,7 @@ public function setScheduleStartMinute($schedule_start_minute) /** * Gets schedule_start_meridiem * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null */ public function getScheduleStartMeridiem() { @@ -643,12 +775,15 @@ public function getScheduleStartMeridiem() /** * Sets schedule_start_meridiem * - * @param string|null $schedule_start_meridiem schedule_start_meridiem + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null $schedule_start_meridiem schedule_start_meridiem * * @return self */ public function setScheduleStartMeridiem($schedule_start_meridiem) { + if (is_null($schedule_start_meridiem)) { + throw new \InvalidArgumentException('non-nullable schedule_start_meridiem cannot be null'); + } $this->container['schedule_start_meridiem'] = $schedule_start_meridiem; return $this; @@ -657,7 +792,7 @@ public function setScheduleStartMeridiem($schedule_start_meridiem) /** * Gets schedule_end_day * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartDay|null */ public function getScheduleEndDay() { @@ -667,12 +802,15 @@ public function getScheduleEndDay() /** * Sets schedule_end_day * - * @param string|null $schedule_end_day schedule_end_day + * @param \OpenAPI\Client\Model\EmployeeScheduleStartDay|null $schedule_end_day schedule_end_day * * @return self */ public function setScheduleEndDay($schedule_end_day) { + if (is_null($schedule_end_day)) { + throw new \InvalidArgumentException('non-nullable schedule_end_day cannot be null'); + } $this->container['schedule_end_day'] = $schedule_end_day; return $this; @@ -681,7 +819,7 @@ public function setScheduleEndDay($schedule_end_day) /** * Gets schedule_end_hour * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartHour|null */ public function getScheduleEndHour() { @@ -691,12 +829,15 @@ public function getScheduleEndHour() /** * Sets schedule_end_hour * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_end_hour schedule_end_hour + * @param \OpenAPI\Client\Model\EmployeeScheduleStartHour|null $schedule_end_hour schedule_end_hour * * @return self */ public function setScheduleEndHour($schedule_end_hour) { + if (is_null($schedule_end_hour)) { + throw new \InvalidArgumentException('non-nullable schedule_end_hour cannot be null'); + } $this->container['schedule_end_hour'] = $schedule_end_hour; return $this; @@ -705,7 +846,7 @@ public function setScheduleEndHour($schedule_end_hour) /** * Gets schedule_end_minute * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null */ public function getScheduleEndMinute() { @@ -715,12 +856,15 @@ public function getScheduleEndMinute() /** * Sets schedule_end_minute * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_end_minute schedule_end_minute + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null $schedule_end_minute schedule_end_minute * * @return self */ public function setScheduleEndMinute($schedule_end_minute) { + if (is_null($schedule_end_minute)) { + throw new \InvalidArgumentException('non-nullable schedule_end_minute cannot be null'); + } $this->container['schedule_end_minute'] = $schedule_end_minute; return $this; @@ -729,7 +873,7 @@ public function setScheduleEndMinute($schedule_end_minute) /** * Gets schedule_end_meridiem * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null */ public function getScheduleEndMeridiem() { @@ -739,12 +883,15 @@ public function getScheduleEndMeridiem() /** * Sets schedule_end_meridiem * - * @param string|null $schedule_end_meridiem schedule_end_meridiem + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null $schedule_end_meridiem schedule_end_meridiem * * @return self */ public function setScheduleEndMeridiem($schedule_end_meridiem) { + if (is_null($schedule_end_meridiem)) { + throw new \InvalidArgumentException('non-nullable schedule_end_meridiem cannot be null'); + } $this->container['schedule_end_meridiem'] = $schedule_end_meridiem; return $this; @@ -756,7 +903,7 @@ public function setScheduleEndMeridiem($schedule_end_meridiem) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -768,6 +915,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -781,7 +929,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -797,7 +945,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -809,6 +957,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday.php b/lib/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday.php new file mode 100644 index 0000000..0feabb0 --- /dev/null +++ b/lib/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday.php @@ -0,0 +1,714 @@ + + */ +class PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pick_WTMember.memberID-or-firstName-or-lastName-or-membershipTierID-or-pointsAccrued-or-mobileNumber-or-email-or-birthday_'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'member_id' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'membership_tier_id' => 'string', + 'mobile_number' => 'string', + 'email' => 'string', + 'birthday' => 'string', + 'points_accrued' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'member_id' => null, + 'first_name' => null, + 'last_name' => null, + 'membership_tier_id' => null, + 'mobile_number' => null, + 'email' => null, + 'birthday' => null, + 'points_accrued' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'member_id' => false, + 'first_name' => false, + 'last_name' => false, + 'membership_tier_id' => false, + 'mobile_number' => false, + 'email' => false, + 'birthday' => false, + 'points_accrued' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'member_id' => 'memberID', + 'first_name' => 'firstName', + 'last_name' => 'lastName', + 'membership_tier_id' => 'membershipTierID', + 'mobile_number' => 'mobileNumber', + 'email' => 'email', + 'birthday' => 'birthday', + 'points_accrued' => 'pointsAccrued' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'member_id' => 'setMemberId', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'membership_tier_id' => 'setMembershipTierId', + 'mobile_number' => 'setMobileNumber', + 'email' => 'setEmail', + 'birthday' => 'setBirthday', + 'points_accrued' => 'setPointsAccrued' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'member_id' => 'getMemberId', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'membership_tier_id' => 'getMembershipTierId', + 'mobile_number' => 'getMobileNumber', + 'email' => 'getEmail', + 'birthday' => 'getBirthday', + 'points_accrued' => 'getPointsAccrued' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('membership_tier_id', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('birthday', $data ?? [], null); + $this->setIfExists('points_accrued', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['member_id'] === null) { + $invalidProperties[] = "'member_id' can't be null"; + } + if ((mb_strlen($this->container['member_id']) < 1)) { + $invalidProperties[] = "invalid value for 'member_id', the character length must be bigger than or equal to 1."; + } + + if (!preg_match("/^[a-zA-Z0-9]+$/", $this->container['member_id'])) { + $invalidProperties[] = "invalid value for 'member_id', must be conform to the pattern /^[a-zA-Z0-9]+$/."; + } + + if ($this->container['membership_tier_id'] === null) { + $invalidProperties[] = "'membership_tier_id' can't be null"; + } + if ((mb_strlen($this->container['membership_tier_id']) > 12)) { + $invalidProperties[] = "invalid value for 'membership_tier_id', the character length must be smaller than or equal to 12."; + } + + if ((mb_strlen($this->container['membership_tier_id']) < 12)) { + $invalidProperties[] = "invalid value for 'membership_tier_id', the character length must be bigger than or equal to 12."; + } + + if (!preg_match("/^[a-zA-Z0-9]+$/", $this->container['membership_tier_id'])) { + $invalidProperties[] = "invalid value for 'membership_tier_id', must be conform to the pattern /^[a-zA-Z0-9]+$/."; + } + + if ($this->container['mobile_number'] === null) { + $invalidProperties[] = "'mobile_number' can't be null"; + } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['birthday'] === null) { + $invalidProperties[] = "'birthday' can't be null"; + } + if ($this->container['points_accrued'] === null) { + $invalidProperties[] = "'points_accrued' can't be null"; + } + if (($this->container['points_accrued'] < 0)) { + $invalidProperties[] = "invalid value for 'points_accrued', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets member_id + * + * @return string + */ + public function getMemberId() + { + return $this->container['member_id']; + } + + /** + * Sets member_id + * + * @param string $member_id Member ID as represented by the merchant + * + * @return self + */ + public function setMemberId($member_id) + { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } + + if ((mb_strlen($member_id) < 1)) { + throw new \InvalidArgumentException('invalid length for $member_id when calling PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday., must be bigger than or equal to 1.'); + } + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday., must conform to the pattern /^[a-zA-Z0-9]+$/."); + } + + $this->container['member_id'] = $member_id; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name An optional first name of the member + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name An optional last name of the member + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets membership_tier_id + * + * @return string + */ + public function getMembershipTierId() + { + return $this->container['membership_tier_id']; + } + + /** + * Sets membership_tier_id + * + * @param string $membership_tier_id membership_tier_id + * + * @return self + */ + public function setMembershipTierId($membership_tier_id) + { + if (is_null($membership_tier_id)) { + throw new \InvalidArgumentException('non-nullable membership_tier_id cannot be null'); + } + if ((mb_strlen($membership_tier_id) > 12)) { + throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday., must be smaller than or equal to 12.'); + } + if ((mb_strlen($membership_tier_id) < 12)) { + throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday., must be bigger than or equal to 12.'); + } + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($membership_tier_id)))) { + throw new \InvalidArgumentException("invalid value for \$membership_tier_id when calling PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday., must conform to the pattern /^[a-zA-Z0-9]+$/."); + } + + $this->container['membership_tier_id'] = $membership_tier_id; + + return $this; + } + + /** + * Gets mobile_number + * + * @return string + */ + public function getMobileNumber() + { + return $this->container['mobile_number']; + } + + /** + * Sets mobile_number + * + * @param string $mobile_number mobile_number + * + * @return self + */ + public function setMobileNumber($mobile_number) + { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } + $this->container['mobile_number'] = $mobile_number; + + return $this; + } + + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets birthday + * + * @return string + */ + public function getBirthday() + { + return $this->container['birthday']; + } + + /** + * Sets birthday + * + * @param string $birthday Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured + * + * @return self + */ + public function setBirthday($birthday) + { + if (is_null($birthday)) { + throw new \InvalidArgumentException('non-nullable birthday cannot be null'); + } + $this->container['birthday'] = $birthday; + + return $this; + } + + /** + * Gets points_accrued + * + * @return int + */ + public function getPointsAccrued() + { + return $this->container['points_accrued']; + } + + /** + * Sets points_accrued + * + * @param int $points_accrued The number of points that the member has accrued + * + * @return self + */ + public function setPointsAccrued($points_accrued) + { + if (is_null($points_accrued)) { + throw new \InvalidArgumentException('non-nullable points_accrued cannot be null'); + } + + if (($points_accrued < 0)) { + throw new \InvalidArgumentException('invalid value for $points_accrued when calling PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthday., must be bigger than or equal to 0.'); + } + + $this->container['points_accrued'] = $points_accrued; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.php b/lib/Model/PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.php index 3bbcc28..bbbfa89 100644 --- a/lib/Model/PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.php +++ b/lib/Model/PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.php @@ -2,7 +2,7 @@ /** * PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -79,6 +77,24 @@ class PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber implements ModelI 'credit_amount' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'member_id' => false, + 'mobile_number' => false, + 'credit_amount' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -99,6 +115,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -190,9 +258,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['credit_amount'] = $data['credit_amount'] ?? null; + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('credit_amount', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -260,12 +346,15 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (mb_strlen($member_id) < 0)) { + if ((mb_strlen($member_id) < 0)) { throw new \InvalidArgumentException('invalid length for $member_id when calling PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber., must be bigger than or equal to 0.'); } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -292,6 +381,9 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } if ((mb_strlen($mobile_number) < 1)) { throw new \InvalidArgumentException('invalid length for $mobile_number when calling PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber., must be bigger than or equal to 1.'); @@ -321,6 +413,9 @@ public function getCreditAmount() */ public function setCreditAmount($credit_amount) { + if (is_null($credit_amount)) { + throw new \InvalidArgumentException('non-nullable credit_amount cannot be null'); + } if (($credit_amount < 0)) { throw new \InvalidArgumentException('invalid value for $credit_amount when calling PickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber., must be bigger than or equal to 0.'); @@ -337,7 +432,7 @@ public function setCreditAmount($credit_amount) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -349,6 +444,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -362,7 +458,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -378,7 +474,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -390,6 +486,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID.php b/lib/Model/PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID.php index e46dad5..ec65b3a 100644 --- a/lib/Model/PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID.php +++ b/lib/Model/PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID.php @@ -2,7 +2,7 @@ /** * PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -77,6 +75,23 @@ class PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID implements Mod 'destination_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'nickname' => false, + 'destination_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -97,6 +112,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -185,8 +252,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['nickname'] = $data['nickname'] ?? null; - $this->container['destination_url'] = $data['destination_url'] ?? null; + $this->setIfExists('nickname', $data ?? [], null); + $this->setIfExists('destination_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +331,9 @@ public function getNickname() */ public function setNickname($nickname) { + if (is_null($nickname)) { + throw new \InvalidArgumentException('non-nullable nickname cannot be null'); + } if ((mb_strlen($nickname) < 1)) { throw new \InvalidArgumentException('invalid length for $nickname when calling PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID., must be bigger than or equal to 1.'); @@ -275,6 +363,9 @@ public function getDestinationUrl() */ public function setDestinationUrl($destination_url) { + if (is_null($destination_url)) { + throw new \InvalidArgumentException('non-nullable destination_url cannot be null'); + } if ((mb_strlen($destination_url) < 1)) { throw new \InvalidArgumentException('invalid length for $destination_url when calling PickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID., must be bigger than or equal to 1.'); @@ -291,7 +382,7 @@ public function setDestinationUrl($destination_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -303,6 +394,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -316,7 +408,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -332,7 +424,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -344,6 +436,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId.php b/lib/Model/PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId.php index 7db6f01..4087a4b 100644 --- a/lib/Model/PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId.php +++ b/lib/Model/PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId.php @@ -2,7 +2,7 @@ /** * PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -85,6 +83,27 @@ class PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId imple 'published_date' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'order_number' => false, + 'body' => false, + 'url' => false, + 'media_url' => false, + 'published_date' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -105,6 +124,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -205,12 +276,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['body'] = $data['body'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['published_date'] = $data['published_date'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('published_date', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -280,6 +369,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId., must be bigger than or equal to 1.'); @@ -309,6 +401,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId., must be bigger than or equal to 1.'); @@ -338,6 +433,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } if ((mb_strlen($body) < 1)) { throw new \InvalidArgumentException('invalid length for $body when calling PickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId., must be bigger than or equal to 1.'); @@ -367,6 +465,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } $this->container['url'] = $url; return $this; @@ -391,6 +492,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -415,6 +519,9 @@ public function getPublishedDate() */ public function setPublishedDate($published_date) { + if (is_null($published_date)) { + throw new \InvalidArgumentException('non-nullable published_date cannot be null'); + } $this->container['published_date'] = $published_date; return $this; @@ -426,7 +533,7 @@ public function setPublishedDate($published_date) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -438,6 +545,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -451,7 +559,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -467,7 +575,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -479,6 +587,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.php b/lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.php index 3779040..661ed97 100644 --- a/lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.php +++ b/lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.php @@ -2,7 +2,7 @@ /** * PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,7 +59,7 @@ class PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOr * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'employee_id' => 'string', 'merchant_id' => 'string', 'created_at' => '\DateTime', @@ -71,11 +69,11 @@ class PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOr 'media_urls' => 'string[]', 'opt_in_list' => '\OpenAPI\Client\Model\WTOptInList', 'imported_list' => '\OpenAPI\Client\Model\WTImportedList', - 'broadcast_status' => 'string', + 'broadcast_status' => '\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus', 'broadcast_queued_at' => '\DateTime', 'broadcast_started_at' => '\DateTime', 'broadcast_completed_at' => '\DateTime', - 'payment_object_prefix' => 'string', + 'payment_object_prefix' => '\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix', 'payment_object_id' => 'string', 'message_template' => 'string', 'broadcast_scheduled_at' => '\DateTime' @@ -109,6 +107,39 @@ class PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOr 'broadcast_scheduled_at' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'employee_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'phone_number_id' => false, + 'media_urls' => false, + 'opt_in_list' => false, + 'imported_list' => false, + 'broadcast_status' => false, + 'broadcast_queued_at' => true, + 'broadcast_started_at' => true, + 'broadcast_completed_at' => true, + 'payment_object_prefix' => false, + 'payment_object_id' => false, + 'message_template' => false, + 'broadcast_scheduled_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -129,6 +160,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -265,24 +348,42 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; - $this->container['opt_in_list'] = $data['opt_in_list'] ?? null; - $this->container['imported_list'] = $data['imported_list'] ?? null; - $this->container['broadcast_status'] = $data['broadcast_status'] ?? null; - $this->container['broadcast_queued_at'] = $data['broadcast_queued_at'] ?? null; - $this->container['broadcast_started_at'] = $data['broadcast_started_at'] ?? null; - $this->container['broadcast_completed_at'] = $data['broadcast_completed_at'] ?? null; - $this->container['payment_object_prefix'] = $data['payment_object_prefix'] ?? null; - $this->container['payment_object_id'] = $data['payment_object_id'] ?? null; - $this->container['message_template'] = $data['message_template'] ?? null; - $this->container['broadcast_scheduled_at'] = $data['broadcast_scheduled_at'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + $this->setIfExists('opt_in_list', $data ?? [], null); + $this->setIfExists('imported_list', $data ?? [], null); + $this->setIfExists('broadcast_status', $data ?? [], null); + $this->setIfExists('broadcast_queued_at', $data ?? [], null); + $this->setIfExists('broadcast_started_at', $data ?? [], null); + $this->setIfExists('broadcast_completed_at', $data ?? [], null); + $this->setIfExists('payment_object_prefix', $data ?? [], null); + $this->setIfExists('payment_object_id', $data ?? [], null); + $this->setIfExists('message_template', $data ?? [], null); + $this->setIfExists('broadcast_scheduled_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -297,14 +398,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['employee_id'] === null) { $invalidProperties[] = "'employee_id' can't be null"; } @@ -377,14 +470,6 @@ public function listInvalidProperties() if ($this->container['payment_object_prefix'] === null) { $invalidProperties[] = "'payment_object_prefix' can't be null"; } - if ((mb_strlen($this->container['payment_object_prefix']) > 2)) { - $invalidProperties[] = "invalid value for 'payment_object_prefix', the character length must be smaller than or equal to 2."; - } - - if ((mb_strlen($this->container['payment_object_prefix']) < 2)) { - $invalidProperties[] = "invalid value for 'payment_object_prefix', the character length must be bigger than or equal to 2."; - } - if ($this->container['payment_object_id'] === null) { $invalidProperties[] = "'payment_object_id' can't be null"; } @@ -424,7 +509,7 @@ public function valid() /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -434,19 +519,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -471,14 +552,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -505,14 +589,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -539,6 +626,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -563,6 +653,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -587,6 +680,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -611,14 +707,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -645,6 +744,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -669,6 +771,9 @@ public function getOptInList() */ public function setOptInList($opt_in_list) { + if (is_null($opt_in_list)) { + throw new \InvalidArgumentException('non-nullable opt_in_list cannot be null'); + } $this->container['opt_in_list'] = $opt_in_list; return $this; @@ -693,6 +798,9 @@ public function getImportedList() */ public function setImportedList($imported_list) { + if (is_null($imported_list)) { + throw new \InvalidArgumentException('non-nullable imported_list cannot be null'); + } $this->container['imported_list'] = $imported_list; return $this; @@ -701,7 +809,7 @@ public function setImportedList($imported_list) /** * Gets broadcast_status * - * @return string + * @return \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus */ public function getBroadcastStatus() { @@ -711,12 +819,15 @@ public function getBroadcastStatus() /** * Sets broadcast_status * - * @param string $broadcast_status broadcast_status + * @param \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus $broadcast_status broadcast_status * * @return self */ public function setBroadcastStatus($broadcast_status) { + if (is_null($broadcast_status)) { + throw new \InvalidArgumentException('non-nullable broadcast_status cannot be null'); + } $this->container['broadcast_status'] = $broadcast_status; return $this; @@ -741,6 +852,16 @@ public function getBroadcastQueuedAt() */ public function setBroadcastQueuedAt($broadcast_queued_at) { + if (is_null($broadcast_queued_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_queued_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_queued_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_queued_at'] = $broadcast_queued_at; return $this; @@ -765,6 +886,16 @@ public function getBroadcastStartedAt() */ public function setBroadcastStartedAt($broadcast_started_at) { + if (is_null($broadcast_started_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_started_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_started_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_started_at'] = $broadcast_started_at; return $this; @@ -789,6 +920,16 @@ public function getBroadcastCompletedAt() */ public function setBroadcastCompletedAt($broadcast_completed_at) { + if (is_null($broadcast_completed_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_completed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_completed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_completed_at'] = $broadcast_completed_at; return $this; @@ -797,7 +938,7 @@ public function setBroadcastCompletedAt($broadcast_completed_at) /** * Gets payment_object_prefix * - * @return string + * @return \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix */ public function getPaymentObjectPrefix() { @@ -807,19 +948,15 @@ public function getPaymentObjectPrefix() /** * Sets payment_object_prefix * - * @param string $payment_object_prefix payment_object_prefix + * @param \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix $payment_object_prefix payment_object_prefix * * @return self */ public function setPaymentObjectPrefix($payment_object_prefix) { - if ((mb_strlen($payment_object_prefix) > 2)) { - throw new \InvalidArgumentException('invalid length for $payment_object_prefix when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be smaller than or equal to 2.'); + if (is_null($payment_object_prefix)) { + throw new \InvalidArgumentException('non-nullable payment_object_prefix cannot be null'); } - if ((mb_strlen($payment_object_prefix) < 2)) { - throw new \InvalidArgumentException('invalid length for $payment_object_prefix when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be bigger than or equal to 2.'); - } - $this->container['payment_object_prefix'] = $payment_object_prefix; return $this; @@ -844,14 +981,17 @@ public function getPaymentObjectId() */ public function setPaymentObjectId($payment_object_id) { + if (is_null($payment_object_id)) { + throw new \InvalidArgumentException('non-nullable payment_object_id cannot be null'); + } if ((mb_strlen($payment_object_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_object_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_object_id))) { - throw new \InvalidArgumentException("invalid value for $payment_object_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_object_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_object_id when calling PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_object_id'] = $payment_object_id; @@ -878,6 +1018,9 @@ public function getMessageTemplate() */ public function setMessageTemplate($message_template) { + if (is_null($message_template)) { + throw new \InvalidArgumentException('non-nullable message_template cannot be null'); + } $this->container['message_template'] = $message_template; return $this; @@ -902,6 +1045,9 @@ public function getBroadcastScheduledAt() */ public function setBroadcastScheduledAt($broadcast_scheduled_at) { + if (is_null($broadcast_scheduled_at)) { + throw new \InvalidArgumentException('non-nullable broadcast_scheduled_at cannot be null'); + } $this->container['broadcast_scheduled_at'] = $broadcast_scheduled_at; return $this; @@ -913,7 +1059,7 @@ public function setBroadcastScheduledAt($broadcast_scheduled_at) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -925,6 +1071,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -938,7 +1085,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -954,7 +1101,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -966,6 +1113,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.php b/lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.php new file mode 100644 index 0000000..2ebbc9a --- /dev/null +++ b/lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus.php @@ -0,0 +1,382 @@ + + */ +class PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pick_WTPaymentObjectBroadcast_Exclude_keyofWTPaymentObjectBroadcast_listType_or_listID___broadcastStatus'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.php b/lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.php new file mode 100644 index 0000000..e335327 --- /dev/null +++ b/lib/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix.php @@ -0,0 +1,382 @@ + + */ +class PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pick_WTPaymentObjectBroadcast_Exclude_keyofWTPaymentObjectBroadcast_listType_or_listID___paymentObjectPrefix'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId.php b/lib/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId.php new file mode 100644 index 0000000..d0458dc --- /dev/null +++ b/lib/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId.php @@ -0,0 +1,414 @@ + + */ +class PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Pick_WTSmsSubscriberUpdateParams.Exclude_keyofWTSmsSubscriberUpdateParams.id__'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mobile_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mobile_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'mobile_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'mobile_number' => 'mobileNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mobile_number' => 'setMobileNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mobile_number' => 'getMobileNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('mobile_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['mobile_number'] === null) { + $invalidProperties[] = "'mobile_number' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets mobile_number + * + * @return string + */ + public function getMobileNumber() + { + return $this->container['mobile_number']; + } + + /** + * Sets mobile_number + * + * @param string $mobile_number mobile_number + * + * @return self + */ + public function setMobileNumber($mobile_number) + { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } + $this->container['mobile_number'] = $mobile_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.php b/lib/Model/PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.php index 9e4a87e..fbbc812 100644 --- a/lib/Model/PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.php +++ b/lib/Model/PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.php @@ -2,7 +2,7 @@ /** * PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaign protected static $openAPITypes = [ 'title' => 'string', 'notes' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'is_loaded' => 'bool', 'display_value' => 'string', 'merchants_reference_id' => 'string', @@ -99,6 +97,34 @@ class PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaign 'original_file_name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'notes' => false, + 'value_type' => false, + 'is_loaded' => false, + 'display_value' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'employee_id' => false, + 'campaign_group_id' => false, + 'bucket' => false, + 'created_by_source_id' => false, + 'original_file_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -119,6 +145,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -240,19 +318,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['is_loaded'] = $data['is_loaded'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['campaign_group_id'] = $data['campaign_group_id'] ?? null; - $this->container['bucket'] = $data['bucket'] ?? null; - $this->container['created_by_source_id'] = $data['created_by_source_id'] ?? null; - $this->container['original_file_name'] = $data['original_file_name'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('is_loaded', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('campaign_group_id', $data ?? [], null); + $this->setIfExists('bucket', $data ?? [], null); + $this->setIfExists('created_by_source_id', $data ?? [], null); + $this->setIfExists('original_file_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -359,6 +455,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must be bigger than or equal to 1.'); @@ -388,6 +487,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -396,7 +498,7 @@ public function setNotes($notes) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -406,12 +508,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -436,6 +541,9 @@ public function getIsLoaded() */ public function setIsLoaded($is_loaded) { + if (is_null($is_loaded)) { + throw new \InvalidArgumentException('non-nullable is_loaded cannot be null'); + } $this->container['is_loaded'] = $is_loaded; return $this; @@ -460,6 +568,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } $this->container['display_value'] = $display_value; return $this; @@ -484,6 +595,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -508,6 +622,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -532,14 +649,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -566,14 +686,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -600,14 +723,17 @@ public function getCampaignGroupId() */ public function setCampaignGroupId($campaign_group_id) { - if (!is_null($campaign_group_id) && (mb_strlen($campaign_group_id) > 10)) { + if (is_null($campaign_group_id)) { + throw new \InvalidArgumentException('non-nullable campaign_group_id cannot be null'); + } + if ((mb_strlen($campaign_group_id) > 10)) { throw new \InvalidArgumentException('invalid length for $campaign_group_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must be smaller than or equal to 10.'); } - if (!is_null($campaign_group_id) && (mb_strlen($campaign_group_id) < 10)) { + if ((mb_strlen($campaign_group_id) < 10)) { throw new \InvalidArgumentException('invalid length for $campaign_group_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must be bigger than or equal to 10.'); } - if (!is_null($campaign_group_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $campaign_group_id))) { - throw new \InvalidArgumentException("invalid value for $campaign_group_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($campaign_group_id)))) { + throw new \InvalidArgumentException("invalid value for \$campaign_group_id when calling PickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['campaign_group_id'] = $campaign_group_id; @@ -634,6 +760,9 @@ public function getBucket() */ public function setBucket($bucket) { + if (is_null($bucket)) { + throw new \InvalidArgumentException('non-nullable bucket cannot be null'); + } $this->container['bucket'] = $bucket; return $this; @@ -658,6 +787,9 @@ public function getCreatedBySourceId() */ public function setCreatedBySourceId($created_by_source_id) { + if (is_null($created_by_source_id)) { + throw new \InvalidArgumentException('non-nullable created_by_source_id cannot be null'); + } $this->container['created_by_source_id'] = $created_by_source_id; return $this; @@ -682,6 +814,9 @@ public function getOriginalFileName() */ public function setOriginalFileName($original_file_name) { + if (is_null($original_file_name)) { + throw new \InvalidArgumentException('non-nullable original_file_name cannot be null'); + } $this->container['original_file_name'] = $original_file_name; return $this; @@ -693,7 +828,7 @@ public function setOriginalFileName($original_file_name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -705,6 +840,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -718,7 +854,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -734,7 +870,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -746,6 +882,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID.php b/lib/Model/PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID.php index 2012233..6ccc686 100644 --- a/lib/Model/PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID.php +++ b/lib/Model/PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID.php @@ -2,7 +2,7 @@ /** * PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -79,6 +77,24 @@ class PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCamp 'cell_phone' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'member_id' => false, + 'offer_amount_cents' => false, + 'cell_phone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -99,6 +115,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -190,9 +258,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['offer_amount_cents'] = $data['offer_amount_cents'] ?? null; - $this->container['cell_phone'] = $data['cell_phone'] ?? null; + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('offer_amount_cents', $data ?? [], null); + $this->setIfExists('cell_phone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -256,9 +342,12 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -285,6 +374,9 @@ public function getOfferAmountCents() */ public function setOfferAmountCents($offer_amount_cents) { + if (is_null($offer_amount_cents)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents cannot be null'); + } if (($offer_amount_cents < 0)) { throw new \InvalidArgumentException('invalid value for $offer_amount_cents when calling PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID., must be bigger than or equal to 0.'); @@ -314,6 +406,9 @@ public function getCellPhone() */ public function setCellPhone($cell_phone) { + if (is_null($cell_phone)) { + throw new \InvalidArgumentException('non-nullable cell_phone cannot be null'); + } if ((mb_strlen($cell_phone) < 10)) { throw new \InvalidArgumentException('invalid length for $cell_phone when calling PickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID., must be bigger than or equal to 10.'); @@ -330,7 +425,7 @@ public function setCellPhone($cell_phone) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -342,6 +437,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -355,7 +451,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -371,7 +467,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -383,6 +479,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Plan.php b/lib/Model/Plan.php index ab8c285..5049487 100644 --- a/lib/Model/Plan.php +++ b/lib/Model/Plan.php @@ -2,7 +2,7 @@ /** * Plan * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Plan implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class Plan implements ModelInterface, ArrayAccess, \JsonSerializable 'is_current' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'price' => false, + 'features' => false, + 'measurement' => false, + 'is_exceeded' => false, + 'is_current' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['price'] = $data['price'] ?? null; - $this->container['features'] = $data['features'] ?? null; - $this->container['measurement'] = $data['measurement'] ?? null; - $this->container['is_exceeded'] = $data['is_exceeded'] ?? null; - $this->container['is_current'] = $data['is_current'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('features', $data ?? [], null); + $this->setIfExists('measurement', $data ?? [], null); + $this->setIfExists('is_exceeded', $data ?? [], null); + $this->setIfExists('is_current', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -264,6 +353,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -288,6 +380,9 @@ public function getPrice() */ public function setPrice($price) { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } $this->container['price'] = $price; return $this; @@ -312,6 +407,9 @@ public function getFeatures() */ public function setFeatures($features) { + if (is_null($features)) { + throw new \InvalidArgumentException('non-nullable features cannot be null'); + } $this->container['features'] = $features; return $this; @@ -336,6 +434,9 @@ public function getMeasurement() */ public function setMeasurement($measurement) { + if (is_null($measurement)) { + throw new \InvalidArgumentException('non-nullable measurement cannot be null'); + } $this->container['measurement'] = $measurement; return $this; @@ -360,6 +461,9 @@ public function getIsExceeded() */ public function setIsExceeded($is_exceeded) { + if (is_null($is_exceeded)) { + throw new \InvalidArgumentException('non-nullable is_exceeded cannot be null'); + } $this->container['is_exceeded'] = $is_exceeded; return $this; @@ -384,6 +488,9 @@ public function getIsCurrent() */ public function setIsCurrent($is_current) { + if (is_null($is_current)) { + throw new \InvalidArgumentException('non-nullable is_current cannot be null'); + } $this->container['is_current'] = $is_current; return $this; @@ -395,7 +502,7 @@ public function setIsCurrent($is_current) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -407,6 +514,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -420,7 +528,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -436,7 +544,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -448,6 +556,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PortalPage.php b/lib/Model/PortalPage.php index b56b321..27b612e 100644 --- a/lib/Model/PortalPage.php +++ b/lib/Model/PortalPage.php @@ -2,7 +2,7 @@ /** * PortalPage * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -43,137 +43,139 @@ class PortalPage /** * Possible values of this enum */ - const ANALYTICS_AD_CREDITS = 'analytics-ad-credits'; + public const ANALYTICS_AD_CREDITS = 'analytics-ad-credits'; - const ANALYTICS_CLUB_MEMBERS = 'analytics-club-members'; + public const ANALYTICS_CLUB_MEMBERS = 'analytics-club-members'; - const DIGITAL_WALLET_CUSTOMER_SESSIONS = 'digital-wallet-customer-sessions'; + public const DIGITAL_WALLET_CUSTOMER_SESSIONS = 'digital-wallet-customer-sessions'; - const ANALYTICS_DYNAMIC_VOUCHERS = 'analytics-dynamic-vouchers'; + public const ANALYTICS_DYNAMIC_VOUCHERS = 'analytics-dynamic-vouchers'; - const ANALYTICS_MEMBERSHIP_TIERS = 'analytics-membership-tiers'; + public const ANALYTICS_MEMBERSHIP_TIERS = 'analytics-membership-tiers'; - const ANALYTICS_MERCHANT_CREDITS = 'analytics-merchant-credits'; + public const ANALYTICS_MERCHANT_CREDITS = 'analytics-merchant-credits'; - const ANALYTICS_STATIC_VOUCHERS = 'analytics-static-vouchers'; + public const ANALYTICS_STATIC_VOUCHERS = 'analytics-static-vouchers'; - const ANALYTICS_BROADCASTS = 'analytics-broadcasts'; + public const ANALYTICS_BROADCASTS = 'analytics-broadcasts'; - const ANALYTICS_OUTBOUND_SMS = 'analytics-outbound-sms'; + public const ANALYTICS_OUTBOUND_SMS = 'analytics-outbound-sms'; - const ANALYTICS_HELP_DESK = 'analytics-help-desk'; + public const ANALYTICS_HELP_DESK = 'analytics-help-desk'; - const ANALYTICS_TCPA = 'analytics-tcpa'; + public const ANALYTICS_TCPA = 'analytics-tcpa'; - const CALENDAR_TEAM = 'calendar-team'; + public const CALENDAR_TEAM = 'calendar-team'; - const COMMUNICATIONS_APPLE_WALLET = 'communications-apple-wallet'; + public const COMMUNICATIONS_APPLE_WALLET = 'communications-apple-wallet'; - const COMMUNICATIONS_GOOGLE_WALLET = 'communications-google-wallet'; + public const COMMUNICATIONS_GOOGLE_WALLET = 'communications-google-wallet'; - const COMMUNICATIONS_SMS_MEDIA = 'communications-sms-media'; + public const COMMUNICATIONS_SMS_MEDIA = 'communications-sms-media'; - const COMMUNICATIONS_SMS_AGREEMENT = 'communications-sms-agreement'; + public const COMMUNICATIONS_SMS_AGREEMENT = 'communications-sms-agreement'; - const COMMUNICATIONS_SMS_CREATE = 'communications-sms-create'; + public const COMMUNICATIONS_SMS_CREATE = 'communications-sms-create'; - const COMMUNICATIONS_SMS_CUSTOMER_SERVICE = 'communications-sms-customer-service'; + public const COMMUNICATIONS_SMS_CUSTOMER_SERVICE = 'communications-sms-customer-service'; - const COMMUNICATIONS_SMS_KEYWORDS = 'communications-sms-keywords'; + public const COMMUNICATIONS_SMS_KEYWORDS = 'communications-sms-keywords'; - const COMMUNICATIONS_SMS_NUMBERS = 'communications-sms-numbers'; + public const COMMUNICATIONS_SMS_NUMBERS = 'communications-sms-numbers'; - const COMMUNICATIONS_SMS_SOURCES = 'communications-sms-sources'; + public const COMMUNICATIONS_SMS_SOURCES = 'communications-sms-sources'; - const COMMUNICATIONS_SMS_SUBSCRIBERS = 'communications-sms-subscribers'; + public const COMMUNICATIONS_SMS_SUBSCRIBERS = 'communications-sms-subscribers'; - const COMMUNICATIONS_SMS_VOUCHER_CAMPAIGNS = 'communications-sms-voucher-campaigns'; + public const COMMUNICATIONS_SMS_VOUCHER_CAMPAIGNS = 'communications-sms-voucher-campaigns'; - const EMAIL_SUBSCRIBERS = 'email-subscribers'; + public const EMAIL_SUBSCRIBERS = 'email-subscribers'; - const MEMBERSHIPS_CLUB_MEMBERS = 'memberships-club-members'; + public const MEMBERSHIPS_CLUB_MEMBERS = 'memberships-club-members'; - const MEMBERSHIPS_TIERS = 'memberships-tiers'; + public const MEMBERSHIPS_TIERS = 'memberships-tiers'; - const MERCHANT_PROFILE = 'merchant-profile'; + public const MERCHANT_PROFILE = 'merchant-profile'; - const MERCHANT_URLS = 'merchant-urls'; + public const MERCHANT_URLS = 'merchant-urls'; - const POS_CONFIGURATION = 'pos-configuration'; + public const POS_CONFIGURATION = 'pos-configuration'; - const POS_LEDGER = 'pos-ledger'; + public const POS_LEDGER = 'pos-ledger'; - const POS_REGISTER_INFOGENESIS = 'pos-register-infogenesis'; + public const POS_REGISTER_INFOGENESIS = 'pos-register-infogenesis'; - const POS_REGISTER_WEB = 'pos-register-web'; + public const POS_REGISTER_WEB = 'pos-register-web'; - const SEARCH = 'search'; + public const POS_REGISTER_MOBILE = 'pos-register-mobile'; - const SETTINGS_AUTH_CHANGES = 'settings-auth-changes'; + public const SEARCH = 'search'; - const SETTINGS_COMPANY_PROFILE = 'settings-company-profile'; + public const SETTINGS_AUTH_CHANGES = 'settings-auth-changes'; - const SETTINGS_MANAGE_ROLES = 'settings-manage-roles'; + public const SETTINGS_COMPANY_PROFILE = 'settings-company-profile'; - const SETTINGS_MANAGE_USERS = 'settings-manage-users'; + public const SETTINGS_MANAGE_ROLES = 'settings-manage-roles'; - const SETTINGS_BILLING_PAYMENTS = 'settings-billing-payments'; + public const SETTINGS_MANAGE_USERS = 'settings-manage-users'; - const SETTINGS_PLATFORM_USAGE = 'settings-platform-usage'; + public const SETTINGS_BILLING_PAYMENTS = 'settings-billing-payments'; - const SETTINGS_PROFILE = 'settings-profile'; + public const SETTINGS_PLATFORM_USAGE = 'settings-platform-usage'; - const SETTINGS_PROFILE_DATA_EXPORTS = 'settings-profile-data-exports'; + public const SETTINGS_PROFILE = 'settings-profile'; - const SETTINGS_USER_ACTIVITY = 'settings-user-activity'; + public const SETTINGS_PROFILE_DATA_EXPORTS = 'settings-profile-data-exports'; - const ADVERTISEMENT_CREDIT = 'advertisement-credit'; + public const SETTINGS_USER_ACTIVITY = 'settings-user-activity'; - const PAYMENT_CONFIGURATION_DESIGN = 'payment-configuration-design'; + public const ADVERTISEMENT_CREDIT = 'advertisement-credit'; - const MERCHANT_CREDIT = 'merchant-credit'; + public const PAYMENT_CONFIGURATION_DESIGN = 'payment-configuration-design'; - const VOUCHERS_DYNAMIC = 'vouchers-dynamic'; + public const MERCHANT_CREDIT = 'merchant-credit'; - const VOUCHERS_STATIC_SINGLE = 'vouchers-static-single'; + public const VOUCHERS_DYNAMIC = 'vouchers-dynamic'; - const VOUCHERS_STATIC_SINGLE_CAMPAIGN = 'vouchers-static-single-campaign'; + public const VOUCHERS_STATIC_SINGLE = 'vouchers-static-single'; - const TICKETS = 'tickets'; + public const VOUCHERS_STATIC_SINGLE_CAMPAIGN = 'vouchers-static-single-campaign'; - const DIGITAL_WALLET_CONFIGURATION = 'digital-wallet-configuration'; + public const TICKETS = 'tickets'; - const PERFORMANCES = 'performances'; + public const DIGITAL_WALLET_CONFIGURATION = 'digital-wallet-configuration'; - const LINK_BOOK = 'link-book'; + public const PERFORMANCES = 'performances'; - const IMAGE_GRID = 'image-grid'; + public const LINK_BOOK = 'link-book'; - const VIDEOS = 'videos'; + public const IMAGE_GRID = 'image-grid'; - const LIVE_CHAT = 'live-chat'; + public const VIDEOS = 'videos'; - const PROMO_CODES = 'promo-codes'; + public const LIVE_CHAT = 'live-chat'; - const NEWS = 'news'; + public const PROMO_CODES = 'promo-codes'; - const VIRTUAL_BUSINESS_CARDS = 'virtual-business-cards'; + public const NEWS = 'news'; - const QRCODE_DESIGNS = 'qrcode-designs'; + public const VIRTUAL_BUSINESS_CARDS = 'virtual-business-cards'; - const PRODUCTS = 'products'; + public const QRCODE_DESIGNS = 'qrcode-designs'; - const SERVICES = 'services'; + public const PRODUCTS = 'products'; - const ROOM_RATES = 'room-rates'; + public const SERVICES = 'services'; - const AMENITIES = 'amenities'; + public const ROOM_RATES = 'room-rates'; - const DINING = 'dining'; + public const AMENITIES = 'amenities'; - const GAMING = 'gaming'; + public const DINING = 'dining'; - const LOUNGES = 'lounges'; + public const GAMING = 'gaming'; + + public const LOUNGES = 'lounges'; /** * Gets allowable values of the enum @@ -214,6 +216,7 @@ public static function getAllowableEnumValues() self::POS_LEDGER, self::POS_REGISTER_INFOGENESIS, self::POS_REGISTER_WEB, + self::POS_REGISTER_MOBILE, self::SEARCH, self::SETTINGS_AUTH_CHANGES, self::SETTINGS_COMPANY_PROFILE, diff --git a/lib/Model/PresignedPost.php b/lib/Model/PresignedPost.php index 32cce15..4ebd630 100644 --- a/lib/Model/PresignedPost.php +++ b/lib/Model/PresignedPost.php @@ -2,7 +2,7 @@ /** * PresignedPost * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PresignedPost implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class PresignedPost implements ModelInterface, ArrayAccess, \JsonSerializable 'fields' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'url' => false, + 'fields' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['url'] = $data['url'] ?? null; - $this->container['fields'] = $data['fields'] ?? null; + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('fields', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -237,6 +322,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } $this->container['url'] = $url; return $this; @@ -261,6 +349,9 @@ public function getFields() */ public function setFields($fields) { + if (is_null($fields)) { + throw new \InvalidArgumentException('non-nullable fields cannot be null'); + } $this->container['fields'] = $fields; return $this; @@ -272,7 +363,7 @@ public function setFields($fields) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -284,6 +375,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -297,7 +389,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -313,7 +405,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -325,6 +417,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/PresignedPostFields.php b/lib/Model/PresignedPostFields.php index 4dceceb..4ded066 100644 --- a/lib/Model/PresignedPostFields.php +++ b/lib/Model/PresignedPostFields.php @@ -2,7 +2,7 @@ /** * PresignedPostFields * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PresignedPostFields implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class PresignedPostFields implements ModelInterface, ArrayAccess, \JsonSerializa 'x_amz_signature' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'policy' => false, + 'x_amz_signature' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['policy'] = $data['policy'] ?? null; - $this->container['x_amz_signature'] = $data['x_amz_signature'] ?? null; + $this->setIfExists('policy', $data ?? [], null); + $this->setIfExists('x_amz_signature', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -237,6 +322,9 @@ public function getPolicy() */ public function setPolicy($policy) { + if (is_null($policy)) { + throw new \InvalidArgumentException('non-nullable policy cannot be null'); + } $this->container['policy'] = $policy; return $this; @@ -261,6 +349,9 @@ public function getXAmzSignature() */ public function setXAmzSignature($x_amz_signature) { + if (is_null($x_amz_signature)) { + throw new \InvalidArgumentException('non-nullable x_amz_signature cannot be null'); + } $this->container['x_amz_signature'] = $x_amz_signature; return $this; @@ -272,7 +363,7 @@ public function setXAmzSignature($x_amz_signature) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -284,6 +375,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -297,7 +389,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -313,7 +405,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -325,6 +417,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Product.php b/lib/Model/Product.php index 5d1267a..ce4539c 100644 --- a/lib/Model/Product.php +++ b/lib/Model/Product.php @@ -2,7 +2,7 @@ /** * Product * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Product implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -88,6 +86,29 @@ class Product implements ModelInterface, ArrayAccess, \JsonSerializable 'is_hourly' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'title' => false, + 'title_full' => false, + 'category' => false, + 'icon_name' => false, + 'description' => false, + 'plans' => false, + 'is_hourly' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -214,14 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['title_full'] = $data['title_full'] ?? null; - $this->container['category'] = $data['category'] ?? null; - $this->container['icon_name'] = $data['icon_name'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['plans'] = $data['plans'] ?? null; - $this->container['is_hourly'] = $data['is_hourly'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('title_full', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('icon_name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('plans', $data ?? [], null); + $this->setIfExists('is_hourly', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -288,6 +379,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -312,6 +406,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } $this->container['title'] = $title; return $this; @@ -336,6 +433,9 @@ public function getTitleFull() */ public function setTitleFull($title_full) { + if (is_null($title_full)) { + throw new \InvalidArgumentException('non-nullable title_full cannot be null'); + } $this->container['title_full'] = $title_full; return $this; @@ -360,6 +460,9 @@ public function getCategory() */ public function setCategory($category) { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } $this->container['category'] = $category; return $this; @@ -384,6 +487,9 @@ public function getIconName() */ public function setIconName($icon_name) { + if (is_null($icon_name)) { + throw new \InvalidArgumentException('non-nullable icon_name cannot be null'); + } $this->container['icon_name'] = $icon_name; return $this; @@ -408,6 +514,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } $this->container['description'] = $description; return $this; @@ -432,6 +541,9 @@ public function getPlans() */ public function setPlans($plans) { + if (is_null($plans)) { + throw new \InvalidArgumentException('non-nullable plans cannot be null'); + } $this->container['plans'] = $plans; return $this; @@ -456,6 +568,9 @@ public function getIsHourly() */ public function setIsHourly($is_hourly) { + if (is_null($is_hourly)) { + throw new \InvalidArgumentException('non-nullable is_hourly cannot be null'); + } $this->container['is_hourly'] = $is_hourly; return $this; @@ -467,7 +582,7 @@ public function setIsHourly($is_hourly) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -479,6 +594,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -492,7 +608,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -508,7 +624,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -520,6 +636,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ProfileStatuses.php b/lib/Model/ProfileStatuses.php index 76bbccb..e924198 100644 --- a/lib/Model/ProfileStatuses.php +++ b/lib/Model/ProfileStatuses.php @@ -2,7 +2,7 @@ /** * ProfileStatuses * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -43,15 +43,15 @@ class ProfileStatuses /** * Possible values of this enum */ - const DRAFT = 'draft'; + public const DRAFT = 'draft'; - const PENDING_REVIEW = 'pending-review'; + public const PENDING_REVIEW = 'pending-review'; - const IN_REVIEW = 'in-review'; + public const IN_REVIEW = 'in-review'; - const TWILIO_REJECTED = 'twilio-rejected'; + public const TWILIO_REJECTED = 'twilio-rejected'; - const TWILIO_APPROVED = 'twilio-approved'; + public const TWILIO_APPROVED = 'twilio-approved'; /** * Gets allowable values of the enum diff --git a/lib/Model/PromoCode.php b/lib/Model/PromoCode.php index 0ac81e8..93bbd1a 100644 --- a/lib/Model/PromoCode.php +++ b/lib/Model/PromoCode.php @@ -2,7 +2,7 @@ /** * PromoCode * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class PromoCode implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -68,7 +66,7 @@ class PromoCode implements ModelInterface, ArrayAccess, \JsonSerializable 'media_url' => 'string', 'start_date' => '\DateTime', 'expiration_date' => '\DateTime', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -98,6 +96,34 @@ class PromoCode implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'promo_code' => false, + 'display_value' => false, + 'order_number' => false, + 'media_url' => false, + 'start_date' => false, + 'expiration_date' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -118,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -239,19 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['promo_code'] = $data['promo_code'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['start_date'] = $data['start_date'] ?? null; - $this->container['expiration_date'] = $data['expiration_date'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('promo_code', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -365,6 +461,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling PromoCode., must be bigger than or equal to 1.'); @@ -394,6 +493,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling PromoCode., must be bigger than or equal to 1.'); @@ -423,6 +525,9 @@ public function getPromoCode() */ public function setPromoCode($promo_code) { + if (is_null($promo_code)) { + throw new \InvalidArgumentException('non-nullable promo_code cannot be null'); + } if ((mb_strlen($promo_code) < 1)) { throw new \InvalidArgumentException('invalid length for $promo_code when calling PromoCode., must be bigger than or equal to 1.'); @@ -452,6 +557,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } if ((mb_strlen($display_value) < 1)) { throw new \InvalidArgumentException('invalid length for $display_value when calling PromoCode., must be bigger than or equal to 1.'); @@ -481,6 +589,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling PromoCode., must be bigger than or equal to 1.'); @@ -510,6 +621,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -534,6 +648,9 @@ public function getStartDate() */ public function setStartDate($start_date) { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } $this->container['start_date'] = $start_date; return $this; @@ -558,6 +675,9 @@ public function getExpirationDate() */ public function setExpirationDate($expiration_date) { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } $this->container['expiration_date'] = $expiration_date; return $this; @@ -566,7 +686,7 @@ public function setExpirationDate($expiration_date) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -576,12 +696,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -606,6 +729,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -630,6 +756,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -654,6 +783,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -678,14 +810,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PromoCode., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling PromoCode., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling PromoCode., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling PromoCode., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -699,7 +834,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -711,6 +846,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -724,7 +860,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -740,7 +876,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -752,6 +888,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/QRCodeDesign.php b/lib/Model/QRCodeDesign.php index 4256a3c..fe48c68 100644 --- a/lib/Model/QRCodeDesign.php +++ b/lib/Model/QRCodeDesign.php @@ -2,7 +2,7 @@ /** * QRCodeDesign * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class QRCodeDesign implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,6 +61,7 @@ class QRCodeDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => 'string', 'size' => 'int', 'margin' => 'int', + 'is_margin_white' => 'bool', 'corner_radius' => 'int', 'color_dark_hex' => 'string', 'color_light_hex' => 'string', @@ -70,7 +69,7 @@ class QRCodeDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'logo_image_url' => 'string', 'background_image_url' => 'string', 'animated_gif_background_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -88,6 +87,7 @@ class QRCodeDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => null, 'size' => 'int32', 'margin' => 'int32', + 'is_margin_white' => null, 'corner_radius' => 'int32', 'color_dark_hex' => null, 'color_light_hex' => null, @@ -102,6 +102,37 @@ class QRCodeDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'size' => false, + 'margin' => false, + 'is_margin_white' => false, + 'corner_radius' => false, + 'color_dark_hex' => false, + 'color_light_hex' => false, + 'background_dimming_hex' => false, + 'logo_image_url' => false, + 'background_image_url' => false, + 'animated_gif_background_url' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -122,6 +153,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -132,6 +215,7 @@ public static function openAPIFormats() 'name' => 'name', 'size' => 'size', 'margin' => 'margin', + 'is_margin_white' => 'isMarginWhite', 'corner_radius' => 'cornerRadius', 'color_dark_hex' => 'colorDarkHex', 'color_light_hex' => 'colorLightHex', @@ -155,6 +239,7 @@ public static function openAPIFormats() 'name' => 'setName', 'size' => 'setSize', 'margin' => 'setMargin', + 'is_margin_white' => 'setIsMarginWhite', 'corner_radius' => 'setCornerRadius', 'color_dark_hex' => 'setColorDarkHex', 'color_light_hex' => 'setColorLightHex', @@ -178,6 +263,7 @@ public static function openAPIFormats() 'name' => 'getName', 'size' => 'getSize', 'margin' => 'getMargin', + 'is_margin_white' => 'getIsMarginWhite', 'corner_radius' => 'getCornerRadius', 'color_dark_hex' => 'getColorDarkHex', 'color_light_hex' => 'getColorLightHex', @@ -249,21 +335,40 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['size'] = $data['size'] ?? null; - $this->container['margin'] = $data['margin'] ?? null; - $this->container['corner_radius'] = $data['corner_radius'] ?? null; - $this->container['color_dark_hex'] = $data['color_dark_hex'] ?? null; - $this->container['color_light_hex'] = $data['color_light_hex'] ?? null; - $this->container['background_dimming_hex'] = $data['background_dimming_hex'] ?? null; - $this->container['logo_image_url'] = $data['logo_image_url'] ?? null; - $this->container['background_image_url'] = $data['background_image_url'] ?? null; - $this->container['animated_gif_background_url'] = $data['animated_gif_background_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('margin', $data ?? [], null); + $this->setIfExists('is_margin_white', $data ?? [], null); + $this->setIfExists('corner_radius', $data ?? [], null); + $this->setIfExists('color_dark_hex', $data ?? [], null); + $this->setIfExists('color_light_hex', $data ?? [], null); + $this->setIfExists('background_dimming_hex', $data ?? [], null); + $this->setIfExists('logo_image_url', $data ?? [], null); + $this->setIfExists('background_image_url', $data ?? [], null); + $this->setIfExists('animated_gif_background_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -296,18 +401,21 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'margin', must be bigger than or equal to 1."; } + if ($this->container['is_margin_white'] === null) { + $invalidProperties[] = "'is_margin_white' can't be null"; + } if ($this->container['corner_radius'] === null) { $invalidProperties[] = "'corner_radius' can't be null"; } - if (($this->container['corner_radius'] < 1)) { - $invalidProperties[] = "invalid value for 'corner_radius', must be bigger than or equal to 1."; + if (($this->container['corner_radius'] < 0)) { + $invalidProperties[] = "invalid value for 'corner_radius', must be bigger than or equal to 0."; } if ($this->container['color_dark_hex'] === null) { $invalidProperties[] = "'color_dark_hex' can't be null"; } - if ((mb_strlen($this->container['color_dark_hex']) < 1)) { - $invalidProperties[] = "invalid value for 'color_dark_hex', the character length must be bigger than or equal to 1."; + if ((mb_strlen($this->container['color_dark_hex']) < 0)) { + $invalidProperties[] = "invalid value for 'color_dark_hex', the character length must be bigger than or equal to 0."; } if ($this->container['color_light_hex'] === null) { @@ -324,27 +432,6 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'background_dimming_hex', the character length must be bigger than or equal to 1."; } - if ($this->container['logo_image_url'] === null) { - $invalidProperties[] = "'logo_image_url' can't be null"; - } - if ((mb_strlen($this->container['logo_image_url']) < 1)) { - $invalidProperties[] = "invalid value for 'logo_image_url', the character length must be bigger than or equal to 1."; - } - - if ($this->container['background_image_url'] === null) { - $invalidProperties[] = "'background_image_url' can't be null"; - } - if ((mb_strlen($this->container['background_image_url']) < 1)) { - $invalidProperties[] = "invalid value for 'background_image_url', the character length must be bigger than or equal to 1."; - } - - if ($this->container['animated_gif_background_url'] === null) { - $invalidProperties[] = "'animated_gif_background_url' can't be null"; - } - if ((mb_strlen($this->container['animated_gif_background_url']) < 1)) { - $invalidProperties[] = "invalid value for 'animated_gif_background_url', the character length must be bigger than or equal to 1."; - } - if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } @@ -406,6 +493,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } if ((mb_strlen($name) < 1)) { throw new \InvalidArgumentException('invalid length for $name when calling QRCodeDesign., must be bigger than or equal to 1.'); @@ -435,6 +525,9 @@ public function getSize() */ public function setSize($size) { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } if (($size < 1)) { throw new \InvalidArgumentException('invalid value for $size when calling QRCodeDesign., must be bigger than or equal to 1.'); @@ -464,6 +557,9 @@ public function getMargin() */ public function setMargin($margin) { + if (is_null($margin)) { + throw new \InvalidArgumentException('non-nullable margin cannot be null'); + } if (($margin < 1)) { throw new \InvalidArgumentException('invalid value for $margin when calling QRCodeDesign., must be bigger than or equal to 1.'); @@ -474,6 +570,33 @@ public function setMargin($margin) return $this; } + /** + * Gets is_margin_white + * + * @return bool + */ + public function getIsMarginWhite() + { + return $this->container['is_margin_white']; + } + + /** + * Sets is_margin_white + * + * @param bool $is_margin_white is_margin_white + * + * @return self + */ + public function setIsMarginWhite($is_margin_white) + { + if (is_null($is_margin_white)) { + throw new \InvalidArgumentException('non-nullable is_margin_white cannot be null'); + } + $this->container['is_margin_white'] = $is_margin_white; + + return $this; + } + /** * Gets corner_radius * @@ -493,9 +616,12 @@ public function getCornerRadius() */ public function setCornerRadius($corner_radius) { + if (is_null($corner_radius)) { + throw new \InvalidArgumentException('non-nullable corner_radius cannot be null'); + } - if (($corner_radius < 1)) { - throw new \InvalidArgumentException('invalid value for $corner_radius when calling QRCodeDesign., must be bigger than or equal to 1.'); + if (($corner_radius < 0)) { + throw new \InvalidArgumentException('invalid value for $corner_radius when calling QRCodeDesign., must be bigger than or equal to 0.'); } $this->container['corner_radius'] = $corner_radius; @@ -522,9 +648,12 @@ public function getColorDarkHex() */ public function setColorDarkHex($color_dark_hex) { + if (is_null($color_dark_hex)) { + throw new \InvalidArgumentException('non-nullable color_dark_hex cannot be null'); + } - if ((mb_strlen($color_dark_hex) < 1)) { - throw new \InvalidArgumentException('invalid length for $color_dark_hex when calling QRCodeDesign., must be bigger than or equal to 1.'); + if ((mb_strlen($color_dark_hex) < 0)) { + throw new \InvalidArgumentException('invalid length for $color_dark_hex when calling QRCodeDesign., must be bigger than or equal to 0.'); } $this->container['color_dark_hex'] = $color_dark_hex; @@ -551,6 +680,9 @@ public function getColorLightHex() */ public function setColorLightHex($color_light_hex) { + if (is_null($color_light_hex)) { + throw new \InvalidArgumentException('non-nullable color_light_hex cannot be null'); + } if ((mb_strlen($color_light_hex) < 1)) { throw new \InvalidArgumentException('invalid length for $color_light_hex when calling QRCodeDesign., must be bigger than or equal to 1.'); @@ -580,6 +712,9 @@ public function getBackgroundDimmingHex() */ public function setBackgroundDimmingHex($background_dimming_hex) { + if (is_null($background_dimming_hex)) { + throw new \InvalidArgumentException('non-nullable background_dimming_hex cannot be null'); + } if ((mb_strlen($background_dimming_hex) < 1)) { throw new \InvalidArgumentException('invalid length for $background_dimming_hex when calling QRCodeDesign., must be bigger than or equal to 1.'); @@ -593,7 +728,7 @@ public function setBackgroundDimmingHex($background_dimming_hex) /** * Gets logo_image_url * - * @return string + * @return string|null */ public function getLogoImageUrl() { @@ -603,17 +738,15 @@ public function getLogoImageUrl() /** * Sets logo_image_url * - * @param string $logo_image_url logo_image_url + * @param string|null $logo_image_url logo_image_url * * @return self */ public function setLogoImageUrl($logo_image_url) { - - if ((mb_strlen($logo_image_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $logo_image_url when calling QRCodeDesign., must be bigger than or equal to 1.'); + if (is_null($logo_image_url)) { + throw new \InvalidArgumentException('non-nullable logo_image_url cannot be null'); } - $this->container['logo_image_url'] = $logo_image_url; return $this; @@ -622,7 +755,7 @@ public function setLogoImageUrl($logo_image_url) /** * Gets background_image_url * - * @return string + * @return string|null */ public function getBackgroundImageUrl() { @@ -632,17 +765,15 @@ public function getBackgroundImageUrl() /** * Sets background_image_url * - * @param string $background_image_url background_image_url + * @param string|null $background_image_url background_image_url * * @return self */ public function setBackgroundImageUrl($background_image_url) { - - if ((mb_strlen($background_image_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $background_image_url when calling QRCodeDesign., must be bigger than or equal to 1.'); + if (is_null($background_image_url)) { + throw new \InvalidArgumentException('non-nullable background_image_url cannot be null'); } - $this->container['background_image_url'] = $background_image_url; return $this; @@ -651,7 +782,7 @@ public function setBackgroundImageUrl($background_image_url) /** * Gets animated_gif_background_url * - * @return string + * @return string|null */ public function getAnimatedGifBackgroundUrl() { @@ -661,17 +792,15 @@ public function getAnimatedGifBackgroundUrl() /** * Sets animated_gif_background_url * - * @param string $animated_gif_background_url animated_gif_background_url + * @param string|null $animated_gif_background_url animated_gif_background_url * * @return self */ public function setAnimatedGifBackgroundUrl($animated_gif_background_url) { - - if ((mb_strlen($animated_gif_background_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $animated_gif_background_url when calling QRCodeDesign., must be bigger than or equal to 1.'); + if (is_null($animated_gif_background_url)) { + throw new \InvalidArgumentException('non-nullable animated_gif_background_url cannot be null'); } - $this->container['animated_gif_background_url'] = $animated_gif_background_url; return $this; @@ -680,7 +809,7 @@ public function setAnimatedGifBackgroundUrl($animated_gif_background_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -690,12 +819,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -720,6 +852,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -744,6 +879,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -768,6 +906,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -792,14 +933,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling QRCodeDesign., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling QRCodeDesign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling QRCodeDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling QRCodeDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -813,7 +957,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -825,6 +969,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -838,7 +983,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -854,7 +999,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -866,6 +1011,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/ReachPerformanceStats.php b/lib/Model/ReachPerformanceStats.php index 3da2188..0c6f41f 100644 --- a/lib/Model/ReachPerformanceStats.php +++ b/lib/Model/ReachPerformanceStats.php @@ -2,7 +2,7 @@ /** * ReachPerformanceStats * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class ReachPerformanceStats implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -94,6 +92,32 @@ class ReachPerformanceStats implements ModelInterface, ArrayAccess, \JsonSeriali 'revenue_lost' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'sent_count' => false, + 'delivered_count' => false, + 'failed_count' => false, + 'undelivered_count' => false, + 'viewed_count' => false, + 'redemptions_count' => false, + 'value_claimed' => false, + 'revenue_generated' => false, + 'refunds_count' => false, + 'value_refunded' => false, + 'revenue_lost' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -229,17 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['sent_count'] = $data['sent_count'] ?? null; - $this->container['delivered_count'] = $data['delivered_count'] ?? null; - $this->container['failed_count'] = $data['failed_count'] ?? null; - $this->container['undelivered_count'] = $data['undelivered_count'] ?? null; - $this->container['viewed_count'] = $data['viewed_count'] ?? null; - $this->container['redemptions_count'] = $data['redemptions_count'] ?? null; - $this->container['value_claimed'] = $data['value_claimed'] ?? null; - $this->container['revenue_generated'] = $data['revenue_generated'] ?? null; - $this->container['refunds_count'] = $data['refunds_count'] ?? null; - $this->container['value_refunded'] = $data['value_refunded'] ?? null; - $this->container['revenue_lost'] = $data['revenue_lost'] ?? null; + $this->setIfExists('sent_count', $data ?? [], null); + $this->setIfExists('delivered_count', $data ?? [], null); + $this->setIfExists('failed_count', $data ?? [], null); + $this->setIfExists('undelivered_count', $data ?? [], null); + $this->setIfExists('viewed_count', $data ?? [], null); + $this->setIfExists('redemptions_count', $data ?? [], null); + $this->setIfExists('value_claimed', $data ?? [], null); + $this->setIfExists('revenue_generated', $data ?? [], null); + $this->setIfExists('refunds_count', $data ?? [], null); + $this->setIfExists('value_refunded', $data ?? [], null); + $this->setIfExists('revenue_lost', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -362,6 +456,9 @@ public function getSentCount() */ public function setSentCount($sent_count) { + if (is_null($sent_count)) { + throw new \InvalidArgumentException('non-nullable sent_count cannot be null'); + } if (($sent_count < 0)) { throw new \InvalidArgumentException('invalid value for $sent_count when calling ReachPerformanceStats., must be bigger than or equal to 0.'); @@ -391,6 +488,9 @@ public function getDeliveredCount() */ public function setDeliveredCount($delivered_count) { + if (is_null($delivered_count)) { + throw new \InvalidArgumentException('non-nullable delivered_count cannot be null'); + } if (($delivered_count < 0)) { throw new \InvalidArgumentException('invalid value for $delivered_count when calling ReachPerformanceStats., must be bigger than or equal to 0.'); @@ -420,6 +520,9 @@ public function getFailedCount() */ public function setFailedCount($failed_count) { + if (is_null($failed_count)) { + throw new \InvalidArgumentException('non-nullable failed_count cannot be null'); + } if (($failed_count < 0)) { throw new \InvalidArgumentException('invalid value for $failed_count when calling ReachPerformanceStats., must be bigger than or equal to 0.'); @@ -449,6 +552,9 @@ public function getUndeliveredCount() */ public function setUndeliveredCount($undelivered_count) { + if (is_null($undelivered_count)) { + throw new \InvalidArgumentException('non-nullable undelivered_count cannot be null'); + } if (($undelivered_count < 0)) { throw new \InvalidArgumentException('invalid value for $undelivered_count when calling ReachPerformanceStats., must be bigger than or equal to 0.'); @@ -478,6 +584,9 @@ public function getViewedCount() */ public function setViewedCount($viewed_count) { + if (is_null($viewed_count)) { + throw new \InvalidArgumentException('non-nullable viewed_count cannot be null'); + } if (($viewed_count < 0)) { throw new \InvalidArgumentException('invalid value for $viewed_count when calling ReachPerformanceStats., must be bigger than or equal to 0.'); @@ -507,6 +616,9 @@ public function getRedemptionsCount() */ public function setRedemptionsCount($redemptions_count) { + if (is_null($redemptions_count)) { + throw new \InvalidArgumentException('non-nullable redemptions_count cannot be null'); + } if (($redemptions_count < 0)) { throw new \InvalidArgumentException('invalid value for $redemptions_count when calling ReachPerformanceStats., must be bigger than or equal to 0.'); @@ -536,6 +648,9 @@ public function getValueClaimed() */ public function setValueClaimed($value_claimed) { + if (is_null($value_claimed)) { + throw new \InvalidArgumentException('non-nullable value_claimed cannot be null'); + } if (($value_claimed < 0)) { throw new \InvalidArgumentException('invalid value for $value_claimed when calling ReachPerformanceStats., must be bigger than or equal to 0.'); @@ -565,6 +680,9 @@ public function getRevenueGenerated() */ public function setRevenueGenerated($revenue_generated) { + if (is_null($revenue_generated)) { + throw new \InvalidArgumentException('non-nullable revenue_generated cannot be null'); + } if (($revenue_generated < 0)) { throw new \InvalidArgumentException('invalid value for $revenue_generated when calling ReachPerformanceStats., must be bigger than or equal to 0.'); @@ -594,6 +712,9 @@ public function getRefundsCount() */ public function setRefundsCount($refunds_count) { + if (is_null($refunds_count)) { + throw new \InvalidArgumentException('non-nullable refunds_count cannot be null'); + } if (($refunds_count < 0)) { throw new \InvalidArgumentException('invalid value for $refunds_count when calling ReachPerformanceStats., must be bigger than or equal to 0.'); @@ -623,6 +744,9 @@ public function getValueRefunded() */ public function setValueRefunded($value_refunded) { + if (is_null($value_refunded)) { + throw new \InvalidArgumentException('non-nullable value_refunded cannot be null'); + } if (($value_refunded < 0)) { throw new \InvalidArgumentException('invalid value for $value_refunded when calling ReachPerformanceStats., must be bigger than or equal to 0.'); @@ -652,6 +776,9 @@ public function getRevenueLost() */ public function setRevenueLost($revenue_lost) { + if (is_null($revenue_lost)) { + throw new \InvalidArgumentException('non-nullable revenue_lost cannot be null'); + } if (($revenue_lost < 0)) { throw new \InvalidArgumentException('invalid value for $revenue_lost when calling ReachPerformanceStats., must be bigger than or equal to 0.'); @@ -668,7 +795,7 @@ public function setRevenueLost($revenue_lost) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -680,6 +807,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -693,7 +821,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -709,7 +837,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -721,6 +849,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Request.php b/lib/Model/Request.php index c9a49a9..90a74ef 100644 --- a/lib/Model/Request.php +++ b/lib/Model/Request.php @@ -2,7 +2,7 @@ /** * Request * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Request implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,20 +61,20 @@ class Request implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', - 'auth_amount' => 'double', + 'auth_amount' => 'float', 'server_emp_id' => 'string', 'module_invoked' => 'mixed', 'cashier_emp_id' => 'string', 'routing_id' => 'string', - 'auth_account_num' => 'double', - 'more_records_count' => 'double', + 'auth_account_num' => 'float', + 'more_records_count' => 'float', 'payment_method_id' => 'string', 'tag_data' => 'mixed', - 'total_auth_amount' => 'double', + 'total_auth_amount' => 'float', 'refund_flag' => 'mixed', 'close_time' => '\DateTime', 'client_id' => 'string', - 'change_amount' => 'double', + 'change_amount' => 'float', 'employee_id' => 'string', 'training_mode_flag' => 'mixed', 'source_property_id' => 'string', @@ -88,29 +86,29 @@ class Request implements ModelInterface, ArrayAccess, \JsonSerializable 'payment_slip_id' => 'string', 'financial_bin_detail' => 'mixed', 'cvv2' => 'string', - 'employee_grat_tip' => 'double', + 'employee_grat_tip' => 'float', 'card_swipe_track1' => 'mixed', 'card_swipe_track2' => 'mixed', 'check_number' => 'string', 'more_records_key' => 'mixed', - 'tip_amount' => 'double', + 'tip_amount' => 'float', 'input_data' => 'mixed', 'profit_center_id' => 'string', 'invoice_number' => 'string', 'receipt_text_image' => 'mixed', - 'brokerage_amount' => 'double', - 'amount' => 'double', - 'cover_count' => 'double', + 'brokerage_amount' => 'float', + 'amount' => 'float', + 'cover_count' => 'float', 'more_records_flag' => 'mixed', 'account_num' => 'string', - 'max_record_count' => 'double', - 'incremental_auth_amount' => 'double', + 'max_record_count' => 'float', + 'incremental_auth_amount' => 'float', 'extra_data' => 'mixed', 'check_type_id' => 'string', 'posting_id' => 'string', 'destination_property_id' => 'string', 'account_detail' => 'mixed', - 'payment_amount' => 'double', + 'payment_amount' => 'float', 'register_id' => 'string', 'tndr_account_object' => 'mixed', 'meal_period_id' => 'string' @@ -180,6 +178,75 @@ class Request implements ModelInterface, ArrayAccess, \JsonSerializable 'meal_period_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'auth_amount' => false, + 'server_emp_id' => false, + 'module_invoked' => true, + 'cashier_emp_id' => false, + 'routing_id' => false, + 'auth_account_num' => false, + 'more_records_count' => false, + 'payment_method_id' => false, + 'tag_data' => true, + 'total_auth_amount' => false, + 'refund_flag' => true, + 'close_time' => false, + 'client_id' => false, + 'change_amount' => false, + 'employee_id' => false, + 'training_mode_flag' => true, + 'source_property_id' => false, + 'associated_check_number' => false, + 'post_to_property_id' => false, + 'unique_posting_id' => false, + 'expire_date' => false, + 'by_name_flag' => true, + 'payment_slip_id' => false, + 'financial_bin_detail' => true, + 'cvv2' => false, + 'employee_grat_tip' => false, + 'card_swipe_track1' => true, + 'card_swipe_track2' => true, + 'check_number' => false, + 'more_records_key' => true, + 'tip_amount' => false, + 'input_data' => true, + 'profit_center_id' => false, + 'invoice_number' => false, + 'receipt_text_image' => true, + 'brokerage_amount' => false, + 'amount' => false, + 'cover_count' => false, + 'more_records_flag' => true, + 'account_num' => false, + 'max_record_count' => false, + 'incremental_auth_amount' => false, + 'extra_data' => true, + 'check_type_id' => false, + 'posting_id' => false, + 'destination_property_id' => false, + 'account_detail' => true, + 'payment_amount' => false, + 'register_id' => false, + 'tndr_account_object' => true, + 'meal_period_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -200,6 +267,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -444,60 +563,78 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['auth_amount'] = $data['auth_amount'] ?? null; - $this->container['server_emp_id'] = $data['server_emp_id'] ?? null; - $this->container['module_invoked'] = $data['module_invoked'] ?? null; - $this->container['cashier_emp_id'] = $data['cashier_emp_id'] ?? null; - $this->container['routing_id'] = $data['routing_id'] ?? null; - $this->container['auth_account_num'] = $data['auth_account_num'] ?? null; - $this->container['more_records_count'] = $data['more_records_count'] ?? null; - $this->container['payment_method_id'] = $data['payment_method_id'] ?? null; - $this->container['tag_data'] = $data['tag_data'] ?? null; - $this->container['total_auth_amount'] = $data['total_auth_amount'] ?? null; - $this->container['refund_flag'] = $data['refund_flag'] ?? null; - $this->container['close_time'] = $data['close_time'] ?? null; - $this->container['client_id'] = $data['client_id'] ?? null; - $this->container['change_amount'] = $data['change_amount'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['training_mode_flag'] = $data['training_mode_flag'] ?? null; - $this->container['source_property_id'] = $data['source_property_id'] ?? null; - $this->container['associated_check_number'] = $data['associated_check_number'] ?? null; - $this->container['post_to_property_id'] = $data['post_to_property_id'] ?? null; - $this->container['unique_posting_id'] = $data['unique_posting_id'] ?? null; - $this->container['expire_date'] = $data['expire_date'] ?? null; - $this->container['by_name_flag'] = $data['by_name_flag'] ?? null; - $this->container['payment_slip_id'] = $data['payment_slip_id'] ?? null; - $this->container['financial_bin_detail'] = $data['financial_bin_detail'] ?? null; - $this->container['cvv2'] = $data['cvv2'] ?? null; - $this->container['employee_grat_tip'] = $data['employee_grat_tip'] ?? null; - $this->container['card_swipe_track1'] = $data['card_swipe_track1'] ?? null; - $this->container['card_swipe_track2'] = $data['card_swipe_track2'] ?? null; - $this->container['check_number'] = $data['check_number'] ?? null; - $this->container['more_records_key'] = $data['more_records_key'] ?? null; - $this->container['tip_amount'] = $data['tip_amount'] ?? null; - $this->container['input_data'] = $data['input_data'] ?? null; - $this->container['profit_center_id'] = $data['profit_center_id'] ?? null; - $this->container['invoice_number'] = $data['invoice_number'] ?? null; - $this->container['receipt_text_image'] = $data['receipt_text_image'] ?? null; - $this->container['brokerage_amount'] = $data['brokerage_amount'] ?? null; - $this->container['amount'] = $data['amount'] ?? null; - $this->container['cover_count'] = $data['cover_count'] ?? null; - $this->container['more_records_flag'] = $data['more_records_flag'] ?? null; - $this->container['account_num'] = $data['account_num'] ?? null; - $this->container['max_record_count'] = $data['max_record_count'] ?? null; - $this->container['incremental_auth_amount'] = $data['incremental_auth_amount'] ?? null; - $this->container['extra_data'] = $data['extra_data'] ?? null; - $this->container['check_type_id'] = $data['check_type_id'] ?? null; - $this->container['posting_id'] = $data['posting_id'] ?? null; - $this->container['destination_property_id'] = $data['destination_property_id'] ?? null; - $this->container['account_detail'] = $data['account_detail'] ?? null; - $this->container['payment_amount'] = $data['payment_amount'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['tndr_account_object'] = $data['tndr_account_object'] ?? null; - $this->container['meal_period_id'] = $data['meal_period_id'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('auth_amount', $data ?? [], null); + $this->setIfExists('server_emp_id', $data ?? [], null); + $this->setIfExists('module_invoked', $data ?? [], null); + $this->setIfExists('cashier_emp_id', $data ?? [], null); + $this->setIfExists('routing_id', $data ?? [], null); + $this->setIfExists('auth_account_num', $data ?? [], null); + $this->setIfExists('more_records_count', $data ?? [], null); + $this->setIfExists('payment_method_id', $data ?? [], null); + $this->setIfExists('tag_data', $data ?? [], null); + $this->setIfExists('total_auth_amount', $data ?? [], null); + $this->setIfExists('refund_flag', $data ?? [], null); + $this->setIfExists('close_time', $data ?? [], null); + $this->setIfExists('client_id', $data ?? [], null); + $this->setIfExists('change_amount', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('training_mode_flag', $data ?? [], null); + $this->setIfExists('source_property_id', $data ?? [], null); + $this->setIfExists('associated_check_number', $data ?? [], null); + $this->setIfExists('post_to_property_id', $data ?? [], null); + $this->setIfExists('unique_posting_id', $data ?? [], null); + $this->setIfExists('expire_date', $data ?? [], null); + $this->setIfExists('by_name_flag', $data ?? [], null); + $this->setIfExists('payment_slip_id', $data ?? [], null); + $this->setIfExists('financial_bin_detail', $data ?? [], null); + $this->setIfExists('cvv2', $data ?? [], null); + $this->setIfExists('employee_grat_tip', $data ?? [], null); + $this->setIfExists('card_swipe_track1', $data ?? [], null); + $this->setIfExists('card_swipe_track2', $data ?? [], null); + $this->setIfExists('check_number', $data ?? [], null); + $this->setIfExists('more_records_key', $data ?? [], null); + $this->setIfExists('tip_amount', $data ?? [], null); + $this->setIfExists('input_data', $data ?? [], null); + $this->setIfExists('profit_center_id', $data ?? [], null); + $this->setIfExists('invoice_number', $data ?? [], null); + $this->setIfExists('receipt_text_image', $data ?? [], null); + $this->setIfExists('brokerage_amount', $data ?? [], null); + $this->setIfExists('amount', $data ?? [], null); + $this->setIfExists('cover_count', $data ?? [], null); + $this->setIfExists('more_records_flag', $data ?? [], null); + $this->setIfExists('account_num', $data ?? [], null); + $this->setIfExists('max_record_count', $data ?? [], null); + $this->setIfExists('incremental_auth_amount', $data ?? [], null); + $this->setIfExists('extra_data', $data ?? [], null); + $this->setIfExists('check_type_id', $data ?? [], null); + $this->setIfExists('posting_id', $data ?? [], null); + $this->setIfExists('destination_property_id', $data ?? [], null); + $this->setIfExists('account_detail', $data ?? [], null); + $this->setIfExists('payment_amount', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('tndr_account_object', $data ?? [], null); + $this->setIfExists('meal_period_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -729,14 +866,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Request., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Request., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling Request., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling Request., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -763,6 +903,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -787,6 +930,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -795,7 +941,7 @@ public function setUpdatedAt($updated_at) /** * Gets auth_amount * - * @return double + * @return float */ public function getAuthAmount() { @@ -805,12 +951,15 @@ public function getAuthAmount() /** * Sets auth_amount * - * @param double $auth_amount auth_amount + * @param float $auth_amount auth_amount * * @return self */ public function setAuthAmount($auth_amount) { + if (is_null($auth_amount)) { + throw new \InvalidArgumentException('non-nullable auth_amount cannot be null'); + } $this->container['auth_amount'] = $auth_amount; return $this; @@ -835,6 +984,9 @@ public function getServerEmpId() */ public function setServerEmpId($server_emp_id) { + if (is_null($server_emp_id)) { + throw new \InvalidArgumentException('non-nullable server_emp_id cannot be null'); + } $this->container['server_emp_id'] = $server_emp_id; return $this; @@ -859,6 +1011,16 @@ public function getModuleInvoked() */ public function setModuleInvoked($module_invoked) { + if (is_null($module_invoked)) { + array_push($this->openAPINullablesSetToNull, 'module_invoked'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('module_invoked', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['module_invoked'] = $module_invoked; return $this; @@ -883,6 +1045,9 @@ public function getCashierEmpId() */ public function setCashierEmpId($cashier_emp_id) { + if (is_null($cashier_emp_id)) { + throw new \InvalidArgumentException('non-nullable cashier_emp_id cannot be null'); + } $this->container['cashier_emp_id'] = $cashier_emp_id; return $this; @@ -907,6 +1072,9 @@ public function getRoutingId() */ public function setRoutingId($routing_id) { + if (is_null($routing_id)) { + throw new \InvalidArgumentException('non-nullable routing_id cannot be null'); + } $this->container['routing_id'] = $routing_id; return $this; @@ -915,7 +1083,7 @@ public function setRoutingId($routing_id) /** * Gets auth_account_num * - * @return double + * @return float */ public function getAuthAccountNum() { @@ -925,12 +1093,15 @@ public function getAuthAccountNum() /** * Sets auth_account_num * - * @param double $auth_account_num auth_account_num + * @param float $auth_account_num auth_account_num * * @return self */ public function setAuthAccountNum($auth_account_num) { + if (is_null($auth_account_num)) { + throw new \InvalidArgumentException('non-nullable auth_account_num cannot be null'); + } $this->container['auth_account_num'] = $auth_account_num; return $this; @@ -939,7 +1110,7 @@ public function setAuthAccountNum($auth_account_num) /** * Gets more_records_count * - * @return double + * @return float */ public function getMoreRecordsCount() { @@ -949,12 +1120,15 @@ public function getMoreRecordsCount() /** * Sets more_records_count * - * @param double $more_records_count more_records_count + * @param float $more_records_count more_records_count * * @return self */ public function setMoreRecordsCount($more_records_count) { + if (is_null($more_records_count)) { + throw new \InvalidArgumentException('non-nullable more_records_count cannot be null'); + } $this->container['more_records_count'] = $more_records_count; return $this; @@ -979,6 +1153,9 @@ public function getPaymentMethodId() */ public function setPaymentMethodId($payment_method_id) { + if (is_null($payment_method_id)) { + throw new \InvalidArgumentException('non-nullable payment_method_id cannot be null'); + } $this->container['payment_method_id'] = $payment_method_id; return $this; @@ -1003,6 +1180,16 @@ public function getTagData() */ public function setTagData($tag_data) { + if (is_null($tag_data)) { + array_push($this->openAPINullablesSetToNull, 'tag_data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tag_data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['tag_data'] = $tag_data; return $this; @@ -1011,7 +1198,7 @@ public function setTagData($tag_data) /** * Gets total_auth_amount * - * @return double + * @return float */ public function getTotalAuthAmount() { @@ -1021,12 +1208,15 @@ public function getTotalAuthAmount() /** * Sets total_auth_amount * - * @param double $total_auth_amount total_auth_amount + * @param float $total_auth_amount total_auth_amount * * @return self */ public function setTotalAuthAmount($total_auth_amount) { + if (is_null($total_auth_amount)) { + throw new \InvalidArgumentException('non-nullable total_auth_amount cannot be null'); + } $this->container['total_auth_amount'] = $total_auth_amount; return $this; @@ -1051,6 +1241,16 @@ public function getRefundFlag() */ public function setRefundFlag($refund_flag) { + if (is_null($refund_flag)) { + array_push($this->openAPINullablesSetToNull, 'refund_flag'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('refund_flag', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['refund_flag'] = $refund_flag; return $this; @@ -1075,6 +1275,9 @@ public function getCloseTime() */ public function setCloseTime($close_time) { + if (is_null($close_time)) { + throw new \InvalidArgumentException('non-nullable close_time cannot be null'); + } $this->container['close_time'] = $close_time; return $this; @@ -1099,6 +1302,9 @@ public function getClientId() */ public function setClientId($client_id) { + if (is_null($client_id)) { + throw new \InvalidArgumentException('non-nullable client_id cannot be null'); + } $this->container['client_id'] = $client_id; return $this; @@ -1107,7 +1313,7 @@ public function setClientId($client_id) /** * Gets change_amount * - * @return double + * @return float */ public function getChangeAmount() { @@ -1117,12 +1323,15 @@ public function getChangeAmount() /** * Sets change_amount * - * @param double $change_amount change_amount + * @param float $change_amount change_amount * * @return self */ public function setChangeAmount($change_amount) { + if (is_null($change_amount)) { + throw new \InvalidArgumentException('non-nullable change_amount cannot be null'); + } $this->container['change_amount'] = $change_amount; return $this; @@ -1147,14 +1356,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling Request., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling Request., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling Request., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling Request., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -1181,6 +1393,16 @@ public function getTrainingModeFlag() */ public function setTrainingModeFlag($training_mode_flag) { + if (is_null($training_mode_flag)) { + array_push($this->openAPINullablesSetToNull, 'training_mode_flag'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('training_mode_flag', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['training_mode_flag'] = $training_mode_flag; return $this; @@ -1205,6 +1427,9 @@ public function getSourcePropertyId() */ public function setSourcePropertyId($source_property_id) { + if (is_null($source_property_id)) { + throw new \InvalidArgumentException('non-nullable source_property_id cannot be null'); + } $this->container['source_property_id'] = $source_property_id; return $this; @@ -1229,6 +1454,9 @@ public function getAssociatedCheckNumber() */ public function setAssociatedCheckNumber($associated_check_number) { + if (is_null($associated_check_number)) { + throw new \InvalidArgumentException('non-nullable associated_check_number cannot be null'); + } $this->container['associated_check_number'] = $associated_check_number; return $this; @@ -1253,6 +1481,9 @@ public function getPostToPropertyId() */ public function setPostToPropertyId($post_to_property_id) { + if (is_null($post_to_property_id)) { + throw new \InvalidArgumentException('non-nullable post_to_property_id cannot be null'); + } $this->container['post_to_property_id'] = $post_to_property_id; return $this; @@ -1277,6 +1508,9 @@ public function getUniquePostingId() */ public function setUniquePostingId($unique_posting_id) { + if (is_null($unique_posting_id)) { + throw new \InvalidArgumentException('non-nullable unique_posting_id cannot be null'); + } $this->container['unique_posting_id'] = $unique_posting_id; return $this; @@ -1301,6 +1535,9 @@ public function getExpireDate() */ public function setExpireDate($expire_date) { + if (is_null($expire_date)) { + throw new \InvalidArgumentException('non-nullable expire_date cannot be null'); + } $this->container['expire_date'] = $expire_date; return $this; @@ -1325,6 +1562,16 @@ public function getByNameFlag() */ public function setByNameFlag($by_name_flag) { + if (is_null($by_name_flag)) { + array_push($this->openAPINullablesSetToNull, 'by_name_flag'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('by_name_flag', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['by_name_flag'] = $by_name_flag; return $this; @@ -1349,6 +1596,9 @@ public function getPaymentSlipId() */ public function setPaymentSlipId($payment_slip_id) { + if (is_null($payment_slip_id)) { + throw new \InvalidArgumentException('non-nullable payment_slip_id cannot be null'); + } $this->container['payment_slip_id'] = $payment_slip_id; return $this; @@ -1373,6 +1623,16 @@ public function getFinancialBinDetail() */ public function setFinancialBinDetail($financial_bin_detail) { + if (is_null($financial_bin_detail)) { + array_push($this->openAPINullablesSetToNull, 'financial_bin_detail'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('financial_bin_detail', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['financial_bin_detail'] = $financial_bin_detail; return $this; @@ -1397,6 +1657,9 @@ public function getCvv2() */ public function setCvv2($cvv2) { + if (is_null($cvv2)) { + throw new \InvalidArgumentException('non-nullable cvv2 cannot be null'); + } $this->container['cvv2'] = $cvv2; return $this; @@ -1405,7 +1668,7 @@ public function setCvv2($cvv2) /** * Gets employee_grat_tip * - * @return double + * @return float */ public function getEmployeeGratTip() { @@ -1415,12 +1678,15 @@ public function getEmployeeGratTip() /** * Sets employee_grat_tip * - * @param double $employee_grat_tip employee_grat_tip + * @param float $employee_grat_tip employee_grat_tip * * @return self */ public function setEmployeeGratTip($employee_grat_tip) { + if (is_null($employee_grat_tip)) { + throw new \InvalidArgumentException('non-nullable employee_grat_tip cannot be null'); + } $this->container['employee_grat_tip'] = $employee_grat_tip; return $this; @@ -1445,6 +1711,16 @@ public function getCardSwipeTrack1() */ public function setCardSwipeTrack1($card_swipe_track1) { + if (is_null($card_swipe_track1)) { + array_push($this->openAPINullablesSetToNull, 'card_swipe_track1'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('card_swipe_track1', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['card_swipe_track1'] = $card_swipe_track1; return $this; @@ -1469,6 +1745,16 @@ public function getCardSwipeTrack2() */ public function setCardSwipeTrack2($card_swipe_track2) { + if (is_null($card_swipe_track2)) { + array_push($this->openAPINullablesSetToNull, 'card_swipe_track2'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('card_swipe_track2', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['card_swipe_track2'] = $card_swipe_track2; return $this; @@ -1493,6 +1779,9 @@ public function getCheckNumber() */ public function setCheckNumber($check_number) { + if (is_null($check_number)) { + throw new \InvalidArgumentException('non-nullable check_number cannot be null'); + } $this->container['check_number'] = $check_number; return $this; @@ -1517,6 +1806,16 @@ public function getMoreRecordsKey() */ public function setMoreRecordsKey($more_records_key) { + if (is_null($more_records_key)) { + array_push($this->openAPINullablesSetToNull, 'more_records_key'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('more_records_key', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['more_records_key'] = $more_records_key; return $this; @@ -1525,7 +1824,7 @@ public function setMoreRecordsKey($more_records_key) /** * Gets tip_amount * - * @return double + * @return float */ public function getTipAmount() { @@ -1535,12 +1834,15 @@ public function getTipAmount() /** * Sets tip_amount * - * @param double $tip_amount tip_amount + * @param float $tip_amount tip_amount * * @return self */ public function setTipAmount($tip_amount) { + if (is_null($tip_amount)) { + throw new \InvalidArgumentException('non-nullable tip_amount cannot be null'); + } $this->container['tip_amount'] = $tip_amount; return $this; @@ -1565,6 +1867,16 @@ public function getInputData() */ public function setInputData($input_data) { + if (is_null($input_data)) { + array_push($this->openAPINullablesSetToNull, 'input_data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('input_data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['input_data'] = $input_data; return $this; @@ -1589,6 +1901,9 @@ public function getProfitCenterId() */ public function setProfitCenterId($profit_center_id) { + if (is_null($profit_center_id)) { + throw new \InvalidArgumentException('non-nullable profit_center_id cannot be null'); + } $this->container['profit_center_id'] = $profit_center_id; return $this; @@ -1613,6 +1928,9 @@ public function getInvoiceNumber() */ public function setInvoiceNumber($invoice_number) { + if (is_null($invoice_number)) { + throw new \InvalidArgumentException('non-nullable invoice_number cannot be null'); + } $this->container['invoice_number'] = $invoice_number; return $this; @@ -1637,6 +1955,16 @@ public function getReceiptTextImage() */ public function setReceiptTextImage($receipt_text_image) { + if (is_null($receipt_text_image)) { + array_push($this->openAPINullablesSetToNull, 'receipt_text_image'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('receipt_text_image', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['receipt_text_image'] = $receipt_text_image; return $this; @@ -1645,7 +1973,7 @@ public function setReceiptTextImage($receipt_text_image) /** * Gets brokerage_amount * - * @return double + * @return float */ public function getBrokerageAmount() { @@ -1655,12 +1983,15 @@ public function getBrokerageAmount() /** * Sets brokerage_amount * - * @param double $brokerage_amount brokerage_amount + * @param float $brokerage_amount brokerage_amount * * @return self */ public function setBrokerageAmount($brokerage_amount) { + if (is_null($brokerage_amount)) { + throw new \InvalidArgumentException('non-nullable brokerage_amount cannot be null'); + } $this->container['brokerage_amount'] = $brokerage_amount; return $this; @@ -1669,7 +2000,7 @@ public function setBrokerageAmount($brokerage_amount) /** * Gets amount * - * @return double + * @return float */ public function getAmount() { @@ -1679,12 +2010,15 @@ public function getAmount() /** * Sets amount * - * @param double $amount amount + * @param float $amount amount * * @return self */ public function setAmount($amount) { + if (is_null($amount)) { + throw new \InvalidArgumentException('non-nullable amount cannot be null'); + } $this->container['amount'] = $amount; return $this; @@ -1693,7 +2027,7 @@ public function setAmount($amount) /** * Gets cover_count * - * @return double + * @return float */ public function getCoverCount() { @@ -1703,12 +2037,15 @@ public function getCoverCount() /** * Sets cover_count * - * @param double $cover_count cover_count + * @param float $cover_count cover_count * * @return self */ public function setCoverCount($cover_count) { + if (is_null($cover_count)) { + throw new \InvalidArgumentException('non-nullable cover_count cannot be null'); + } $this->container['cover_count'] = $cover_count; return $this; @@ -1733,6 +2070,16 @@ public function getMoreRecordsFlag() */ public function setMoreRecordsFlag($more_records_flag) { + if (is_null($more_records_flag)) { + array_push($this->openAPINullablesSetToNull, 'more_records_flag'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('more_records_flag', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['more_records_flag'] = $more_records_flag; return $this; @@ -1757,6 +2104,9 @@ public function getAccountNum() */ public function setAccountNum($account_num) { + if (is_null($account_num)) { + throw new \InvalidArgumentException('non-nullable account_num cannot be null'); + } $this->container['account_num'] = $account_num; return $this; @@ -1765,7 +2115,7 @@ public function setAccountNum($account_num) /** * Gets max_record_count * - * @return double + * @return float */ public function getMaxRecordCount() { @@ -1775,12 +2125,15 @@ public function getMaxRecordCount() /** * Sets max_record_count * - * @param double $max_record_count max_record_count + * @param float $max_record_count max_record_count * * @return self */ public function setMaxRecordCount($max_record_count) { + if (is_null($max_record_count)) { + throw new \InvalidArgumentException('non-nullable max_record_count cannot be null'); + } $this->container['max_record_count'] = $max_record_count; return $this; @@ -1789,7 +2142,7 @@ public function setMaxRecordCount($max_record_count) /** * Gets incremental_auth_amount * - * @return double + * @return float */ public function getIncrementalAuthAmount() { @@ -1799,12 +2152,15 @@ public function getIncrementalAuthAmount() /** * Sets incremental_auth_amount * - * @param double $incremental_auth_amount incremental_auth_amount + * @param float $incremental_auth_amount incremental_auth_amount * * @return self */ public function setIncrementalAuthAmount($incremental_auth_amount) { + if (is_null($incremental_auth_amount)) { + throw new \InvalidArgumentException('non-nullable incremental_auth_amount cannot be null'); + } $this->container['incremental_auth_amount'] = $incremental_auth_amount; return $this; @@ -1829,6 +2185,16 @@ public function getExtraData() */ public function setExtraData($extra_data) { + if (is_null($extra_data)) { + array_push($this->openAPINullablesSetToNull, 'extra_data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('extra_data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['extra_data'] = $extra_data; return $this; @@ -1853,6 +2219,9 @@ public function getCheckTypeId() */ public function setCheckTypeId($check_type_id) { + if (is_null($check_type_id)) { + throw new \InvalidArgumentException('non-nullable check_type_id cannot be null'); + } $this->container['check_type_id'] = $check_type_id; return $this; @@ -1877,6 +2246,9 @@ public function getPostingId() */ public function setPostingId($posting_id) { + if (is_null($posting_id)) { + throw new \InvalidArgumentException('non-nullable posting_id cannot be null'); + } $this->container['posting_id'] = $posting_id; return $this; @@ -1901,6 +2273,9 @@ public function getDestinationPropertyId() */ public function setDestinationPropertyId($destination_property_id) { + if (is_null($destination_property_id)) { + throw new \InvalidArgumentException('non-nullable destination_property_id cannot be null'); + } $this->container['destination_property_id'] = $destination_property_id; return $this; @@ -1925,6 +2300,16 @@ public function getAccountDetail() */ public function setAccountDetail($account_detail) { + if (is_null($account_detail)) { + array_push($this->openAPINullablesSetToNull, 'account_detail'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('account_detail', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['account_detail'] = $account_detail; return $this; @@ -1933,7 +2318,7 @@ public function setAccountDetail($account_detail) /** * Gets payment_amount * - * @return double + * @return float */ public function getPaymentAmount() { @@ -1943,12 +2328,15 @@ public function getPaymentAmount() /** * Sets payment_amount * - * @param double $payment_amount payment_amount + * @param float $payment_amount payment_amount * * @return self */ public function setPaymentAmount($payment_amount) { + if (is_null($payment_amount)) { + throw new \InvalidArgumentException('non-nullable payment_amount cannot be null'); + } $this->container['payment_amount'] = $payment_amount; return $this; @@ -1973,6 +2361,9 @@ public function getRegisterId() */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -1997,6 +2388,16 @@ public function getTndrAccountObject() */ public function setTndrAccountObject($tndr_account_object) { + if (is_null($tndr_account_object)) { + array_push($this->openAPINullablesSetToNull, 'tndr_account_object'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('tndr_account_object', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['tndr_account_object'] = $tndr_account_object; return $this; @@ -2021,6 +2422,9 @@ public function getMealPeriodId() */ public function setMealPeriodId($meal_period_id) { + if (is_null($meal_period_id)) { + throw new \InvalidArgumentException('non-nullable meal_period_id cannot be null'); + } $this->container['meal_period_id'] = $meal_period_id; return $this; @@ -2032,7 +2436,7 @@ public function setMealPeriodId($meal_period_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -2044,6 +2448,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -2057,7 +2462,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -2073,7 +2478,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -2085,6 +2490,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Response.php b/lib/Model/Response.php index 3be2c51..f80b485 100644 --- a/lib/Model/Response.php +++ b/lib/Model/Response.php @@ -2,7 +2,7 @@ /** * Response * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Response implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -86,6 +84,28 @@ class Response implements ModelInterface, ArrayAccess, \JsonSerializable 'destination_property_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'routing_id' => false, + 'xml_output' => false, + 'has_error' => false, + 'destination_property_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +126,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -209,13 +281,31 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['routing_id'] = $data['routing_id'] ?? null; - $this->container['xml_output'] = $data['xml_output'] ?? null; - $this->container['has_error'] = $data['has_error'] ?? null; - $this->container['destination_property_id'] = $data['destination_property_id'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('routing_id', $data ?? [], null); + $this->setIfExists('xml_output', $data ?? [], null); + $this->setIfExists('has_error', $data ?? [], null); + $this->setIfExists('destination_property_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -294,14 +384,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Response., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Response., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling Response., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling Response., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -328,6 +421,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -352,6 +448,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -376,6 +475,9 @@ public function getRoutingId() */ public function setRoutingId($routing_id) { + if (is_null($routing_id)) { + throw new \InvalidArgumentException('non-nullable routing_id cannot be null'); + } $this->container['routing_id'] = $routing_id; return $this; @@ -400,6 +502,9 @@ public function getXmlOutput() */ public function setXmlOutput($xml_output) { + if (is_null($xml_output)) { + throw new \InvalidArgumentException('non-nullable xml_output cannot be null'); + } $this->container['xml_output'] = $xml_output; return $this; @@ -424,6 +529,9 @@ public function getHasError() */ public function setHasError($has_error) { + if (is_null($has_error)) { + throw new \InvalidArgumentException('non-nullable has_error cannot be null'); + } $this->container['has_error'] = $has_error; return $this; @@ -448,6 +556,9 @@ public function getDestinationPropertyId() */ public function setDestinationPropertyId($destination_property_id) { + if (is_null($destination_property_id)) { + throw new \InvalidArgumentException('non-nullable destination_property_id cannot be null'); + } $this->container['destination_property_id'] = $destination_property_id; return $this; @@ -459,7 +570,7 @@ public function setDestinationPropertyId($destination_property_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -471,6 +582,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -484,7 +596,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -500,7 +612,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -512,6 +624,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Role.php b/lib/Model/Role.php index 2d9c82b..631ca64 100644 --- a/lib/Model/Role.php +++ b/lib/Model/Role.php @@ -2,7 +2,7 @@ /** * Role * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Role implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -70,7 +68,7 @@ class Role implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => 'string', 'display_name' => 'string', 'is_public' => 'bool', - 'order_number' => 'double', + 'order_number' => 'float', 'is_system' => 'bool', 'icons' => 'string[]', 'category' => 'string', @@ -102,6 +100,36 @@ class Role implements ModelInterface, ArrayAccess, \JsonSerializable 'admin_page' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'employees' => false, + 'roles' => false, + 'employee_id' => false, + 'merchant_id' => false, + 'name' => false, + 'display_name' => false, + 'is_public' => false, + 'order_number' => false, + 'is_system' => false, + 'icons' => false, + 'category' => false, + 'admin_page' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -122,6 +150,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -249,21 +329,39 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['employees'] = $data['employees'] ?? null; - $this->container['roles'] = $data['roles'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['display_name'] = $data['display_name'] ?? null; - $this->container['is_public'] = $data['is_public'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['is_system'] = $data['is_system'] ?? null; - $this->container['icons'] = $data['icons'] ?? null; - $this->container['category'] = $data['category'] ?? null; - $this->container['admin_page'] = $data['admin_page'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('employees', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('is_public', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('is_system', $data ?? [], null); + $this->setIfExists('icons', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('admin_page', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -390,14 +488,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Role., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Role., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling Role., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling Role., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -424,6 +525,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -448,6 +552,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -472,6 +579,9 @@ public function getEmployees() */ public function setEmployees($employees) { + if (is_null($employees)) { + throw new \InvalidArgumentException('non-nullable employees cannot be null'); + } $this->container['employees'] = $employees; return $this; @@ -496,6 +606,9 @@ public function getRoles() */ public function setRoles($roles) { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } $this->container['roles'] = $roles; return $this; @@ -520,14 +633,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling Role., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling Role., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling Role., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling Role., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -554,14 +670,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Role., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Role., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Role., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Role., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -588,6 +707,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -612,6 +734,9 @@ public function getDisplayName() */ public function setDisplayName($display_name) { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } $this->container['display_name'] = $display_name; return $this; @@ -636,6 +761,9 @@ public function getIsPublic() */ public function setIsPublic($is_public) { + if (is_null($is_public)) { + throw new \InvalidArgumentException('non-nullable is_public cannot be null'); + } $this->container['is_public'] = $is_public; return $this; @@ -644,7 +772,7 @@ public function setIsPublic($is_public) /** * Gets order_number * - * @return double + * @return float */ public function getOrderNumber() { @@ -654,12 +782,15 @@ public function getOrderNumber() /** * Sets order_number * - * @param double $order_number order_number + * @param float $order_number order_number * * @return self */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } $this->container['order_number'] = $order_number; return $this; @@ -684,6 +815,9 @@ public function getIsSystem() */ public function setIsSystem($is_system) { + if (is_null($is_system)) { + throw new \InvalidArgumentException('non-nullable is_system cannot be null'); + } $this->container['is_system'] = $is_system; return $this; @@ -708,6 +842,9 @@ public function getIcons() */ public function setIcons($icons) { + if (is_null($icons)) { + throw new \InvalidArgumentException('non-nullable icons cannot be null'); + } $this->container['icons'] = $icons; return $this; @@ -732,6 +869,9 @@ public function getCategory() */ public function setCategory($category) { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } $this->container['category'] = $category; return $this; @@ -756,6 +896,9 @@ public function getAdminPage() */ public function setAdminPage($admin_page) { + if (is_null($admin_page)) { + throw new \InvalidArgumentException('non-nullable admin_page cannot be null'); + } $this->container['admin_page'] = $admin_page; return $this; @@ -767,7 +910,7 @@ public function setAdminPage($admin_page) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -779,6 +922,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -792,7 +936,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -808,7 +952,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -820,6 +964,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/RoleAuditLog.php b/lib/Model/RoleAuditLog.php index d41ef9e..8b68dc1 100644 --- a/lib/Model/RoleAuditLog.php +++ b/lib/Model/RoleAuditLog.php @@ -2,7 +2,7 @@ /** * RoleAuditLog * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class RoleAuditLog implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -96,6 +94,33 @@ class RoleAuditLog implements ModelInterface, ArrayAccess, \JsonSerializable 'is_system' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'role_name' => false, + 'action' => false, + 'merchant_id' => false, + 'action_by_employee_id' => false, + 'action_by_employee_name' => false, + 'action_on_employee_id' => false, + 'action_on_employee_name' => false, + 'display_name' => false, + 'is_system' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -116,6 +141,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -234,18 +311,36 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['role_name'] = $data['role_name'] ?? null; - $this->container['action'] = $data['action'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['action_by_employee_id'] = $data['action_by_employee_id'] ?? null; - $this->container['action_by_employee_name'] = $data['action_by_employee_name'] ?? null; - $this->container['action_on_employee_id'] = $data['action_on_employee_id'] ?? null; - $this->container['action_on_employee_name'] = $data['action_on_employee_name'] ?? null; - $this->container['display_name'] = $data['display_name'] ?? null; - $this->container['is_system'] = $data['is_system'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('role_name', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('action_by_employee_id', $data ?? [], null); + $this->setIfExists('action_by_employee_name', $data ?? [], null); + $this->setIfExists('action_on_employee_id', $data ?? [], null); + $this->setIfExists('action_on_employee_name', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('is_system', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -375,14 +470,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling RoleAuditLog., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling RoleAuditLog., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling RoleAuditLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling RoleAuditLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -409,6 +507,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -433,6 +534,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -457,6 +561,9 @@ public function getRoleName() */ public function setRoleName($role_name) { + if (is_null($role_name)) { + throw new \InvalidArgumentException('non-nullable role_name cannot be null'); + } $this->container['role_name'] = $role_name; return $this; @@ -481,6 +588,9 @@ public function getAction() */ public function setAction($action) { + if (is_null($action)) { + throw new \InvalidArgumentException('non-nullable action cannot be null'); + } $this->container['action'] = $action; return $this; @@ -505,14 +615,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling RoleAuditLog., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling RoleAuditLog., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling RoleAuditLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling RoleAuditLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -539,14 +652,17 @@ public function getActionByEmployeeId() */ public function setActionByEmployeeId($action_by_employee_id) { + if (is_null($action_by_employee_id)) { + throw new \InvalidArgumentException('non-nullable action_by_employee_id cannot be null'); + } if ((mb_strlen($action_by_employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $action_by_employee_id when calling RoleAuditLog., must be smaller than or equal to 10.'); } if ((mb_strlen($action_by_employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $action_by_employee_id when calling RoleAuditLog., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $action_by_employee_id))) { - throw new \InvalidArgumentException("invalid value for $action_by_employee_id when calling RoleAuditLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($action_by_employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$action_by_employee_id when calling RoleAuditLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['action_by_employee_id'] = $action_by_employee_id; @@ -573,6 +689,9 @@ public function getActionByEmployeeName() */ public function setActionByEmployeeName($action_by_employee_name) { + if (is_null($action_by_employee_name)) { + throw new \InvalidArgumentException('non-nullable action_by_employee_name cannot be null'); + } $this->container['action_by_employee_name'] = $action_by_employee_name; return $this; @@ -597,14 +716,17 @@ public function getActionOnEmployeeId() */ public function setActionOnEmployeeId($action_on_employee_id) { + if (is_null($action_on_employee_id)) { + throw new \InvalidArgumentException('non-nullable action_on_employee_id cannot be null'); + } if ((mb_strlen($action_on_employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $action_on_employee_id when calling RoleAuditLog., must be smaller than or equal to 10.'); } if ((mb_strlen($action_on_employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $action_on_employee_id when calling RoleAuditLog., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $action_on_employee_id))) { - throw new \InvalidArgumentException("invalid value for $action_on_employee_id when calling RoleAuditLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($action_on_employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$action_on_employee_id when calling RoleAuditLog., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['action_on_employee_id'] = $action_on_employee_id; @@ -631,6 +753,9 @@ public function getActionOnEmployeeName() */ public function setActionOnEmployeeName($action_on_employee_name) { + if (is_null($action_on_employee_name)) { + throw new \InvalidArgumentException('non-nullable action_on_employee_name cannot be null'); + } $this->container['action_on_employee_name'] = $action_on_employee_name; return $this; @@ -655,6 +780,9 @@ public function getDisplayName() */ public function setDisplayName($display_name) { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } $this->container['display_name'] = $display_name; return $this; @@ -679,6 +807,9 @@ public function getIsSystem() */ public function setIsSystem($is_system) { + if (is_null($is_system)) { + throw new \InvalidArgumentException('non-nullable is_system cannot be null'); + } $this->container['is_system'] = $is_system; return $this; @@ -690,7 +821,7 @@ public function setIsSystem($is_system) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -702,6 +833,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -715,7 +847,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -731,7 +863,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -743,6 +875,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/RoomRate.php b/lib/Model/RoomRate.php index 10a872b..b4ad02e 100644 --- a/lib/Model/RoomRate.php +++ b/lib/Model/RoomRate.php @@ -2,7 +2,7 @@ /** * RoomRate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class RoomRate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -66,7 +64,7 @@ class RoomRate implements ModelInterface, ArrayAccess, \JsonSerializable 'order_number' => 'int', 'media_url' => 'string', 'additional_info_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -94,6 +92,32 @@ class RoomRate implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -229,17 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -333,6 +427,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling RoomRate., must be bigger than or equal to 1.'); @@ -362,6 +459,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling RoomRate., must be bigger than or equal to 1.'); @@ -391,6 +491,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -415,6 +518,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling RoomRate., must be bigger than or equal to 1.'); @@ -444,6 +550,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -468,6 +577,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -476,7 +588,7 @@ public function setAdditionalInfoUrl($additional_info_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -486,12 +598,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -516,6 +631,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -540,6 +658,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -564,6 +685,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -588,14 +712,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling RoomRate., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling RoomRate., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling RoomRate., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling RoomRate., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -609,7 +736,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -621,6 +748,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -634,7 +762,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -650,7 +778,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -662,6 +790,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/SSImportedListRecipientCreateParams.php b/lib/Model/SSImportedListRecipientCreateParams.php index 09ee246..bf71aaa 100644 --- a/lib/Model/SSImportedListRecipientCreateParams.php +++ b/lib/Model/SSImportedListRecipientCreateParams.php @@ -2,7 +2,7 @@ /** * SSImportedListRecipientCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SSImportedListRecipientCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class SSImportedListRecipientCreateParams implements ModelInterface, ArrayAccess 'mobile_phone_number' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'imported_list_id' => false, + 'mobile_phone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['imported_list_id'] = $data['imported_list_id'] ?? null; - $this->container['mobile_phone_number'] = $data['mobile_phone_number'] ?? null; + $this->setIfExists('imported_list_id', $data ?? [], null); + $this->setIfExists('mobile_phone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -249,14 +334,17 @@ public function getImportedListId() */ public function setImportedListId($imported_list_id) { + if (is_null($imported_list_id)) { + throw new \InvalidArgumentException('non-nullable imported_list_id cannot be null'); + } if ((mb_strlen($imported_list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $imported_list_id when calling SSImportedListRecipientCreateParams., must be smaller than or equal to 10.'); } if ((mb_strlen($imported_list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $imported_list_id when calling SSImportedListRecipientCreateParams., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $imported_list_id))) { - throw new \InvalidArgumentException("invalid value for $imported_list_id when calling SSImportedListRecipientCreateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($imported_list_id)))) { + throw new \InvalidArgumentException("invalid value for \$imported_list_id when calling SSImportedListRecipientCreateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['imported_list_id'] = $imported_list_id; @@ -283,6 +371,9 @@ public function getMobilePhoneNumber() */ public function setMobilePhoneNumber($mobile_phone_number) { + if (is_null($mobile_phone_number)) { + throw new \InvalidArgumentException('non-nullable mobile_phone_number cannot be null'); + } $this->container['mobile_phone_number'] = $mobile_phone_number; return $this; @@ -294,7 +385,7 @@ public function setMobilePhoneNumber($mobile_phone_number) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -306,6 +397,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -319,7 +411,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -335,7 +427,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -347,6 +439,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/SSOptInSource.php b/lib/Model/SSOptInSource.php index 7c0c9ae..d044680 100644 --- a/lib/Model/SSOptInSource.php +++ b/lib/Model/SSOptInSource.php @@ -2,7 +2,7 @@ /** * SSOptInSource * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SSOptInSource implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -88,6 +86,29 @@ class SSOptInSource implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'list_id' => false, + 'source_name' => false, + 'employee_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -214,14 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['list_id'] = $data['list_id'] ?? null; - $this->container['source_name'] = $data['source_name'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('source_name', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -335,6 +426,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling SSOptInSource., must be smaller than or equal to 10.'); } @@ -366,14 +460,17 @@ public function getListId() */ public function setListId($list_id) { + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + } if ((mb_strlen($list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling SSOptInSource., must be smaller than or equal to 10.'); } if ((mb_strlen($list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling SSOptInSource., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $list_id))) { - throw new \InvalidArgumentException("invalid value for $list_id when calling SSOptInSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($list_id)))) { + throw new \InvalidArgumentException("invalid value for \$list_id when calling SSOptInSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['list_id'] = $list_id; @@ -400,6 +497,9 @@ public function getSourceName() */ public function setSourceName($source_name) { + if (is_null($source_name)) { + throw new \InvalidArgumentException('non-nullable source_name cannot be null'); + } $this->container['source_name'] = $source_name; return $this; @@ -424,14 +524,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling SSOptInSource., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling SSOptInSource., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling SSOptInSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling SSOptInSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -458,14 +561,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling SSOptInSource., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling SSOptInSource., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling SSOptInSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling SSOptInSource., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -492,6 +598,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -516,6 +625,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -540,6 +652,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -551,7 +666,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -563,6 +678,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -576,7 +692,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -592,7 +708,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -604,6 +720,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/SSOutboundStatuses.php b/lib/Model/SSOutboundStatuses.php index 8065d76..8a7bca2 100644 --- a/lib/Model/SSOutboundStatuses.php +++ b/lib/Model/SSOutboundStatuses.php @@ -2,7 +2,7 @@ /** * SSOutboundStatuses * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SSOutboundStatuses implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class SSOutboundStatuses implements ModelInterface, ArrayAccess, \JsonSerializab ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -181,6 +247,24 @@ public function __construct(array $data = null) { } + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + /** * Show all the invalid properties with reasons. * @@ -211,7 +295,7 @@ public function valid() * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -223,6 +307,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -236,7 +321,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -252,7 +337,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -264,6 +349,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/SaveMerchantCreditPaymentDesignRequest.php b/lib/Model/SaveMerchantCreditPaymentDesignRequest.php new file mode 100644 index 0000000..ef81f66 --- /dev/null +++ b/lib/Model/SaveMerchantCreditPaymentDesignRequest.php @@ -0,0 +1,435 @@ + + */ +class SaveMerchantCreditPaymentDesignRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'saveMerchantCreditPaymentDesign_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payment_design_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payment_design_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'payment_design_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payment_design_id' => 'paymentDesignID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payment_design_id' => 'setPaymentDesignId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payment_design_id' => 'getPaymentDesignId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('payment_design_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['payment_design_id'] === null) { + $invalidProperties[] = "'payment_design_id' can't be null"; + } + if ((mb_strlen($this->container['payment_design_id']) > 10)) { + $invalidProperties[] = "invalid value for 'payment_design_id', the character length must be smaller than or equal to 10."; + } + + if ((mb_strlen($this->container['payment_design_id']) < 10)) { + $invalidProperties[] = "invalid value for 'payment_design_id', the character length must be bigger than or equal to 10."; + } + + if (!preg_match("/^[a-zA-Z0-9]+$/", $this->container['payment_design_id'])) { + $invalidProperties[] = "invalid value for 'payment_design_id', must be conform to the pattern /^[a-zA-Z0-9]+$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payment_design_id + * + * @return string + */ + public function getPaymentDesignId() + { + return $this->container['payment_design_id']; + } + + /** + * Sets payment_design_id + * + * @param string $payment_design_id payment_design_id + * + * @return self + */ + public function setPaymentDesignId($payment_design_id) + { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } + if ((mb_strlen($payment_design_id) > 10)) { + throw new \InvalidArgumentException('invalid length for $payment_design_id when calling SaveMerchantCreditPaymentDesignRequest., must be smaller than or equal to 10.'); + } + if ((mb_strlen($payment_design_id) < 10)) { + throw new \InvalidArgumentException('invalid length for $payment_design_id when calling SaveMerchantCreditPaymentDesignRequest., must be bigger than or equal to 10.'); + } + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling SaveMerchantCreditPaymentDesignRequest., must conform to the pattern /^[a-zA-Z0-9]+$/."); + } + + $this->container['payment_design_id'] = $payment_design_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SaveTicketSettingsRequest.php b/lib/Model/SaveTicketSettingsRequest.php new file mode 100644 index 0000000..60d080a --- /dev/null +++ b/lib/Model/SaveTicketSettingsRequest.php @@ -0,0 +1,521 @@ + + */ +class SaveTicketSettingsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'saveTicketSettings_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'redemption_instructions' => 'string', + 'ticket_expiration_date_time' => '\DateTime', + 'max_comp_tickets' => 'float', + 'payment_design_id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'redemption_instructions' => null, + 'ticket_expiration_date_time' => 'date-time', + 'max_comp_tickets' => 'double', + 'payment_design_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'redemption_instructions' => false, + 'ticket_expiration_date_time' => false, + 'max_comp_tickets' => false, + 'payment_design_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'redemption_instructions' => 'redemptionInstructions', + 'ticket_expiration_date_time' => 'ticketExpirationDateTime', + 'max_comp_tickets' => 'maxCompTickets', + 'payment_design_id' => 'paymentDesignID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'redemption_instructions' => 'setRedemptionInstructions', + 'ticket_expiration_date_time' => 'setTicketExpirationDateTime', + 'max_comp_tickets' => 'setMaxCompTickets', + 'payment_design_id' => 'setPaymentDesignId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'redemption_instructions' => 'getRedemptionInstructions', + 'ticket_expiration_date_time' => 'getTicketExpirationDateTime', + 'max_comp_tickets' => 'getMaxCompTickets', + 'payment_design_id' => 'getPaymentDesignId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('redemption_instructions', $data ?? [], null); + $this->setIfExists('ticket_expiration_date_time', $data ?? [], null); + $this->setIfExists('max_comp_tickets', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['ticket_expiration_date_time'] === null) { + $invalidProperties[] = "'ticket_expiration_date_time' can't be null"; + } + if ($this->container['max_comp_tickets'] === null) { + $invalidProperties[] = "'max_comp_tickets' can't be null"; + } + if ($this->container['payment_design_id'] === null) { + $invalidProperties[] = "'payment_design_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets redemption_instructions + * + * @return string|null + */ + public function getRedemptionInstructions() + { + return $this->container['redemption_instructions']; + } + + /** + * Sets redemption_instructions + * + * @param string|null $redemption_instructions redemption_instructions + * + * @return self + */ + public function setRedemptionInstructions($redemption_instructions) + { + if (is_null($redemption_instructions)) { + throw new \InvalidArgumentException('non-nullable redemption_instructions cannot be null'); + } + $this->container['redemption_instructions'] = $redemption_instructions; + + return $this; + } + + /** + * Gets ticket_expiration_date_time + * + * @return \DateTime + */ + public function getTicketExpirationDateTime() + { + return $this->container['ticket_expiration_date_time']; + } + + /** + * Sets ticket_expiration_date_time + * + * @param \DateTime $ticket_expiration_date_time ticket_expiration_date_time + * + * @return self + */ + public function setTicketExpirationDateTime($ticket_expiration_date_time) + { + if (is_null($ticket_expiration_date_time)) { + throw new \InvalidArgumentException('non-nullable ticket_expiration_date_time cannot be null'); + } + $this->container['ticket_expiration_date_time'] = $ticket_expiration_date_time; + + return $this; + } + + /** + * Gets max_comp_tickets + * + * @return float + */ + public function getMaxCompTickets() + { + return $this->container['max_comp_tickets']; + } + + /** + * Sets max_comp_tickets + * + * @param float $max_comp_tickets max_comp_tickets + * + * @return self + */ + public function setMaxCompTickets($max_comp_tickets) + { + if (is_null($max_comp_tickets)) { + throw new \InvalidArgumentException('non-nullable max_comp_tickets cannot be null'); + } + $this->container['max_comp_tickets'] = $max_comp_tickets; + + return $this; + } + + /** + * Gets payment_design_id + * + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID + */ + public function getPaymentDesignId() + { + return $this->container['payment_design_id']; + } + + /** + * Sets payment_design_id + * + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $payment_design_id payment_design_id + * + * @return self + */ + public function setPaymentDesignId($payment_design_id) + { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } + $this->container['payment_design_id'] = $payment_design_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SaveTicketSettingsRequestPaymentDesignID.php b/lib/Model/SaveTicketSettingsRequestPaymentDesignID.php new file mode 100644 index 0000000..4df3804 --- /dev/null +++ b/lib/Model/SaveTicketSettingsRequestPaymentDesignID.php @@ -0,0 +1,382 @@ + + */ +class SaveTicketSettingsRequestPaymentDesignID implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'saveTicketSettings_request_paymentDesignID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Service.php b/lib/Model/Service.php index 3c61073..bfcad0f 100644 --- a/lib/Model/Service.php +++ b/lib/Model/Service.php @@ -2,7 +2,7 @@ /** * Service * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Service implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -66,7 +64,7 @@ class Service implements ModelInterface, ArrayAccess, \JsonSerializable 'order_number' => 'int', 'media_url' => 'string', 'additional_info_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -94,6 +92,32 @@ class Service implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -229,17 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -333,6 +427,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling Service., must be bigger than or equal to 1.'); @@ -362,6 +459,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling Service., must be bigger than or equal to 1.'); @@ -391,6 +491,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -415,6 +518,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling Service., must be bigger than or equal to 1.'); @@ -444,6 +550,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -468,6 +577,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -476,7 +588,7 @@ public function setAdditionalInfoUrl($additional_info_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -486,12 +598,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -516,6 +631,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -540,6 +658,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -564,6 +685,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -588,14 +712,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Service., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Service., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Service., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Service., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -609,7 +736,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -621,6 +748,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -634,7 +762,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -650,7 +778,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -662,6 +790,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/SimpleSMSBroadcast.php b/lib/Model/SimpleSMSBroadcast.php index c008bce..6945311 100644 --- a/lib/Model/SimpleSMSBroadcast.php +++ b/lib/Model/SimpleSMSBroadcast.php @@ -2,7 +2,7 @@ /** * SimpleSMSBroadcast * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SimpleSMSBroadcast implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,22 +59,22 @@ class SimpleSMSBroadcast implements ModelInterface, ArrayAccess, \JsonSerializab */ protected static $openAPITypes = [ 'phone_number_id' => 'string', - 'payment_object_prefix' => 'string', + 'payment_object_prefix' => '\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix', 'payment_object_id' => 'string', 'message_template' => 'string', 'media_urls' => 'string[]', 'employee_id' => 'string', 'broadcast_scheduled_at' => '\DateTime', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', - 'broadcast_status' => 'string', + 'broadcast_status' => '\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus', 'broadcast_queued_at' => '\DateTime', 'broadcast_started_at' => '\DateTime', 'broadcast_completed_at' => '\DateTime', - 'list_type' => 'string', + 'list_type' => '\OpenAPI\Client\Model\DynamicVoucherBroadcastListType', 'list_id' => 'string', 'opt_in_list' => '\OpenAPI\Client\Model\WTOptInList', 'imported_list' => '\OpenAPI\Client\Model\WTImportedList' @@ -112,6 +110,41 @@ class SimpleSMSBroadcast implements ModelInterface, ArrayAccess, \JsonSerializab 'imported_list' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_number_id' => false, + 'payment_object_prefix' => false, + 'payment_object_id' => false, + 'message_template' => false, + 'media_urls' => false, + 'employee_id' => false, + 'broadcast_scheduled_at' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'broadcast_status' => false, + 'broadcast_queued_at' => true, + 'broadcast_started_at' => true, + 'broadcast_completed_at' => true, + 'list_type' => false, + 'list_id' => false, + 'opt_in_list' => false, + 'imported_list' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -132,6 +165,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -274,26 +359,44 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['payment_object_prefix'] = $data['payment_object_prefix'] ?? null; - $this->container['payment_object_id'] = $data['payment_object_id'] ?? null; - $this->container['message_template'] = $data['message_template'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['broadcast_scheduled_at'] = $data['broadcast_scheduled_at'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['broadcast_status'] = $data['broadcast_status'] ?? null; - $this->container['broadcast_queued_at'] = $data['broadcast_queued_at'] ?? null; - $this->container['broadcast_started_at'] = $data['broadcast_started_at'] ?? null; - $this->container['broadcast_completed_at'] = $data['broadcast_completed_at'] ?? null; - $this->container['list_type'] = $data['list_type'] ?? null; - $this->container['list_id'] = $data['list_id'] ?? null; - $this->container['opt_in_list'] = $data['opt_in_list'] ?? null; - $this->container['imported_list'] = $data['imported_list'] ?? null; + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('payment_object_prefix', $data ?? [], null); + $this->setIfExists('payment_object_id', $data ?? [], null); + $this->setIfExists('message_template', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('broadcast_scheduled_at', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('broadcast_status', $data ?? [], null); + $this->setIfExists('broadcast_queued_at', $data ?? [], null); + $this->setIfExists('broadcast_started_at', $data ?? [], null); + $this->setIfExists('broadcast_completed_at', $data ?? [], null); + $this->setIfExists('list_type', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('opt_in_list', $data ?? [], null); + $this->setIfExists('imported_list', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -323,14 +426,6 @@ public function listInvalidProperties() if ($this->container['payment_object_prefix'] === null) { $invalidProperties[] = "'payment_object_prefix' can't be null"; } - if ((mb_strlen($this->container['payment_object_prefix']) > 2)) { - $invalidProperties[] = "invalid value for 'payment_object_prefix', the character length must be smaller than or equal to 2."; - } - - if ((mb_strlen($this->container['payment_object_prefix']) < 2)) { - $invalidProperties[] = "invalid value for 'payment_object_prefix', the character length must be bigger than or equal to 2."; - } - if ($this->container['payment_object_id'] === null) { $invalidProperties[] = "'payment_object_id' can't be null"; } @@ -373,14 +468,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -469,14 +556,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling SimpleSMSBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling SimpleSMSBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling SimpleSMSBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling SimpleSMSBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -487,7 +577,7 @@ public function setPhoneNumberId($phone_number_id) /** * Gets payment_object_prefix * - * @return string + * @return \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix */ public function getPaymentObjectPrefix() { @@ -497,19 +587,15 @@ public function getPaymentObjectPrefix() /** * Sets payment_object_prefix * - * @param string $payment_object_prefix payment_object_prefix + * @param \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix $payment_object_prefix payment_object_prefix * * @return self */ public function setPaymentObjectPrefix($payment_object_prefix) { - if ((mb_strlen($payment_object_prefix) > 2)) { - throw new \InvalidArgumentException('invalid length for $payment_object_prefix when calling SimpleSMSBroadcast., must be smaller than or equal to 2.'); - } - if ((mb_strlen($payment_object_prefix) < 2)) { - throw new \InvalidArgumentException('invalid length for $payment_object_prefix when calling SimpleSMSBroadcast., must be bigger than or equal to 2.'); + if (is_null($payment_object_prefix)) { + throw new \InvalidArgumentException('non-nullable payment_object_prefix cannot be null'); } - $this->container['payment_object_prefix'] = $payment_object_prefix; return $this; @@ -534,14 +620,17 @@ public function getPaymentObjectId() */ public function setPaymentObjectId($payment_object_id) { + if (is_null($payment_object_id)) { + throw new \InvalidArgumentException('non-nullable payment_object_id cannot be null'); + } if ((mb_strlen($payment_object_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling SimpleSMSBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_object_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling SimpleSMSBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_object_id))) { - throw new \InvalidArgumentException("invalid value for $payment_object_id when calling SimpleSMSBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_object_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_object_id when calling SimpleSMSBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_object_id'] = $payment_object_id; @@ -568,6 +657,9 @@ public function getMessageTemplate() */ public function setMessageTemplate($message_template) { + if (is_null($message_template)) { + throw new \InvalidArgumentException('non-nullable message_template cannot be null'); + } $this->container['message_template'] = $message_template; return $this; @@ -592,6 +684,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -616,14 +711,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling SimpleSMSBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling SimpleSMSBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling SimpleSMSBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling SimpleSMSBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -650,6 +748,9 @@ public function getBroadcastScheduledAt() */ public function setBroadcastScheduledAt($broadcast_scheduled_at) { + if (is_null($broadcast_scheduled_at)) { + throw new \InvalidArgumentException('non-nullable broadcast_scheduled_at cannot be null'); + } $this->container['broadcast_scheduled_at'] = $broadcast_scheduled_at; return $this; @@ -658,7 +759,7 @@ public function setBroadcastScheduledAt($broadcast_scheduled_at) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -668,19 +769,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling SimpleSMSBroadcast., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling SimpleSMSBroadcast., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -705,14 +802,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling SimpleSMSBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling SimpleSMSBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling SimpleSMSBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling SimpleSMSBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -739,6 +839,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -763,6 +866,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -787,6 +893,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -795,7 +904,7 @@ public function setIsActive($is_active) /** * Gets broadcast_status * - * @return string + * @return \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus */ public function getBroadcastStatus() { @@ -805,12 +914,15 @@ public function getBroadcastStatus() /** * Sets broadcast_status * - * @param string $broadcast_status broadcast_status + * @param \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus $broadcast_status broadcast_status * * @return self */ public function setBroadcastStatus($broadcast_status) { + if (is_null($broadcast_status)) { + throw new \InvalidArgumentException('non-nullable broadcast_status cannot be null'); + } $this->container['broadcast_status'] = $broadcast_status; return $this; @@ -835,6 +947,16 @@ public function getBroadcastQueuedAt() */ public function setBroadcastQueuedAt($broadcast_queued_at) { + if (is_null($broadcast_queued_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_queued_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_queued_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_queued_at'] = $broadcast_queued_at; return $this; @@ -859,6 +981,16 @@ public function getBroadcastStartedAt() */ public function setBroadcastStartedAt($broadcast_started_at) { + if (is_null($broadcast_started_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_started_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_started_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_started_at'] = $broadcast_started_at; return $this; @@ -883,6 +1015,16 @@ public function getBroadcastCompletedAt() */ public function setBroadcastCompletedAt($broadcast_completed_at) { + if (is_null($broadcast_completed_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_completed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_completed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_completed_at'] = $broadcast_completed_at; return $this; @@ -891,7 +1033,7 @@ public function setBroadcastCompletedAt($broadcast_completed_at) /** * Gets list_type * - * @return string + * @return \OpenAPI\Client\Model\DynamicVoucherBroadcastListType */ public function getListType() { @@ -901,12 +1043,15 @@ public function getListType() /** * Sets list_type * - * @param string $list_type list_type + * @param \OpenAPI\Client\Model\DynamicVoucherBroadcastListType $list_type list_type * * @return self */ public function setListType($list_type) { + if (is_null($list_type)) { + throw new \InvalidArgumentException('non-nullable list_type cannot be null'); + } $this->container['list_type'] = $list_type; return $this; @@ -931,14 +1076,17 @@ public function getListId() */ public function setListId($list_id) { + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + } if ((mb_strlen($list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling SimpleSMSBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling SimpleSMSBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $list_id))) { - throw new \InvalidArgumentException("invalid value for $list_id when calling SimpleSMSBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($list_id)))) { + throw new \InvalidArgumentException("invalid value for \$list_id when calling SimpleSMSBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['list_id'] = $list_id; @@ -965,6 +1113,9 @@ public function getOptInList() */ public function setOptInList($opt_in_list) { + if (is_null($opt_in_list)) { + throw new \InvalidArgumentException('non-nullable opt_in_list cannot be null'); + } $this->container['opt_in_list'] = $opt_in_list; return $this; @@ -989,6 +1140,9 @@ public function getImportedList() */ public function setImportedList($imported_list) { + if (is_null($imported_list)) { + throw new \InvalidArgumentException('non-nullable imported_list cannot be null'); + } $this->container['imported_list'] = $imported_list; return $this; @@ -1000,7 +1154,7 @@ public function setImportedList($imported_list) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1012,6 +1166,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1025,7 +1180,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1041,7 +1196,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1053,6 +1208,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/SmsSubscriber.php b/lib/Model/SmsSubscriber.php new file mode 100644 index 0000000..49363bb --- /dev/null +++ b/lib/Model/SmsSubscriber.php @@ -0,0 +1,620 @@ + + */ +class SmsSubscriber implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SmsSubscriber'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mobile_number' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', + 'created_at' => '\DateTime', + 'updated_at' => '\DateTime', + 'is_active' => 'bool', + 'merchant_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mobile_number' => null, + 'id' => null, + 'created_at' => 'date-time', + 'updated_at' => 'date-time', + 'is_active' => null, + 'merchant_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'mobile_number' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'mobile_number' => 'mobileNumber', + 'id' => 'id', + 'created_at' => 'createdAt', + 'updated_at' => 'updatedAt', + 'is_active' => 'isActive', + 'merchant_id' => 'merchantID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mobile_number' => 'setMobileNumber', + 'id' => 'setId', + 'created_at' => 'setCreatedAt', + 'updated_at' => 'setUpdatedAt', + 'is_active' => 'setIsActive', + 'merchant_id' => 'setMerchantId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mobile_number' => 'getMobileNumber', + 'id' => 'getId', + 'created_at' => 'getCreatedAt', + 'updated_at' => 'getUpdatedAt', + 'is_active' => 'getIsActive', + 'merchant_id' => 'getMerchantId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['mobile_number'] === null) { + $invalidProperties[] = "'mobile_number' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['updated_at'] === null) { + $invalidProperties[] = "'updated_at' can't be null"; + } + if ($this->container['is_active'] === null) { + $invalidProperties[] = "'is_active' can't be null"; + } + if ($this->container['merchant_id'] === null) { + $invalidProperties[] = "'merchant_id' can't be null"; + } + if ((mb_strlen($this->container['merchant_id']) > 10)) { + $invalidProperties[] = "invalid value for 'merchant_id', the character length must be smaller than or equal to 10."; + } + + if ((mb_strlen($this->container['merchant_id']) < 10)) { + $invalidProperties[] = "invalid value for 'merchant_id', the character length must be bigger than or equal to 10."; + } + + if (!preg_match("/^[a-zA-Z0-9]+$/", $this->container['merchant_id'])) { + $invalidProperties[] = "invalid value for 'merchant_id', must be conform to the pattern /^[a-zA-Z0-9]+$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets mobile_number + * + * @return string + */ + public function getMobileNumber() + { + return $this->container['mobile_number']; + } + + /** + * Sets mobile_number + * + * @param string $mobile_number mobile_number + * + * @return self + */ + public function setMobileNumber($mobile_number) + { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } + $this->container['mobile_number'] = $mobile_number; + + return $this; + } + + /** + * Gets id + * + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at created_at + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets updated_at + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param \DateTime $updated_at updated_at + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } + $this->container['updated_at'] = $updated_at; + + return $this; + } + + /** + * Gets is_active + * + * @return bool + */ + public function getIsActive() + { + return $this->container['is_active']; + } + + /** + * Sets is_active + * + * @param bool $is_active is_active + * + * @return self + */ + public function setIsActive($is_active) + { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } + $this->container['is_active'] = $is_active; + + return $this; + } + + /** + * Gets merchant_id + * + * @return string + */ + public function getMerchantId() + { + return $this->container['merchant_id']; + } + + /** + * Sets merchant_id + * + * @param string $merchant_id merchant_id + * + * @return self + */ + public function setMerchantId($merchant_id) + { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } + if ((mb_strlen($merchant_id) > 10)) { + throw new \InvalidArgumentException('invalid length for $merchant_id when calling SmsSubscriber., must be smaller than or equal to 10.'); + } + if ((mb_strlen($merchant_id) < 10)) { + throw new \InvalidArgumentException('invalid length for $merchant_id when calling SmsSubscriber., must be bigger than or equal to 10.'); + } + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling SmsSubscriber., must conform to the pattern /^[a-zA-Z0-9]+$/."); + } + + $this->container['merchant_id'] = $merchant_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/StaticVoucher.php b/lib/Model/StaticVoucher.php index 2cf3ab3..101d190 100644 --- a/lib/Model/StaticVoucher.php +++ b/lib/Model/StaticVoucher.php @@ -2,7 +2,7 @@ /** * StaticVoucher * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class StaticVoucher implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,14 +58,14 @@ class StaticVoucher implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'campaign_id' => 'string', 'member_id' => 'string', 'cell_phone_number' => 'string', 'offer_amount_cents' => 'int', 'order_number' => 'int', - 'transaction_type' => 'string', - 'register_id' => 'string', + 'transaction_type' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType', + 'register_id' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID', 'redeemed_source' => 'string', 'redeemed_transaction_id' => 'string', 'redeemed_amount' => 'int', @@ -136,6 +134,53 @@ class StaticVoucher implements ModelInterface, ArrayAccess, \JsonSerializable 'reason_invalid' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'campaign_id' => false, + 'member_id' => false, + 'cell_phone_number' => false, + 'offer_amount_cents' => false, + 'order_number' => false, + 'transaction_type' => false, + 'register_id' => false, + 'redeemed_source' => false, + 'redeemed_transaction_id' => false, + 'redeemed_amount' => false, + 'is_redeemed' => false, + 'refunded_transaction_id' => false, + 'refunded_amount' => false, + 'status' => false, + 'customer_id' => false, + 'authorized_against_check_number' => false, + 'authorized_amount' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'authorized_amount_decimal' => false, + 'authorized_amount_string' => false, + 'offer_amount_cents_decimal' => false, + 'offer_amount_cents_string' => false, + 'redeemed_amount_decimal' => false, + 'redeemed_amount_string' => false, + 'date_time_redeemed' => true, + 'date_time_refunded' => true, + 'date_time_last_viewed' => true, + 'reason_invalid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -156,6 +201,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -334,38 +431,56 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['campaign_id'] = $data['campaign_id'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['cell_phone_number'] = $data['cell_phone_number'] ?? null; - $this->container['offer_amount_cents'] = $data['offer_amount_cents'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['redeemed_source'] = $data['redeemed_source'] ?? null; - $this->container['redeemed_transaction_id'] = $data['redeemed_transaction_id'] ?? null; - $this->container['redeemed_amount'] = $data['redeemed_amount'] ?? null; - $this->container['is_redeemed'] = $data['is_redeemed'] ?? null; - $this->container['refunded_transaction_id'] = $data['refunded_transaction_id'] ?? null; - $this->container['refunded_amount'] = $data['refunded_amount'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['customer_id'] = $data['customer_id'] ?? null; - $this->container['authorized_against_check_number'] = $data['authorized_against_check_number'] ?? null; - $this->container['authorized_amount'] = $data['authorized_amount'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['authorized_amount_decimal'] = $data['authorized_amount_decimal'] ?? null; - $this->container['authorized_amount_string'] = $data['authorized_amount_string'] ?? null; - $this->container['offer_amount_cents_decimal'] = $data['offer_amount_cents_decimal'] ?? null; - $this->container['offer_amount_cents_string'] = $data['offer_amount_cents_string'] ?? null; - $this->container['redeemed_amount_decimal'] = $data['redeemed_amount_decimal'] ?? null; - $this->container['redeemed_amount_string'] = $data['redeemed_amount_string'] ?? null; - $this->container['date_time_redeemed'] = $data['date_time_redeemed'] ?? null; - $this->container['date_time_refunded'] = $data['date_time_refunded'] ?? null; - $this->container['date_time_last_viewed'] = $data['date_time_last_viewed'] ?? null; - $this->container['reason_invalid'] = $data['reason_invalid'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('cell_phone_number', $data ?? [], null); + $this->setIfExists('offer_amount_cents', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('redeemed_source', $data ?? [], null); + $this->setIfExists('redeemed_transaction_id', $data ?? [], null); + $this->setIfExists('redeemed_amount', $data ?? [], null); + $this->setIfExists('is_redeemed', $data ?? [], null); + $this->setIfExists('refunded_transaction_id', $data ?? [], null); + $this->setIfExists('refunded_amount', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('customer_id', $data ?? [], null); + $this->setIfExists('authorized_against_check_number', $data ?? [], null); + $this->setIfExists('authorized_amount', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('authorized_amount_decimal', $data ?? [], null); + $this->setIfExists('authorized_amount_string', $data ?? [], null); + $this->setIfExists('offer_amount_cents_decimal', $data ?? [], null); + $this->setIfExists('offer_amount_cents_string', $data ?? [], null); + $this->setIfExists('redeemed_amount_decimal', $data ?? [], null); + $this->setIfExists('redeemed_amount_string', $data ?? [], null); + $this->setIfExists('date_time_redeemed', $data ?? [], null); + $this->setIfExists('date_time_refunded', $data ?? [], null); + $this->setIfExists('date_time_last_viewed', $data ?? [], null); + $this->setIfExists('reason_invalid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -380,14 +495,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['campaign_id'] === null) { $invalidProperties[] = "'campaign_id' can't be null"; } @@ -526,7 +633,7 @@ public function valid() /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -536,19 +643,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling StaticVoucher., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling StaticVoucher., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -573,14 +676,17 @@ public function getCampaignId() */ public function setCampaignId($campaign_id) { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } if ((mb_strlen($campaign_id) > 10)) { throw new \InvalidArgumentException('invalid length for $campaign_id when calling StaticVoucher., must be smaller than or equal to 10.'); } if ((mb_strlen($campaign_id) < 10)) { throw new \InvalidArgumentException('invalid length for $campaign_id when calling StaticVoucher., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $campaign_id))) { - throw new \InvalidArgumentException("invalid value for $campaign_id when calling StaticVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($campaign_id)))) { + throw new \InvalidArgumentException("invalid value for \$campaign_id when calling StaticVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['campaign_id'] = $campaign_id; @@ -607,9 +713,12 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling StaticVoucher., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling StaticVoucher., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -636,6 +745,9 @@ public function getCellPhoneNumber() */ public function setCellPhoneNumber($cell_phone_number) { + if (is_null($cell_phone_number)) { + throw new \InvalidArgumentException('non-nullable cell_phone_number cannot be null'); + } $this->container['cell_phone_number'] = $cell_phone_number; return $this; @@ -660,6 +772,9 @@ public function getOfferAmountCents() */ public function setOfferAmountCents($offer_amount_cents) { + if (is_null($offer_amount_cents)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents cannot be null'); + } if (($offer_amount_cents < 0)) { throw new \InvalidArgumentException('invalid value for $offer_amount_cents when calling StaticVoucher., must be bigger than or equal to 0.'); @@ -689,6 +804,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 0)) { throw new \InvalidArgumentException('invalid value for $order_number when calling StaticVoucher., must be bigger than or equal to 0.'); @@ -702,7 +820,7 @@ public function setOrderNumber($order_number) /** * Gets transaction_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType */ public function getTransactionType() { @@ -712,12 +830,15 @@ public function getTransactionType() /** * Sets transaction_type * - * @param string $transaction_type The type of the transaction - only redemption at the moment + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType $transaction_type transaction_type * * @return self */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -726,7 +847,7 @@ public function setTransactionType($transaction_type) /** * Gets register_id * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID */ public function getRegisterId() { @@ -736,12 +857,15 @@ public function getRegisterId() /** * Sets register_id * - * @param string $register_id The ID of the register where the transaction occurred + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID $register_id register_id * * @return self */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -766,6 +890,9 @@ public function getRedeemedSource() */ public function setRedeemedSource($redeemed_source) { + if (is_null($redeemed_source)) { + throw new \InvalidArgumentException('non-nullable redeemed_source cannot be null'); + } $this->container['redeemed_source'] = $redeemed_source; return $this; @@ -790,6 +917,9 @@ public function getRedeemedTransactionId() */ public function setRedeemedTransactionId($redeemed_transaction_id) { + if (is_null($redeemed_transaction_id)) { + throw new \InvalidArgumentException('non-nullable redeemed_transaction_id cannot be null'); + } $this->container['redeemed_transaction_id'] = $redeemed_transaction_id; return $this; @@ -814,6 +944,9 @@ public function getRedeemedAmount() */ public function setRedeemedAmount($redeemed_amount) { + if (is_null($redeemed_amount)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount cannot be null'); + } if (($redeemed_amount < 0)) { throw new \InvalidArgumentException('invalid value for $redeemed_amount when calling StaticVoucher., must be bigger than or equal to 0.'); @@ -843,6 +976,9 @@ public function getIsRedeemed() */ public function setIsRedeemed($is_redeemed) { + if (is_null($is_redeemed)) { + throw new \InvalidArgumentException('non-nullable is_redeemed cannot be null'); + } $this->container['is_redeemed'] = $is_redeemed; return $this; @@ -867,6 +1003,9 @@ public function getRefundedTransactionId() */ public function setRefundedTransactionId($refunded_transaction_id) { + if (is_null($refunded_transaction_id)) { + throw new \InvalidArgumentException('non-nullable refunded_transaction_id cannot be null'); + } $this->container['refunded_transaction_id'] = $refunded_transaction_id; return $this; @@ -891,6 +1030,9 @@ public function getRefundedAmount() */ public function setRefundedAmount($refunded_amount) { + if (is_null($refunded_amount)) { + throw new \InvalidArgumentException('non-nullable refunded_amount cannot be null'); + } if (($refunded_amount < 0)) { throw new \InvalidArgumentException('invalid value for $refunded_amount when calling StaticVoucher., must be bigger than or equal to 0.'); @@ -920,6 +1062,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -944,6 +1089,9 @@ public function getCustomerId() */ public function setCustomerId($customer_id) { + if (is_null($customer_id)) { + throw new \InvalidArgumentException('non-nullable customer_id cannot be null'); + } $this->container['customer_id'] = $customer_id; return $this; @@ -968,6 +1116,9 @@ public function getAuthorizedAgainstCheckNumber() */ public function setAuthorizedAgainstCheckNumber($authorized_against_check_number) { + if (is_null($authorized_against_check_number)) { + throw new \InvalidArgumentException('non-nullable authorized_against_check_number cannot be null'); + } $this->container['authorized_against_check_number'] = $authorized_against_check_number; return $this; @@ -992,6 +1143,9 @@ public function getAuthorizedAmount() */ public function setAuthorizedAmount($authorized_amount) { + if (is_null($authorized_amount)) { + throw new \InvalidArgumentException('non-nullable authorized_amount cannot be null'); + } if (($authorized_amount < 0)) { throw new \InvalidArgumentException('invalid value for $authorized_amount when calling StaticVoucher., must be bigger than or equal to 0.'); @@ -1021,14 +1175,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling StaticVoucher., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling StaticVoucher., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling StaticVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling StaticVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -1055,6 +1212,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -1079,6 +1239,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -1103,6 +1266,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -1127,6 +1293,9 @@ public function getAuthorizedAmountDecimal() */ public function setAuthorizedAmountDecimal($authorized_amount_decimal) { + if (is_null($authorized_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable authorized_amount_decimal cannot be null'); + } $this->container['authorized_amount_decimal'] = $authorized_amount_decimal; return $this; @@ -1151,6 +1320,9 @@ public function getAuthorizedAmountString() */ public function setAuthorizedAmountString($authorized_amount_string) { + if (is_null($authorized_amount_string)) { + throw new \InvalidArgumentException('non-nullable authorized_amount_string cannot be null'); + } $this->container['authorized_amount_string'] = $authorized_amount_string; return $this; @@ -1175,6 +1347,9 @@ public function getOfferAmountCentsDecimal() */ public function setOfferAmountCentsDecimal($offer_amount_cents_decimal) { + if (is_null($offer_amount_cents_decimal)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents_decimal cannot be null'); + } $this->container['offer_amount_cents_decimal'] = $offer_amount_cents_decimal; return $this; @@ -1199,6 +1374,9 @@ public function getOfferAmountCentsString() */ public function setOfferAmountCentsString($offer_amount_cents_string) { + if (is_null($offer_amount_cents_string)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents_string cannot be null'); + } $this->container['offer_amount_cents_string'] = $offer_amount_cents_string; return $this; @@ -1223,6 +1401,9 @@ public function getRedeemedAmountDecimal() */ public function setRedeemedAmountDecimal($redeemed_amount_decimal) { + if (is_null($redeemed_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount_decimal cannot be null'); + } $this->container['redeemed_amount_decimal'] = $redeemed_amount_decimal; return $this; @@ -1247,6 +1428,9 @@ public function getRedeemedAmountString() */ public function setRedeemedAmountString($redeemed_amount_string) { + if (is_null($redeemed_amount_string)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount_string cannot be null'); + } $this->container['redeemed_amount_string'] = $redeemed_amount_string; return $this; @@ -1271,6 +1455,16 @@ public function getDateTimeRedeemed() */ public function setDateTimeRedeemed($date_time_redeemed) { + if (is_null($date_time_redeemed)) { + array_push($this->openAPINullablesSetToNull, 'date_time_redeemed'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_time_redeemed', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['date_time_redeemed'] = $date_time_redeemed; return $this; @@ -1295,6 +1489,16 @@ public function getDateTimeRefunded() */ public function setDateTimeRefunded($date_time_refunded) { + if (is_null($date_time_refunded)) { + array_push($this->openAPINullablesSetToNull, 'date_time_refunded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_time_refunded', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['date_time_refunded'] = $date_time_refunded; return $this; @@ -1319,6 +1523,16 @@ public function getDateTimeLastViewed() */ public function setDateTimeLastViewed($date_time_last_viewed) { + if (is_null($date_time_last_viewed)) { + array_push($this->openAPINullablesSetToNull, 'date_time_last_viewed'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_time_last_viewed', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['date_time_last_viewed'] = $date_time_last_viewed; return $this; @@ -1343,6 +1557,9 @@ public function getReasonInvalid() */ public function setReasonInvalid($reason_invalid) { + if (is_null($reason_invalid)) { + throw new \InvalidArgumentException('non-nullable reason_invalid cannot be null'); + } $this->container['reason_invalid'] = $reason_invalid; return $this; @@ -1354,7 +1571,7 @@ public function setReasonInvalid($reason_invalid) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1366,6 +1583,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1379,7 +1597,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1395,7 +1613,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1407,6 +1625,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/StaticVoucherCampaign.php b/lib/Model/StaticVoucherCampaign.php index 2105ad4..fcdc7ec 100644 --- a/lib/Model/StaticVoucherCampaign.php +++ b/lib/Model/StaticVoucherCampaign.php @@ -2,7 +2,7 @@ /** * StaticVoucherCampaign * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class StaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,10 +58,10 @@ class StaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'title' => 'string', 'notes' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'is_loaded' => 'bool', 'display_value' => 'string', 'merchants_reference_id' => 'string', @@ -80,7 +78,7 @@ class StaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonSeriali 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', - 'voucher_type' => 'double', + 'voucher_type' => 'float', 'reinvestment_sum_decimal' => 'string', 'reinvestment_sum_string' => 'string', 'start_date' => '\DateTime', @@ -122,6 +120,46 @@ class StaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonSeriali 'expiration_date' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'title' => false, + 'notes' => false, + 'value_type' => false, + 'is_loaded' => false, + 'display_value' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'employee_id' => false, + 'reinvestment_sum' => false, + 'number_of_vouchers_in_file' => false, + 'campaign_group_id' => false, + 'bucket' => false, + 'created_by_source_id' => false, + 'original_file_name' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'voucher_type' => false, + 'reinvestment_sum_decimal' => false, + 'reinvestment_sum_string' => false, + 'start_date' => false, + 'expiration_date' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -142,6 +180,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -299,31 +389,49 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['is_loaded'] = $data['is_loaded'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['reinvestment_sum'] = $data['reinvestment_sum'] ?? null; - $this->container['number_of_vouchers_in_file'] = $data['number_of_vouchers_in_file'] ?? null; - $this->container['campaign_group_id'] = $data['campaign_group_id'] ?? null; - $this->container['bucket'] = $data['bucket'] ?? null; - $this->container['created_by_source_id'] = $data['created_by_source_id'] ?? null; - $this->container['original_file_name'] = $data['original_file_name'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['voucher_type'] = $data['voucher_type'] ?? null; - $this->container['reinvestment_sum_decimal'] = $data['reinvestment_sum_decimal'] ?? null; - $this->container['reinvestment_sum_string'] = $data['reinvestment_sum_string'] ?? null; - $this->container['start_date'] = $data['start_date'] ?? null; - $this->container['expiration_date'] = $data['expiration_date'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('is_loaded', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('reinvestment_sum', $data ?? [], null); + $this->setIfExists('number_of_vouchers_in_file', $data ?? [], null); + $this->setIfExists('campaign_group_id', $data ?? [], null); + $this->setIfExists('bucket', $data ?? [], null); + $this->setIfExists('created_by_source_id', $data ?? [], null); + $this->setIfExists('original_file_name', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('voucher_type', $data ?? [], null); + $this->setIfExists('reinvestment_sum_decimal', $data ?? [], null); + $this->setIfExists('reinvestment_sum_string', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -338,14 +446,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['title'] === null) { $invalidProperties[] = "'title' can't be null"; } @@ -478,7 +578,7 @@ public function valid() /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -488,19 +588,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling StaticVoucherCampaign., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling StaticVoucherCampaign., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -525,6 +621,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling StaticVoucherCampaign., must be bigger than or equal to 1.'); @@ -554,6 +653,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -562,7 +664,7 @@ public function setNotes($notes) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -572,12 +674,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -602,6 +707,9 @@ public function getIsLoaded() */ public function setIsLoaded($is_loaded) { + if (is_null($is_loaded)) { + throw new \InvalidArgumentException('non-nullable is_loaded cannot be null'); + } $this->container['is_loaded'] = $is_loaded; return $this; @@ -626,6 +734,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } $this->container['display_value'] = $display_value; return $this; @@ -650,6 +761,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -674,6 +788,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -698,14 +815,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling StaticVoucherCampaign., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling StaticVoucherCampaign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling StaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling StaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -732,14 +852,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling StaticVoucherCampaign., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling StaticVoucherCampaign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling StaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling StaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -766,6 +889,9 @@ public function getReinvestmentSum() */ public function setReinvestmentSum($reinvestment_sum) { + if (is_null($reinvestment_sum)) { + throw new \InvalidArgumentException('non-nullable reinvestment_sum cannot be null'); + } if (($reinvestment_sum < 0)) { throw new \InvalidArgumentException('invalid value for $reinvestment_sum when calling StaticVoucherCampaign., must be bigger than or equal to 0.'); @@ -795,6 +921,9 @@ public function getNumberOfVouchersInFile() */ public function setNumberOfVouchersInFile($number_of_vouchers_in_file) { + if (is_null($number_of_vouchers_in_file)) { + throw new \InvalidArgumentException('non-nullable number_of_vouchers_in_file cannot be null'); + } if (($number_of_vouchers_in_file < 0)) { throw new \InvalidArgumentException('invalid value for $number_of_vouchers_in_file when calling StaticVoucherCampaign., must be bigger than or equal to 0.'); @@ -824,14 +953,17 @@ public function getCampaignGroupId() */ public function setCampaignGroupId($campaign_group_id) { - if (!is_null($campaign_group_id) && (mb_strlen($campaign_group_id) > 10)) { + if (is_null($campaign_group_id)) { + throw new \InvalidArgumentException('non-nullable campaign_group_id cannot be null'); + } + if ((mb_strlen($campaign_group_id) > 10)) { throw new \InvalidArgumentException('invalid length for $campaign_group_id when calling StaticVoucherCampaign., must be smaller than or equal to 10.'); } - if (!is_null($campaign_group_id) && (mb_strlen($campaign_group_id) < 10)) { + if ((mb_strlen($campaign_group_id) < 10)) { throw new \InvalidArgumentException('invalid length for $campaign_group_id when calling StaticVoucherCampaign., must be bigger than or equal to 10.'); } - if (!is_null($campaign_group_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $campaign_group_id))) { - throw new \InvalidArgumentException("invalid value for $campaign_group_id when calling StaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($campaign_group_id)))) { + throw new \InvalidArgumentException("invalid value for \$campaign_group_id when calling StaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['campaign_group_id'] = $campaign_group_id; @@ -858,6 +990,9 @@ public function getBucket() */ public function setBucket($bucket) { + if (is_null($bucket)) { + throw new \InvalidArgumentException('non-nullable bucket cannot be null'); + } $this->container['bucket'] = $bucket; return $this; @@ -882,6 +1017,9 @@ public function getCreatedBySourceId() */ public function setCreatedBySourceId($created_by_source_id) { + if (is_null($created_by_source_id)) { + throw new \InvalidArgumentException('non-nullable created_by_source_id cannot be null'); + } $this->container['created_by_source_id'] = $created_by_source_id; return $this; @@ -906,6 +1044,9 @@ public function getOriginalFileName() */ public function setOriginalFileName($original_file_name) { + if (is_null($original_file_name)) { + throw new \InvalidArgumentException('non-nullable original_file_name cannot be null'); + } $this->container['original_file_name'] = $original_file_name; return $this; @@ -930,14 +1071,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling StaticVoucherCampaign., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling StaticVoucherCampaign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling StaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling StaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -964,6 +1108,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -988,6 +1135,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -1012,6 +1162,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -1020,7 +1173,7 @@ public function setIsActive($is_active) /** * Gets voucher_type * - * @return double + * @return float */ public function getVoucherType() { @@ -1030,12 +1183,15 @@ public function getVoucherType() /** * Sets voucher_type * - * @param double $voucher_type voucher_type + * @param float $voucher_type voucher_type * * @return self */ public function setVoucherType($voucher_type) { + if (is_null($voucher_type)) { + throw new \InvalidArgumentException('non-nullable voucher_type cannot be null'); + } $this->container['voucher_type'] = $voucher_type; return $this; @@ -1060,6 +1216,9 @@ public function getReinvestmentSumDecimal() */ public function setReinvestmentSumDecimal($reinvestment_sum_decimal) { + if (is_null($reinvestment_sum_decimal)) { + throw new \InvalidArgumentException('non-nullable reinvestment_sum_decimal cannot be null'); + } $this->container['reinvestment_sum_decimal'] = $reinvestment_sum_decimal; return $this; @@ -1084,6 +1243,9 @@ public function getReinvestmentSumString() */ public function setReinvestmentSumString($reinvestment_sum_string) { + if (is_null($reinvestment_sum_string)) { + throw new \InvalidArgumentException('non-nullable reinvestment_sum_string cannot be null'); + } $this->container['reinvestment_sum_string'] = $reinvestment_sum_string; return $this; @@ -1108,6 +1270,9 @@ public function getStartDate() */ public function setStartDate($start_date) { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } $this->container['start_date'] = $start_date; return $this; @@ -1132,6 +1297,9 @@ public function getExpirationDate() */ public function setExpirationDate($expiration_date) { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } $this->container['expiration_date'] = $expiration_date; return $this; @@ -1143,7 +1311,7 @@ public function setExpirationDate($expiration_date) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1155,6 +1323,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1168,7 +1337,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1184,7 +1353,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1196,6 +1365,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/StaticVoucherCampaignBroadcast.php b/lib/Model/StaticVoucherCampaignBroadcast.php index 522a273..1aedc88 100644 --- a/lib/Model/StaticVoucherCampaignBroadcast.php +++ b/lib/Model/StaticVoucherCampaignBroadcast.php @@ -2,7 +2,7 @@ /** * StaticVoucherCampaignBroadcast * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class StaticVoucherCampaignBroadcast implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class StaticVoucherCampaignBroadcast implements ModelInterface, ArrayAccess, \Js * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'employee_id' => 'string', 'merchant_id' => 'string', 'created_at' => '\DateTime', @@ -70,11 +68,11 @@ class StaticVoucherCampaignBroadcast implements ModelInterface, ArrayAccess, \Js 'media_urls' => 'string[]', 'opt_in_list' => '\OpenAPI\Client\Model\WTOptInList', 'imported_list' => '\OpenAPI\Client\Model\WTImportedList', - 'broadcast_status' => 'string', + 'broadcast_status' => '\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus', 'broadcast_queued_at' => '\DateTime', 'broadcast_started_at' => '\DateTime', 'broadcast_completed_at' => '\DateTime', - 'payment_object_prefix' => 'string', + 'payment_object_prefix' => '\OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix', 'payment_object_id' => 'string', 'message_template' => 'string', 'broadcast_scheduled_at' => '\DateTime', @@ -110,6 +108,40 @@ class StaticVoucherCampaignBroadcast implements ModelInterface, ArrayAccess, \Js 'static_voucher_campaign' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'employee_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'phone_number_id' => false, + 'media_urls' => false, + 'opt_in_list' => false, + 'imported_list' => false, + 'broadcast_status' => false, + 'broadcast_queued_at' => true, + 'broadcast_started_at' => true, + 'broadcast_completed_at' => true, + 'payment_object_prefix' => false, + 'payment_object_id' => false, + 'message_template' => false, + 'broadcast_scheduled_at' => false, + 'static_voucher_campaign' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -130,6 +162,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -269,25 +353,43 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; - $this->container['opt_in_list'] = $data['opt_in_list'] ?? null; - $this->container['imported_list'] = $data['imported_list'] ?? null; - $this->container['broadcast_status'] = $data['broadcast_status'] ?? null; - $this->container['broadcast_queued_at'] = $data['broadcast_queued_at'] ?? null; - $this->container['broadcast_started_at'] = $data['broadcast_started_at'] ?? null; - $this->container['broadcast_completed_at'] = $data['broadcast_completed_at'] ?? null; - $this->container['payment_object_prefix'] = $data['payment_object_prefix'] ?? null; - $this->container['payment_object_id'] = $data['payment_object_id'] ?? null; - $this->container['message_template'] = $data['message_template'] ?? null; - $this->container['broadcast_scheduled_at'] = $data['broadcast_scheduled_at'] ?? null; - $this->container['static_voucher_campaign'] = $data['static_voucher_campaign'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + $this->setIfExists('opt_in_list', $data ?? [], null); + $this->setIfExists('imported_list', $data ?? [], null); + $this->setIfExists('broadcast_status', $data ?? [], null); + $this->setIfExists('broadcast_queued_at', $data ?? [], null); + $this->setIfExists('broadcast_started_at', $data ?? [], null); + $this->setIfExists('broadcast_completed_at', $data ?? [], null); + $this->setIfExists('payment_object_prefix', $data ?? [], null); + $this->setIfExists('payment_object_id', $data ?? [], null); + $this->setIfExists('message_template', $data ?? [], null); + $this->setIfExists('broadcast_scheduled_at', $data ?? [], null); + $this->setIfExists('static_voucher_campaign', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -302,14 +404,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['employee_id'] === null) { $invalidProperties[] = "'employee_id' can't be null"; } @@ -382,14 +476,6 @@ public function listInvalidProperties() if ($this->container['payment_object_prefix'] === null) { $invalidProperties[] = "'payment_object_prefix' can't be null"; } - if ((mb_strlen($this->container['payment_object_prefix']) > 2)) { - $invalidProperties[] = "invalid value for 'payment_object_prefix', the character length must be smaller than or equal to 2."; - } - - if ((mb_strlen($this->container['payment_object_prefix']) < 2)) { - $invalidProperties[] = "invalid value for 'payment_object_prefix', the character length must be bigger than or equal to 2."; - } - if ($this->container['payment_object_id'] === null) { $invalidProperties[] = "'payment_object_id' can't be null"; } @@ -432,7 +518,7 @@ public function valid() /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -442,19 +528,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling StaticVoucherCampaignBroadcast., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling StaticVoucherCampaignBroadcast., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -479,14 +561,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling StaticVoucherCampaignBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling StaticVoucherCampaignBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling StaticVoucherCampaignBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling StaticVoucherCampaignBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -513,14 +598,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling StaticVoucherCampaignBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling StaticVoucherCampaignBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling StaticVoucherCampaignBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling StaticVoucherCampaignBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -547,6 +635,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -571,6 +662,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -595,6 +689,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -619,14 +716,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling StaticVoucherCampaignBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling StaticVoucherCampaignBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling StaticVoucherCampaignBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling StaticVoucherCampaignBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -653,6 +753,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -677,6 +780,9 @@ public function getOptInList() */ public function setOptInList($opt_in_list) { + if (is_null($opt_in_list)) { + throw new \InvalidArgumentException('non-nullable opt_in_list cannot be null'); + } $this->container['opt_in_list'] = $opt_in_list; return $this; @@ -701,6 +807,9 @@ public function getImportedList() */ public function setImportedList($imported_list) { + if (is_null($imported_list)) { + throw new \InvalidArgumentException('non-nullable imported_list cannot be null'); + } $this->container['imported_list'] = $imported_list; return $this; @@ -709,7 +818,7 @@ public function setImportedList($imported_list) /** * Gets broadcast_status * - * @return string + * @return \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus */ public function getBroadcastStatus() { @@ -719,12 +828,15 @@ public function getBroadcastStatus() /** * Sets broadcast_status * - * @param string $broadcast_status broadcast_status + * @param \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatus $broadcast_status broadcast_status * * @return self */ public function setBroadcastStatus($broadcast_status) { + if (is_null($broadcast_status)) { + throw new \InvalidArgumentException('non-nullable broadcast_status cannot be null'); + } $this->container['broadcast_status'] = $broadcast_status; return $this; @@ -749,6 +861,16 @@ public function getBroadcastQueuedAt() */ public function setBroadcastQueuedAt($broadcast_queued_at) { + if (is_null($broadcast_queued_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_queued_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_queued_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_queued_at'] = $broadcast_queued_at; return $this; @@ -773,6 +895,16 @@ public function getBroadcastStartedAt() */ public function setBroadcastStartedAt($broadcast_started_at) { + if (is_null($broadcast_started_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_started_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_started_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_started_at'] = $broadcast_started_at; return $this; @@ -797,6 +929,16 @@ public function getBroadcastCompletedAt() */ public function setBroadcastCompletedAt($broadcast_completed_at) { + if (is_null($broadcast_completed_at)) { + array_push($this->openAPINullablesSetToNull, 'broadcast_completed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('broadcast_completed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['broadcast_completed_at'] = $broadcast_completed_at; return $this; @@ -805,7 +947,7 @@ public function setBroadcastCompletedAt($broadcast_completed_at) /** * Gets payment_object_prefix * - * @return string + * @return \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix */ public function getPaymentObjectPrefix() { @@ -815,19 +957,15 @@ public function getPaymentObjectPrefix() /** * Sets payment_object_prefix * - * @param string $payment_object_prefix payment_object_prefix + * @param \OpenAPI\Client\Model\PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefix $payment_object_prefix payment_object_prefix * * @return self */ public function setPaymentObjectPrefix($payment_object_prefix) { - if ((mb_strlen($payment_object_prefix) > 2)) { - throw new \InvalidArgumentException('invalid length for $payment_object_prefix when calling StaticVoucherCampaignBroadcast., must be smaller than or equal to 2.'); - } - if ((mb_strlen($payment_object_prefix) < 2)) { - throw new \InvalidArgumentException('invalid length for $payment_object_prefix when calling StaticVoucherCampaignBroadcast., must be bigger than or equal to 2.'); + if (is_null($payment_object_prefix)) { + throw new \InvalidArgumentException('non-nullable payment_object_prefix cannot be null'); } - $this->container['payment_object_prefix'] = $payment_object_prefix; return $this; @@ -852,14 +990,17 @@ public function getPaymentObjectId() */ public function setPaymentObjectId($payment_object_id) { + if (is_null($payment_object_id)) { + throw new \InvalidArgumentException('non-nullable payment_object_id cannot be null'); + } if ((mb_strlen($payment_object_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling StaticVoucherCampaignBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_object_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_object_id when calling StaticVoucherCampaignBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_object_id))) { - throw new \InvalidArgumentException("invalid value for $payment_object_id when calling StaticVoucherCampaignBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_object_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_object_id when calling StaticVoucherCampaignBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_object_id'] = $payment_object_id; @@ -886,6 +1027,9 @@ public function getMessageTemplate() */ public function setMessageTemplate($message_template) { + if (is_null($message_template)) { + throw new \InvalidArgumentException('non-nullable message_template cannot be null'); + } $this->container['message_template'] = $message_template; return $this; @@ -910,6 +1054,9 @@ public function getBroadcastScheduledAt() */ public function setBroadcastScheduledAt($broadcast_scheduled_at) { + if (is_null($broadcast_scheduled_at)) { + throw new \InvalidArgumentException('non-nullable broadcast_scheduled_at cannot be null'); + } $this->container['broadcast_scheduled_at'] = $broadcast_scheduled_at; return $this; @@ -934,6 +1081,9 @@ public function getStaticVoucherCampaign() */ public function setStaticVoucherCampaign($static_voucher_campaign) { + if (is_null($static_voucher_campaign)) { + throw new \InvalidArgumentException('non-nullable static_voucher_campaign cannot be null'); + } $this->container['static_voucher_campaign'] = $static_voucher_campaign; return $this; @@ -945,7 +1095,7 @@ public function setStaticVoucherCampaign($static_voucher_campaign) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -957,6 +1107,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -970,7 +1121,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -986,7 +1137,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -998,6 +1149,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/StaticVoucherCampaignGroup.php b/lib/Model/StaticVoucherCampaignGroup.php index e9cf439..bbbbdaf 100644 --- a/lib/Model/StaticVoucherCampaignGroup.php +++ b/lib/Model/StaticVoucherCampaignGroup.php @@ -2,7 +2,7 @@ /** * StaticVoucherCampaignGroup * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class StaticVoucherCampaignGroup implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class StaticVoucherCampaignGroup implements ModelInterface, ArrayAccess, \JsonSe 'voucher_type' => 'int', 'created_by_source_id' => 'int', 'employee_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -92,6 +90,31 @@ class StaticVoucherCampaignGroup implements ModelInterface, ArrayAccess, \JsonSe 'is_loaded' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'voucher_type' => false, + 'created_by_source_id' => false, + 'employee_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'is_loaded' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['voucher_type'] = $data['voucher_type'] ?? null; - $this->container['created_by_source_id'] = $data['created_by_source_id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['is_loaded'] = $data['is_loaded'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('voucher_type', $data ?? [], null); + $this->setIfExists('created_by_source_id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('is_loaded', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -272,14 +365,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -341,6 +426,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -365,6 +453,9 @@ public function getVoucherType() */ public function setVoucherType($voucher_type) { + if (is_null($voucher_type)) { + throw new \InvalidArgumentException('non-nullable voucher_type cannot be null'); + } $this->container['voucher_type'] = $voucher_type; return $this; @@ -389,6 +480,9 @@ public function getCreatedBySourceId() */ public function setCreatedBySourceId($created_by_source_id) { + if (is_null($created_by_source_id)) { + throw new \InvalidArgumentException('non-nullable created_by_source_id cannot be null'); + } $this->container['created_by_source_id'] = $created_by_source_id; return $this; @@ -413,14 +507,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling StaticVoucherCampaignGroup., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling StaticVoucherCampaignGroup., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling StaticVoucherCampaignGroup., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling StaticVoucherCampaignGroup., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -431,7 +528,7 @@ public function setEmployeeId($employee_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -441,19 +538,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling StaticVoucherCampaignGroup., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling StaticVoucherCampaignGroup., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -478,14 +571,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling StaticVoucherCampaignGroup., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling StaticVoucherCampaignGroup., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling StaticVoucherCampaignGroup., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling StaticVoucherCampaignGroup., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -512,6 +608,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -536,6 +635,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -560,6 +662,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -584,6 +689,9 @@ public function getIsLoaded() */ public function setIsLoaded($is_loaded) { + if (is_null($is_loaded)) { + throw new \InvalidArgumentException('non-nullable is_loaded cannot be null'); + } $this->container['is_loaded'] = $is_loaded; return $this; @@ -595,7 +703,7 @@ public function setIsLoaded($is_loaded) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -607,6 +715,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -620,7 +729,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -636,7 +745,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -648,6 +757,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/StaticVoucherCampaignUpdate.php b/lib/Model/StaticVoucherCampaignUpdate.php index a848767..b1841a8 100644 --- a/lib/Model/StaticVoucherCampaignUpdate.php +++ b/lib/Model/StaticVoucherCampaignUpdate.php @@ -2,7 +2,7 @@ /** * StaticVoucherCampaignUpdate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class StaticVoucherCampaignUpdate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class StaticVoucherCampaignUpdate implements ModelInterface, ArrayAccess, \JsonS 'expiration_date_time' => '\DateTime', 'title' => 'string', 'notes' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'display_value' => 'string', 'merchants_reference_id' => 'string', 'valid_only_at_pos_register_ids' => 'string[]', @@ -90,6 +88,30 @@ class StaticVoucherCampaignUpdate implements ModelInterface, ArrayAccess, \JsonS 'payment_design_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'start_date_time' => false, + 'expiration_date_time' => false, + 'title' => false, + 'notes' => false, + 'value_type' => false, + 'display_value' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -110,6 +132,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -219,15 +293,33 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['start_date_time'] = $data['start_date_time'] ?? null; - $this->container['expiration_date_time'] = $data['expiration_date_time'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; + $this->setIfExists('start_date_time', $data ?? [], null); + $this->setIfExists('expiration_date_time', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -307,6 +399,9 @@ public function getStartDateTime() */ public function setStartDateTime($start_date_time) { + if (is_null($start_date_time)) { + throw new \InvalidArgumentException('non-nullable start_date_time cannot be null'); + } $this->container['start_date_time'] = $start_date_time; return $this; @@ -331,6 +426,9 @@ public function getExpirationDateTime() */ public function setExpirationDateTime($expiration_date_time) { + if (is_null($expiration_date_time)) { + throw new \InvalidArgumentException('non-nullable expiration_date_time cannot be null'); + } $this->container['expiration_date_time'] = $expiration_date_time; return $this; @@ -355,6 +453,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling StaticVoucherCampaignUpdate., must be bigger than or equal to 1.'); @@ -384,6 +485,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -392,7 +496,7 @@ public function setNotes($notes) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -402,12 +506,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -432,6 +539,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } $this->container['display_value'] = $display_value; return $this; @@ -456,6 +566,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -480,6 +593,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -504,14 +620,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling StaticVoucherCampaignUpdate., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling StaticVoucherCampaignUpdate., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling StaticVoucherCampaignUpdate., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling StaticVoucherCampaignUpdate., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -525,7 +644,7 @@ public function setPaymentDesignId($payment_design_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -537,6 +656,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -550,7 +670,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -566,7 +686,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -578,6 +698,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Status.php b/lib/Model/Status.php index 5fdf6ec..c5116ef 100644 --- a/lib/Model/Status.php +++ b/lib/Model/Status.php @@ -2,7 +2,7 @@ /** * Status * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Status implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class Status implements ModelInterface, ArrayAccess, \JsonSerializable ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -181,6 +247,24 @@ public function __construct(array $data = null) { } + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + /** * Show all the invalid properties with reasons. * @@ -211,7 +295,7 @@ public function valid() * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -223,6 +307,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -236,7 +321,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -252,7 +337,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -264,6 +349,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/SubscriptionFeature.php b/lib/Model/SubscriptionFeature.php index 4987528..f6f6870 100644 --- a/lib/Model/SubscriptionFeature.php +++ b/lib/Model/SubscriptionFeature.php @@ -2,7 +2,7 @@ /** * SubscriptionFeature * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubscriptionFeature implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class SubscriptionFeature implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'sort_num' => 'double', + 'sort_num' => 'float', 'name' => 'string', 'max_volume' => 'string', 'measurement' => 'string', @@ -90,6 +88,30 @@ class SubscriptionFeature implements ModelInterface, ArrayAccess, \JsonSerializa 'is_enabled' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'sort_num' => false, + 'name' => false, + 'max_volume' => false, + 'measurement' => false, + 'description' => false, + 'current_volume' => false, + 'is_exceeded' => false, + 'is_in_use' => false, + 'is_enabled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -110,6 +132,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -219,15 +293,33 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['sort_num'] = $data['sort_num'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['max_volume'] = $data['max_volume'] ?? null; - $this->container['measurement'] = $data['measurement'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['current_volume'] = $data['current_volume'] ?? null; - $this->container['is_exceeded'] = $data['is_exceeded'] ?? null; - $this->container['is_in_use'] = $data['is_in_use'] ?? null; - $this->container['is_enabled'] = $data['is_enabled'] ?? null; + $this->setIfExists('sort_num', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('max_volume', $data ?? [], null); + $this->setIfExists('measurement', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('current_volume', $data ?? [], null); + $this->setIfExists('is_exceeded', $data ?? [], null); + $this->setIfExists('is_in_use', $data ?? [], null); + $this->setIfExists('is_enabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -269,7 +361,7 @@ public function valid() /** * Gets sort_num * - * @return double + * @return float */ public function getSortNum() { @@ -279,12 +371,15 @@ public function getSortNum() /** * Sets sort_num * - * @param double $sort_num sort_num + * @param float $sort_num sort_num * * @return self */ public function setSortNum($sort_num) { + if (is_null($sort_num)) { + throw new \InvalidArgumentException('non-nullable sort_num cannot be null'); + } $this->container['sort_num'] = $sort_num; return $this; @@ -309,6 +404,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -333,6 +431,9 @@ public function getMaxVolume() */ public function setMaxVolume($max_volume) { + if (is_null($max_volume)) { + throw new \InvalidArgumentException('non-nullable max_volume cannot be null'); + } $this->container['max_volume'] = $max_volume; return $this; @@ -357,6 +458,9 @@ public function getMeasurement() */ public function setMeasurement($measurement) { + if (is_null($measurement)) { + throw new \InvalidArgumentException('non-nullable measurement cannot be null'); + } $this->container['measurement'] = $measurement; return $this; @@ -381,6 +485,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } $this->container['description'] = $description; return $this; @@ -405,6 +512,9 @@ public function getCurrentVolume() */ public function setCurrentVolume($current_volume) { + if (is_null($current_volume)) { + throw new \InvalidArgumentException('non-nullable current_volume cannot be null'); + } $this->container['current_volume'] = $current_volume; return $this; @@ -429,6 +539,9 @@ public function getIsExceeded() */ public function setIsExceeded($is_exceeded) { + if (is_null($is_exceeded)) { + throw new \InvalidArgumentException('non-nullable is_exceeded cannot be null'); + } $this->container['is_exceeded'] = $is_exceeded; return $this; @@ -453,6 +566,9 @@ public function getIsInUse() */ public function setIsInUse($is_in_use) { + if (is_null($is_in_use)) { + throw new \InvalidArgumentException('non-nullable is_in_use cannot be null'); + } $this->container['is_in_use'] = $is_in_use; return $this; @@ -477,6 +593,9 @@ public function getIsEnabled() */ public function setIsEnabled($is_enabled) { + if (is_null($is_enabled)) { + throw new \InvalidArgumentException('non-nullable is_enabled cannot be null'); + } $this->container['is_enabled'] = $is_enabled; return $this; @@ -488,7 +607,7 @@ public function setIsEnabled($is_enabled) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -500,6 +619,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -513,7 +633,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -529,7 +649,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -541,6 +661,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/SubscriptionPlan.php b/lib/Model/SubscriptionPlan.php index 191eb07..ffb4b72 100644 --- a/lib/Model/SubscriptionPlan.php +++ b/lib/Model/SubscriptionPlan.php @@ -2,7 +2,7 @@ /** * SubscriptionPlan * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubscriptionPlan implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class SubscriptionPlan implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'id' => 'string', 'name' => 'string', - 'price' => 'double', + 'price' => 'float', 'nickname' => 'string', 'examples' => 'string', 'products' => '\OpenAPI\Client\Model\SubscriptionProduct[]', @@ -86,6 +84,28 @@ class SubscriptionPlan implements ModelInterface, ArrayAccess, \JsonSerializable 'all_pages' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => false, + 'price' => false, + 'nickname' => false, + 'examples' => false, + 'products' => false, + 'all_pages' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +126,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -209,13 +281,31 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['price'] = $data['price'] ?? null; - $this->container['nickname'] = $data['nickname'] ?? null; - $this->container['examples'] = $data['examples'] ?? null; - $this->container['products'] = $data['products'] ?? null; - $this->container['all_pages'] = $data['all_pages'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('nickname', $data ?? [], null); + $this->setIfExists('examples', $data ?? [], null); + $this->setIfExists('products', $data ?? [], null); + $this->setIfExists('all_pages', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -282,6 +372,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -306,6 +399,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -314,7 +410,7 @@ public function setName($name) /** * Gets price * - * @return double + * @return float */ public function getPrice() { @@ -324,12 +420,15 @@ public function getPrice() /** * Sets price * - * @param double $price price + * @param float $price price * * @return self */ public function setPrice($price) { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } $this->container['price'] = $price; return $this; @@ -354,6 +453,9 @@ public function getNickname() */ public function setNickname($nickname) { + if (is_null($nickname)) { + throw new \InvalidArgumentException('non-nullable nickname cannot be null'); + } $this->container['nickname'] = $nickname; return $this; @@ -378,6 +480,9 @@ public function getExamples() */ public function setExamples($examples) { + if (is_null($examples)) { + throw new \InvalidArgumentException('non-nullable examples cannot be null'); + } $this->container['examples'] = $examples; return $this; @@ -402,6 +507,9 @@ public function getProducts() */ public function setProducts($products) { + if (is_null($products)) { + throw new \InvalidArgumentException('non-nullable products cannot be null'); + } $this->container['products'] = $products; return $this; @@ -426,6 +534,9 @@ public function getAllPages() */ public function setAllPages($all_pages) { + if (is_null($all_pages)) { + throw new \InvalidArgumentException('non-nullable all_pages cannot be null'); + } $this->container['all_pages'] = $all_pages; return $this; @@ -437,7 +548,7 @@ public function setAllPages($all_pages) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -449,6 +560,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -462,7 +574,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -478,7 +590,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -490,6 +602,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/SubscriptionProduct.php b/lib/Model/SubscriptionProduct.php index d9a6a72..686703d 100644 --- a/lib/Model/SubscriptionProduct.php +++ b/lib/Model/SubscriptionProduct.php @@ -2,7 +2,7 @@ /** * SubscriptionProduct * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class SubscriptionProduct implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class SubscriptionProduct implements ModelInterface, ArrayAccess, \JsonSerializa 'title' => 'string', 'title_full' => 'string', 'category' => 'string', - 'volume' => 'double', + 'volume' => 'float', 'features' => '\OpenAPI\Client\Model\SubscriptionFeature[]', 'pages' => '\OpenAPI\Client\Model\PortalPage[]', 'icon_name' => 'string', @@ -94,6 +92,32 @@ class SubscriptionProduct implements ModelInterface, ArrayAccess, \JsonSerializa 'release_status' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'title' => false, + 'title_full' => false, + 'category' => false, + 'volume' => false, + 'features' => false, + 'pages' => false, + 'icon_name' => false, + 'description' => false, + 'is_hourly' => false, + 'release_status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -229,17 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['title_full'] = $data['title_full'] ?? null; - $this->container['category'] = $data['category'] ?? null; - $this->container['volume'] = $data['volume'] ?? null; - $this->container['features'] = $data['features'] ?? null; - $this->container['pages'] = $data['pages'] ?? null; - $this->container['icon_name'] = $data['icon_name'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['is_hourly'] = $data['is_hourly'] ?? null; - $this->container['release_status'] = $data['release_status'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('title_full', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('volume', $data ?? [], null); + $this->setIfExists('features', $data ?? [], null); + $this->setIfExists('pages', $data ?? [], null); + $this->setIfExists('icon_name', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('is_hourly', $data ?? [], null); + $this->setIfExists('release_status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -309,6 +403,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -333,6 +430,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } $this->container['title'] = $title; return $this; @@ -357,6 +457,9 @@ public function getTitleFull() */ public function setTitleFull($title_full) { + if (is_null($title_full)) { + throw new \InvalidArgumentException('non-nullable title_full cannot be null'); + } $this->container['title_full'] = $title_full; return $this; @@ -381,6 +484,9 @@ public function getCategory() */ public function setCategory($category) { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } $this->container['category'] = $category; return $this; @@ -389,7 +495,7 @@ public function setCategory($category) /** * Gets volume * - * @return double|null + * @return float|null */ public function getVolume() { @@ -399,12 +505,15 @@ public function getVolume() /** * Sets volume * - * @param double|null $volume volume + * @param float|null $volume volume * * @return self */ public function setVolume($volume) { + if (is_null($volume)) { + throw new \InvalidArgumentException('non-nullable volume cannot be null'); + } $this->container['volume'] = $volume; return $this; @@ -429,6 +538,9 @@ public function getFeatures() */ public function setFeatures($features) { + if (is_null($features)) { + throw new \InvalidArgumentException('non-nullable features cannot be null'); + } $this->container['features'] = $features; return $this; @@ -453,6 +565,9 @@ public function getPages() */ public function setPages($pages) { + if (is_null($pages)) { + throw new \InvalidArgumentException('non-nullable pages cannot be null'); + } $this->container['pages'] = $pages; return $this; @@ -477,6 +592,9 @@ public function getIconName() */ public function setIconName($icon_name) { + if (is_null($icon_name)) { + throw new \InvalidArgumentException('non-nullable icon_name cannot be null'); + } $this->container['icon_name'] = $icon_name; return $this; @@ -501,6 +619,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } $this->container['description'] = $description; return $this; @@ -525,6 +646,9 @@ public function getIsHourly() */ public function setIsHourly($is_hourly) { + if (is_null($is_hourly)) { + throw new \InvalidArgumentException('non-nullable is_hourly cannot be null'); + } $this->container['is_hourly'] = $is_hourly; return $this; @@ -549,6 +673,9 @@ public function getReleaseStatus() */ public function setReleaseStatus($release_status) { + if (is_null($release_status)) { + throw new \InvalidArgumentException('non-nullable release_status cannot be null'); + } $this->container['release_status'] = $release_status; return $this; @@ -560,7 +687,7 @@ public function setReleaseStatus($release_status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -572,6 +699,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -585,7 +713,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -601,7 +729,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -613,6 +741,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Tcpa.php b/lib/Model/Tcpa.php index cb34b5f..b1f4839 100644 --- a/lib/Model/Tcpa.php +++ b/lib/Model/Tcpa.php @@ -2,7 +2,7 @@ /** * Tcpa * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Tcpa implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class Tcpa implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'cell_phone' => 'string', 'phone_number_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -86,6 +84,28 @@ class Tcpa implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'cell_phone' => false, + 'phone_number_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +126,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -209,13 +281,31 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['cell_phone'] = $data['cell_phone'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('cell_phone', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -248,14 +338,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -314,6 +396,9 @@ public function getCellPhone() */ public function setCellPhone($cell_phone) { + if (is_null($cell_phone)) { + throw new \InvalidArgumentException('non-nullable cell_phone cannot be null'); + } $this->container['cell_phone'] = $cell_phone; return $this; @@ -338,14 +423,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling Tcpa., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling Tcpa., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling Tcpa., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling Tcpa., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -356,7 +444,7 @@ public function setPhoneNumberId($phone_number_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -366,19 +454,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling Tcpa., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling Tcpa., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -403,14 +487,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Tcpa., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Tcpa., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Tcpa., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Tcpa., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -437,6 +524,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -461,6 +551,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -485,6 +578,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -496,7 +592,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -508,6 +604,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -521,7 +618,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -537,7 +634,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -549,6 +646,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Ticket.php b/lib/Model/Ticket.php index c6807fd..e53d30f 100644 --- a/lib/Model/Ticket.php +++ b/lib/Model/Ticket.php @@ -2,7 +2,7 @@ /** * Ticket * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Ticket implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,9 +62,9 @@ class Ticket implements ModelInterface, ArrayAccess, \JsonSerializable 'recipient_email_address' => 'string', 'recipient_member_id' => 'string', 'is_comp' => 'bool', - 'quantity' => 'double', + 'quantity' => 'float', 'performance_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -112,6 +110,41 @@ class Ticket implements ModelInterface, ArrayAccess, \JsonSerializable 'date_time_redeemed' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'recipient_phone_number' => false, + 'recipient_email_address' => false, + 'recipient_member_id' => false, + 'is_comp' => false, + 'quantity' => false, + 'performance_id' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false, + 'is_claimed' => false, + 'date_time_claimed' => false, + 'claimed_by_phone_number' => false, + 'redeemed_source' => false, + 'redeemed_transaction_id' => false, + 'transaction_type' => false, + 'register_id' => false, + 'is_redeemed' => false, + 'date_time_redeemed' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -132,6 +165,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -274,26 +359,44 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['recipient_phone_number'] = $data['recipient_phone_number'] ?? null; - $this->container['recipient_email_address'] = $data['recipient_email_address'] ?? null; - $this->container['recipient_member_id'] = $data['recipient_member_id'] ?? null; - $this->container['is_comp'] = $data['is_comp'] ?? null; - $this->container['quantity'] = $data['quantity'] ?? null; - $this->container['performance_id'] = $data['performance_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['is_claimed'] = $data['is_claimed'] ?? null; - $this->container['date_time_claimed'] = $data['date_time_claimed'] ?? null; - $this->container['claimed_by_phone_number'] = $data['claimed_by_phone_number'] ?? null; - $this->container['redeemed_source'] = $data['redeemed_source'] ?? null; - $this->container['redeemed_transaction_id'] = $data['redeemed_transaction_id'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['is_redeemed'] = $data['is_redeemed'] ?? null; - $this->container['date_time_redeemed'] = $data['date_time_redeemed'] ?? null; + $this->setIfExists('recipient_phone_number', $data ?? [], null); + $this->setIfExists('recipient_email_address', $data ?? [], null); + $this->setIfExists('recipient_member_id', $data ?? [], null); + $this->setIfExists('is_comp', $data ?? [], null); + $this->setIfExists('quantity', $data ?? [], null); + $this->setIfExists('performance_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('is_claimed', $data ?? [], null); + $this->setIfExists('date_time_claimed', $data ?? [], null); + $this->setIfExists('claimed_by_phone_number', $data ?? [], null); + $this->setIfExists('redeemed_source', $data ?? [], null); + $this->setIfExists('redeemed_transaction_id', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('is_redeemed', $data ?? [], null); + $this->setIfExists('date_time_redeemed', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -373,6 +476,9 @@ public function getRecipientPhoneNumber() */ public function setRecipientPhoneNumber($recipient_phone_number) { + if (is_null($recipient_phone_number)) { + throw new \InvalidArgumentException('non-nullable recipient_phone_number cannot be null'); + } $this->container['recipient_phone_number'] = $recipient_phone_number; return $this; @@ -397,6 +503,9 @@ public function getRecipientEmailAddress() */ public function setRecipientEmailAddress($recipient_email_address) { + if (is_null($recipient_email_address)) { + throw new \InvalidArgumentException('non-nullable recipient_email_address cannot be null'); + } $this->container['recipient_email_address'] = $recipient_email_address; return $this; @@ -421,6 +530,9 @@ public function getRecipientMemberId() */ public function setRecipientMemberId($recipient_member_id) { + if (is_null($recipient_member_id)) { + throw new \InvalidArgumentException('non-nullable recipient_member_id cannot be null'); + } $this->container['recipient_member_id'] = $recipient_member_id; return $this; @@ -445,6 +557,9 @@ public function getIsComp() */ public function setIsComp($is_comp) { + if (is_null($is_comp)) { + throw new \InvalidArgumentException('non-nullable is_comp cannot be null'); + } $this->container['is_comp'] = $is_comp; return $this; @@ -453,7 +568,7 @@ public function setIsComp($is_comp) /** * Gets quantity * - * @return double|null + * @return float|null */ public function getQuantity() { @@ -463,14 +578,17 @@ public function getQuantity() /** * Sets quantity * - * @param double|null $quantity The number of tickets allocated to the recipient. + * @param float|null $quantity The number of tickets allocated to the recipient. * * @return self */ public function setQuantity($quantity) { + if (is_null($quantity)) { + throw new \InvalidArgumentException('non-nullable quantity cannot be null'); + } - if (!is_null($quantity) && ($quantity < 1)) { + if (($quantity < 1)) { throw new \InvalidArgumentException('invalid value for $quantity when calling Ticket., must be bigger than or equal to 1.'); } @@ -498,6 +616,9 @@ public function getPerformanceId() */ public function setPerformanceId($performance_id) { + if (is_null($performance_id)) { + throw new \InvalidArgumentException('non-nullable performance_id cannot be null'); + } $this->container['performance_id'] = $performance_id; return $this; @@ -506,7 +627,7 @@ public function setPerformanceId($performance_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -516,12 +637,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -546,6 +670,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -570,6 +697,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -594,6 +724,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -618,14 +751,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Ticket., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Ticket., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Ticket., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Ticket., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -652,6 +788,9 @@ public function getIsClaimed() */ public function setIsClaimed($is_claimed) { + if (is_null($is_claimed)) { + throw new \InvalidArgumentException('non-nullable is_claimed cannot be null'); + } $this->container['is_claimed'] = $is_claimed; return $this; @@ -676,6 +815,9 @@ public function getDateTimeClaimed() */ public function setDateTimeClaimed($date_time_claimed) { + if (is_null($date_time_claimed)) { + throw new \InvalidArgumentException('non-nullable date_time_claimed cannot be null'); + } $this->container['date_time_claimed'] = $date_time_claimed; return $this; @@ -700,6 +842,9 @@ public function getClaimedByPhoneNumber() */ public function setClaimedByPhoneNumber($claimed_by_phone_number) { + if (is_null($claimed_by_phone_number)) { + throw new \InvalidArgumentException('non-nullable claimed_by_phone_number cannot be null'); + } $this->container['claimed_by_phone_number'] = $claimed_by_phone_number; return $this; @@ -724,6 +869,9 @@ public function getRedeemedSource() */ public function setRedeemedSource($redeemed_source) { + if (is_null($redeemed_source)) { + throw new \InvalidArgumentException('non-nullable redeemed_source cannot be null'); + } $this->container['redeemed_source'] = $redeemed_source; return $this; @@ -748,6 +896,9 @@ public function getRedeemedTransactionId() */ public function setRedeemedTransactionId($redeemed_transaction_id) { + if (is_null($redeemed_transaction_id)) { + throw new \InvalidArgumentException('non-nullable redeemed_transaction_id cannot be null'); + } $this->container['redeemed_transaction_id'] = $redeemed_transaction_id; return $this; @@ -772,6 +923,9 @@ public function getTransactionType() */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -796,6 +950,9 @@ public function getRegisterId() */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -820,6 +977,9 @@ public function getIsRedeemed() */ public function setIsRedeemed($is_redeemed) { + if (is_null($is_redeemed)) { + throw new \InvalidArgumentException('non-nullable is_redeemed cannot be null'); + } $this->container['is_redeemed'] = $is_redeemed; return $this; @@ -844,6 +1004,9 @@ public function getDateTimeRedeemed() */ public function setDateTimeRedeemed($date_time_redeemed) { + if (is_null($date_time_redeemed)) { + throw new \InvalidArgumentException('non-nullable date_time_redeemed cannot be null'); + } $this->container['date_time_redeemed'] = $date_time_redeemed; return $this; @@ -855,7 +1018,7 @@ public function setDateTimeRedeemed($date_time_redeemed) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -867,6 +1030,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -880,7 +1044,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -896,7 +1060,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -908,6 +1072,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/TrustBundleStatuses.php b/lib/Model/TrustBundleStatuses.php index 122395d..f3e321f 100644 --- a/lib/Model/TrustBundleStatuses.php +++ b/lib/Model/TrustBundleStatuses.php @@ -2,7 +2,7 @@ /** * TrustBundleStatuses * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -43,15 +43,15 @@ class TrustBundleStatuses /** * Possible values of this enum */ - const DRAFT = 'draft'; + public const DRAFT = 'draft'; - const PENDING_REVIEW = 'pending-review'; + public const PENDING_REVIEW = 'pending-review'; - const IN_REVIEW = 'in-review'; + public const IN_REVIEW = 'in-review'; - const TWILIO_REJECTED = 'twilio-rejected'; + public const TWILIO_REJECTED = 'twilio-rejected'; - const TWILIO_APPROVED = 'twilio-approved'; + public const TWILIO_APPROVED = 'twilio-approved'; /** * Gets allowable values of the enum diff --git a/lib/Model/UpdateEmailNotificationPreferenceRequest.php b/lib/Model/UpdateEmailNotificationPreferenceRequest.php new file mode 100644 index 0000000..af6f4bd --- /dev/null +++ b/lib/Model/UpdateEmailNotificationPreferenceRequest.php @@ -0,0 +1,410 @@ + + */ +class UpdateEmailNotificationPreferenceRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updateEmailNotificationPreference_request'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'is_email_notification_disabled' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'is_email_notification_disabled' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'is_email_notification_disabled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'is_email_notification_disabled' => 'isEmailNotificationDisabled' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'is_email_notification_disabled' => 'setIsEmailNotificationDisabled' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'is_email_notification_disabled' => 'getIsEmailNotificationDisabled' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('is_email_notification_disabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets is_email_notification_disabled + * + * @return bool|null + */ + public function getIsEmailNotificationDisabled() + { + return $this->container['is_email_notification_disabled']; + } + + /** + * Sets is_email_notification_disabled + * + * @param bool|null $is_email_notification_disabled is_email_notification_disabled + * + * @return self + */ + public function setIsEmailNotificationDisabled($is_email_notification_disabled) + { + if (is_null($is_email_notification_disabled)) { + throw new \InvalidArgumentException('non-nullable is_email_notification_disabled cannot be null'); + } + $this->container['is_email_notification_disabled'] = $is_email_notification_disabled; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UpdateStaticVoucherCampaignWithVoucher.php b/lib/Model/UpdateStaticVoucherCampaignWithVoucher.php index 4a12b07..59f2c71 100644 --- a/lib/Model/UpdateStaticVoucherCampaignWithVoucher.php +++ b/lib/Model/UpdateStaticVoucherCampaignWithVoucher.php @@ -2,7 +2,7 @@ /** * UpdateStaticVoucherCampaignWithVoucher * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class UpdateStaticVoucherCampaignWithVoucher implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class UpdateStaticVoucherCampaignWithVoucher implements ModelInterface, ArrayAcc protected static $openAPITypes = [ 'title' => 'string', 'notes' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'display_value' => 'string', 'merchants_reference_id' => 'string', 'valid_only_at_pos_register_ids' => 'string[]', @@ -72,7 +70,7 @@ class UpdateStaticVoucherCampaignWithVoucher implements ModelInterface, ArrayAcc 'member_id' => 'string', 'offer_amount_cents' => 'int', 'cell_phone' => 'string', - 'voucher_id' => 'string' + 'voucher_id' => '\OpenAPI\Client\Model\UpdateStaticVoucherCampaignWithVoucherVoucherID' ]; /** @@ -98,6 +96,34 @@ class UpdateStaticVoucherCampaignWithVoucher implements ModelInterface, ArrayAcc 'voucher_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'notes' => false, + 'value_type' => false, + 'display_value' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'start_date_time' => false, + 'expiration_date_time' => false, + 'member_id' => false, + 'offer_amount_cents' => false, + 'cell_phone' => false, + 'voucher_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -118,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -239,19 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['start_date_time'] = $data['start_date_time'] ?? null; - $this->container['expiration_date_time'] = $data['expiration_date_time'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['offer_amount_cents'] = $data['offer_amount_cents'] ?? null; - $this->container['cell_phone'] = $data['cell_phone'] ?? null; - $this->container['voucher_id'] = $data['voucher_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('start_date_time', $data ?? [], null); + $this->setIfExists('expiration_date_time', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('offer_amount_cents', $data ?? [], null); + $this->setIfExists('cell_phone', $data ?? [], null); + $this->setIfExists('voucher_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -345,6 +441,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling UpdateStaticVoucherCampaignWithVoucher., must be bigger than or equal to 1.'); @@ -374,6 +473,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -382,7 +484,7 @@ public function setNotes($notes) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -392,12 +494,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -422,6 +527,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } $this->container['display_value'] = $display_value; return $this; @@ -446,6 +554,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -470,6 +581,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -494,14 +608,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling UpdateStaticVoucherCampaignWithVoucher., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling UpdateStaticVoucherCampaignWithVoucher., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling UpdateStaticVoucherCampaignWithVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling UpdateStaticVoucherCampaignWithVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -528,6 +645,9 @@ public function getStartDateTime() */ public function setStartDateTime($start_date_time) { + if (is_null($start_date_time)) { + throw new \InvalidArgumentException('non-nullable start_date_time cannot be null'); + } $this->container['start_date_time'] = $start_date_time; return $this; @@ -552,6 +672,9 @@ public function getExpirationDateTime() */ public function setExpirationDateTime($expiration_date_time) { + if (is_null($expiration_date_time)) { + throw new \InvalidArgumentException('non-nullable expiration_date_time cannot be null'); + } $this->container['expiration_date_time'] = $expiration_date_time; return $this; @@ -576,9 +699,12 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling UpdateStaticVoucherCampaignWithVoucher., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling UpdateStaticVoucherCampaignWithVoucher., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -605,6 +731,9 @@ public function getOfferAmountCents() */ public function setOfferAmountCents($offer_amount_cents) { + if (is_null($offer_amount_cents)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents cannot be null'); + } if (($offer_amount_cents < 0)) { throw new \InvalidArgumentException('invalid value for $offer_amount_cents when calling UpdateStaticVoucherCampaignWithVoucher., must be bigger than or equal to 0.'); @@ -634,6 +763,9 @@ public function getCellPhone() */ public function setCellPhone($cell_phone) { + if (is_null($cell_phone)) { + throw new \InvalidArgumentException('non-nullable cell_phone cannot be null'); + } $this->container['cell_phone'] = $cell_phone; return $this; @@ -642,7 +774,7 @@ public function setCellPhone($cell_phone) /** * Gets voucher_id * - * @return string + * @return \OpenAPI\Client\Model\UpdateStaticVoucherCampaignWithVoucherVoucherID */ public function getVoucherId() { @@ -652,12 +784,15 @@ public function getVoucherId() /** * Sets voucher_id * - * @param string $voucher_id voucher_id + * @param \OpenAPI\Client\Model\UpdateStaticVoucherCampaignWithVoucherVoucherID $voucher_id voucher_id * * @return self */ public function setVoucherId($voucher_id) { + if (is_null($voucher_id)) { + throw new \InvalidArgumentException('non-nullable voucher_id cannot be null'); + } $this->container['voucher_id'] = $voucher_id; return $this; @@ -669,7 +804,7 @@ public function setVoucherId($voucher_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -681,6 +816,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -694,7 +830,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -710,7 +846,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -722,6 +858,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/UpdateStaticVoucherCampaignWithVoucherVoucherID.php b/lib/Model/UpdateStaticVoucherCampaignWithVoucherVoucherID.php new file mode 100644 index 0000000..4eb0499 --- /dev/null +++ b/lib/Model/UpdateStaticVoucherCampaignWithVoucherVoucherID.php @@ -0,0 +1,382 @@ + + */ +class UpdateStaticVoucherCampaignWithVoucherVoucherID implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updateStaticVoucherCampaignWithVoucher_voucherID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/VSCampaignGeneratedMessage.php b/lib/Model/VSCampaignGeneratedMessage.php index d290958..1854f65 100644 --- a/lib/Model/VSCampaignGeneratedMessage.php +++ b/lib/Model/VSCampaignGeneratedMessage.php @@ -2,7 +2,7 @@ /** * VSCampaignGeneratedMessage * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class VSCampaignGeneratedMessage implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class VSCampaignGeneratedMessage implements ModelInterface, ArrayAccess, \JsonSe 'cell_phone_number' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'static_voucher_id' => false, + 'message' => false, + 'cell_phone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['static_voucher_id'] = $data['static_voucher_id'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['cell_phone_number'] = $data['cell_phone_number'] ?? null; + $this->setIfExists('static_voucher_id', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('cell_phone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -258,14 +344,17 @@ public function getStaticVoucherId() */ public function setStaticVoucherId($static_voucher_id) { + if (is_null($static_voucher_id)) { + throw new \InvalidArgumentException('non-nullable static_voucher_id cannot be null'); + } if ((mb_strlen($static_voucher_id) > 10)) { throw new \InvalidArgumentException('invalid length for $static_voucher_id when calling VSCampaignGeneratedMessage., must be smaller than or equal to 10.'); } if ((mb_strlen($static_voucher_id) < 10)) { throw new \InvalidArgumentException('invalid length for $static_voucher_id when calling VSCampaignGeneratedMessage., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $static_voucher_id))) { - throw new \InvalidArgumentException("invalid value for $static_voucher_id when calling VSCampaignGeneratedMessage., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($static_voucher_id)))) { + throw new \InvalidArgumentException("invalid value for \$static_voucher_id when calling VSCampaignGeneratedMessage., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['static_voucher_id'] = $static_voucher_id; @@ -292,6 +381,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -316,6 +408,9 @@ public function getCellPhoneNumber() */ public function setCellPhoneNumber($cell_phone_number) { + if (is_null($cell_phone_number)) { + throw new \InvalidArgumentException('non-nullable cell_phone_number cannot be null'); + } $this->container['cell_phone_number'] = $cell_phone_number; return $this; @@ -327,7 +422,7 @@ public function setCellPhoneNumber($cell_phone_number) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -339,6 +434,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -352,7 +448,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -368,7 +464,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -380,6 +476,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/VSCampaignGeneratedMessagePagination.php b/lib/Model/VSCampaignGeneratedMessagePagination.php index 8f90f7d..9cf9b50 100644 --- a/lib/Model/VSCampaignGeneratedMessagePagination.php +++ b/lib/Model/VSCampaignGeneratedMessagePagination.php @@ -2,7 +2,7 @@ /** * VSCampaignGeneratedMessagePagination * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class VSCampaignGeneratedMessagePagination implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,8 +59,8 @@ class VSCampaignGeneratedMessagePagination implements ModelInterface, ArrayAcces */ protected static $openAPITypes = [ 'results' => '\OpenAPI\Client\Model\VSCampaignGeneratedMessage[]', - 'length' => 'double', - 'total' => 'double' + 'length' => 'float', + 'total' => 'float' ]; /** @@ -78,6 +76,24 @@ class VSCampaignGeneratedMessagePagination implements ModelInterface, ArrayAcces 'total' => 'double' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'results' => false, + 'length' => false, + 'total' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['results'] = $data['results'] ?? null; - $this->container['length'] = $data['length'] ?? null; - $this->container['total'] = $data['total'] ?? null; + $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('length', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +332,9 @@ public function getResults() */ public function setResults($results) { + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); + } $this->container['results'] = $results; return $this; @@ -254,7 +343,7 @@ public function setResults($results) /** * Gets length * - * @return double + * @return float */ public function getLength() { @@ -264,12 +353,15 @@ public function getLength() /** * Sets length * - * @param double $length Denotes the length of the results array + * @param float $length Denotes the length of the results array * * @return self */ public function setLength($length) { + if (is_null($length)) { + throw new \InvalidArgumentException('non-nullable length cannot be null'); + } $this->container['length'] = $length; return $this; @@ -278,7 +370,7 @@ public function setLength($length) /** * Gets total * - * @return double + * @return float */ public function getTotal() { @@ -288,12 +380,15 @@ public function getTotal() /** * Sets total * - * @param double $total Denotes the total number of records present in the database + * @param float $total Denotes the total number of records present in the database * * @return self */ public function setTotal($total) { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } $this->container['total'] = $total; return $this; @@ -305,7 +400,7 @@ public function setTotal($total) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/VSDynamicVoucherStatus.php b/lib/Model/VSDynamicVoucherStatus.php index 58a0f8c..50a5197 100644 --- a/lib/Model/VSDynamicVoucherStatus.php +++ b/lib/Model/VSDynamicVoucherStatus.php @@ -2,7 +2,7 @@ /** * VSDynamicVoucherStatus * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class VSDynamicVoucherStatus implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class VSDynamicVoucherStatus implements ModelInterface, ArrayAccess, \JsonSerial ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -181,6 +247,24 @@ public function __construct(array $data = null) { } + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + /** * Show all the invalid properties with reasons. * @@ -211,7 +295,7 @@ public function valid() * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -223,6 +307,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -236,7 +321,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -252,7 +337,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -264,6 +349,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Video.php b/lib/Model/Video.php index 8bb50c5..5914104 100644 --- a/lib/Model/Video.php +++ b/lib/Model/Video.php @@ -2,7 +2,7 @@ /** * Video * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Video implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -65,7 +63,7 @@ class Video implements ModelInterface, ArrayAccess, \JsonSerializable 'order_number' => 'int', 'media_url' => 'string', 'additional_info_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -92,6 +90,31 @@ class Video implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -334,6 +427,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling Video., must be bigger than or equal to 1.'); @@ -363,6 +459,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling Video., must be bigger than or equal to 1.'); @@ -392,6 +491,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling Video., must be bigger than or equal to 1.'); @@ -421,6 +523,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } if ((mb_strlen($media_url) < 12)) { throw new \InvalidArgumentException('invalid length for $media_url when calling Video., must be bigger than or equal to 12.'); @@ -450,6 +555,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -458,7 +566,7 @@ public function setAdditionalInfoUrl($additional_info_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -468,12 +576,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -498,6 +609,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -522,6 +636,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -546,6 +663,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -570,14 +690,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Video., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling Video., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling Video., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling Video., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -591,7 +714,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -603,6 +726,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -616,7 +740,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -632,7 +756,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -644,6 +768,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/VirtualBusinessCard.php b/lib/Model/VirtualBusinessCard.php index a8bb14c..5610440 100644 --- a/lib/Model/VirtualBusinessCard.php +++ b/lib/Model/VirtualBusinessCard.php @@ -2,7 +2,7 @@ /** * VirtualBusinessCard * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class VirtualBusinessCard implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -73,7 +71,7 @@ class VirtualBusinessCard implements ModelInterface, ArrayAccess, \JsonSerializa 'linked_in' => 'string', 'whats_app' => 'string', 'avatar_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -108,6 +106,39 @@ class VirtualBusinessCard implements ModelInterface, ArrayAccess, \JsonSerializa 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email_address' => false, + 'designation' => false, + 'phone_number' => false, + 'introduction' => false, + 'instagram' => false, + 'facebook' => false, + 'you_tube' => false, + 'twitter' => false, + 'linked_in' => false, + 'whats_app' => false, + 'avatar_url' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -128,6 +159,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -264,24 +347,42 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['designation'] = $data['designation'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['introduction'] = $data['introduction'] ?? null; - $this->container['instagram'] = $data['instagram'] ?? null; - $this->container['facebook'] = $data['facebook'] ?? null; - $this->container['you_tube'] = $data['you_tube'] ?? null; - $this->container['twitter'] = $data['twitter'] ?? null; - $this->container['linked_in'] = $data['linked_in'] ?? null; - $this->container['whats_app'] = $data['whats_app'] ?? null; - $this->container['avatar_url'] = $data['avatar_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('designation', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('introduction', $data ?? [], null); + $this->setIfExists('instagram', $data ?? [], null); + $this->setIfExists('facebook', $data ?? [], null); + $this->setIfExists('you_tube', $data ?? [], null); + $this->setIfExists('twitter', $data ?? [], null); + $this->setIfExists('linked_in', $data ?? [], null); + $this->setIfExists('whats_app', $data ?? [], null); + $this->setIfExists('avatar_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -393,6 +494,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling VirtualBusinessCard., must be bigger than or equal to 1.'); @@ -422,6 +526,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling VirtualBusinessCard., must be bigger than or equal to 1.'); @@ -451,6 +558,9 @@ public function getEmailAddress() */ public function setEmailAddress($email_address) { + if (is_null($email_address)) { + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + } if ((mb_strlen($email_address) < 1)) { throw new \InvalidArgumentException('invalid length for $email_address when calling VirtualBusinessCard., must be bigger than or equal to 1.'); @@ -480,6 +590,9 @@ public function getDesignation() */ public function setDesignation($designation) { + if (is_null($designation)) { + throw new \InvalidArgumentException('non-nullable designation cannot be null'); + } if ((mb_strlen($designation) < 1)) { throw new \InvalidArgumentException('invalid length for $designation when calling VirtualBusinessCard., must be bigger than or equal to 1.'); @@ -509,6 +622,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } if ((mb_strlen($phone_number) < 1)) { throw new \InvalidArgumentException('invalid length for $phone_number when calling VirtualBusinessCard., must be bigger than or equal to 1.'); @@ -538,8 +654,11 @@ public function getIntroduction() */ public function setIntroduction($introduction) { + if (is_null($introduction)) { + throw new \InvalidArgumentException('non-nullable introduction cannot be null'); + } - if (!is_null($introduction) && (mb_strlen($introduction) < 0)) { + if ((mb_strlen($introduction) < 0)) { throw new \InvalidArgumentException('invalid length for $introduction when calling VirtualBusinessCard., must be bigger than or equal to 0.'); } @@ -567,6 +686,9 @@ public function getInstagram() */ public function setInstagram($instagram) { + if (is_null($instagram)) { + throw new \InvalidArgumentException('non-nullable instagram cannot be null'); + } $this->container['instagram'] = $instagram; @@ -593,6 +715,9 @@ public function getFacebook() */ public function setFacebook($facebook) { + if (is_null($facebook)) { + throw new \InvalidArgumentException('non-nullable facebook cannot be null'); + } $this->container['facebook'] = $facebook; @@ -619,6 +744,9 @@ public function getYouTube() */ public function setYouTube($you_tube) { + if (is_null($you_tube)) { + throw new \InvalidArgumentException('non-nullable you_tube cannot be null'); + } $this->container['you_tube'] = $you_tube; @@ -645,6 +773,9 @@ public function getTwitter() */ public function setTwitter($twitter) { + if (is_null($twitter)) { + throw new \InvalidArgumentException('non-nullable twitter cannot be null'); + } $this->container['twitter'] = $twitter; @@ -671,6 +802,9 @@ public function getLinkedIn() */ public function setLinkedIn($linked_in) { + if (is_null($linked_in)) { + throw new \InvalidArgumentException('non-nullable linked_in cannot be null'); + } $this->container['linked_in'] = $linked_in; @@ -697,6 +831,9 @@ public function getWhatsApp() */ public function setWhatsApp($whats_app) { + if (is_null($whats_app)) { + throw new \InvalidArgumentException('non-nullable whats_app cannot be null'); + } $this->container['whats_app'] = $whats_app; @@ -723,6 +860,9 @@ public function getAvatarUrl() */ public function setAvatarUrl($avatar_url) { + if (is_null($avatar_url)) { + throw new \InvalidArgumentException('non-nullable avatar_url cannot be null'); + } $this->container['avatar_url'] = $avatar_url; @@ -733,7 +873,7 @@ public function setAvatarUrl($avatar_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -743,12 +883,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -773,6 +916,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -797,6 +943,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -821,6 +970,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -845,14 +997,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling VirtualBusinessCard., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling VirtualBusinessCard., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling VirtualBusinessCard., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling VirtualBusinessCard., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -866,7 +1021,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -878,6 +1033,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -891,7 +1047,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -907,7 +1063,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -919,6 +1075,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTA2PApplicationUpdateParams.php b/lib/Model/WTA2PApplicationUpdateParams.php index 23788cd..be344cd 100644 --- a/lib/Model/WTA2PApplicationUpdateParams.php +++ b/lib/Model/WTA2PApplicationUpdateParams.php @@ -2,7 +2,7 @@ /** * WTA2PApplicationUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTA2PApplicationUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -120,6 +118,45 @@ class WTA2PApplicationUpdateParams implements ModelInterface, ArrayAccess, \Json 'phone_number' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'business_name' => false, + 'business_type' => false, + 'business_classification' => false, + 'business_industry' => false, + 'tax_id_type' => false, + 'tax_id' => false, + 'website_url' => false, + 'social_media_url' => false, + 'regions_of_operation' => false, + 'stock_exchange' => false, + 'stock_ticker' => false, + 'messaging_volume_high' => false, + 'address1' => false, + 'address2' => false, + 'city' => false, + 'state' => false, + 'postal_code' => false, + 'country' => false, + 'first_name' => false, + 'last_name' => false, + 'email' => false, + 'job_title' => false, + 'job_position' => false, + 'phone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -140,6 +177,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -294,30 +383,48 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['business_name'] = $data['business_name'] ?? null; - $this->container['business_type'] = $data['business_type'] ?? null; - $this->container['business_classification'] = $data['business_classification'] ?? null; - $this->container['business_industry'] = $data['business_industry'] ?? null; - $this->container['tax_id_type'] = $data['tax_id_type'] ?? null; - $this->container['tax_id'] = $data['tax_id'] ?? null; - $this->container['website_url'] = $data['website_url'] ?? null; - $this->container['social_media_url'] = $data['social_media_url'] ?? null; - $this->container['regions_of_operation'] = $data['regions_of_operation'] ?? null; - $this->container['stock_exchange'] = $data['stock_exchange'] ?? null; - $this->container['stock_ticker'] = $data['stock_ticker'] ?? null; - $this->container['messaging_volume_high'] = $data['messaging_volume_high'] ?? null; - $this->container['address1'] = $data['address1'] ?? null; - $this->container['address2'] = $data['address2'] ?? null; - $this->container['city'] = $data['city'] ?? null; - $this->container['state'] = $data['state'] ?? null; - $this->container['postal_code'] = $data['postal_code'] ?? null; - $this->container['country'] = $data['country'] ?? null; - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['job_title'] = $data['job_title'] ?? null; - $this->container['job_position'] = $data['job_position'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; + $this->setIfExists('business_name', $data ?? [], null); + $this->setIfExists('business_type', $data ?? [], null); + $this->setIfExists('business_classification', $data ?? [], null); + $this->setIfExists('business_industry', $data ?? [], null); + $this->setIfExists('tax_id_type', $data ?? [], null); + $this->setIfExists('tax_id', $data ?? [], null); + $this->setIfExists('website_url', $data ?? [], null); + $this->setIfExists('social_media_url', $data ?? [], null); + $this->setIfExists('regions_of_operation', $data ?? [], null); + $this->setIfExists('stock_exchange', $data ?? [], null); + $this->setIfExists('stock_ticker', $data ?? [], null); + $this->setIfExists('messaging_volume_high', $data ?? [], null); + $this->setIfExists('address1', $data ?? [], null); + $this->setIfExists('address2', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('job_title', $data ?? [], null); + $this->setIfExists('job_position', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -490,6 +597,9 @@ public function getBusinessName() */ public function setBusinessName($business_name) { + if (is_null($business_name)) { + throw new \InvalidArgumentException('non-nullable business_name cannot be null'); + } if ((mb_strlen($business_name) < 1)) { throw new \InvalidArgumentException('invalid length for $business_name when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 1.'); @@ -519,6 +629,9 @@ public function getBusinessType() */ public function setBusinessType($business_type) { + if (is_null($business_type)) { + throw new \InvalidArgumentException('non-nullable business_type cannot be null'); + } $this->container['business_type'] = $business_type; return $this; @@ -543,6 +656,9 @@ public function getBusinessClassification() */ public function setBusinessClassification($business_classification) { + if (is_null($business_classification)) { + throw new \InvalidArgumentException('non-nullable business_classification cannot be null'); + } $this->container['business_classification'] = $business_classification; return $this; @@ -567,6 +683,9 @@ public function getBusinessIndustry() */ public function setBusinessIndustry($business_industry) { + if (is_null($business_industry)) { + throw new \InvalidArgumentException('non-nullable business_industry cannot be null'); + } $this->container['business_industry'] = $business_industry; return $this; @@ -591,6 +710,9 @@ public function getTaxIdType() */ public function setTaxIdType($tax_id_type) { + if (is_null($tax_id_type)) { + throw new \InvalidArgumentException('non-nullable tax_id_type cannot be null'); + } $this->container['tax_id_type'] = $tax_id_type; return $this; @@ -615,6 +737,9 @@ public function getTaxId() */ public function setTaxId($tax_id) { + if (is_null($tax_id)) { + throw new \InvalidArgumentException('non-nullable tax_id cannot be null'); + } if ((mb_strlen($tax_id) < 1)) { throw new \InvalidArgumentException('invalid length for $tax_id when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 1.'); @@ -644,6 +769,9 @@ public function getWebsiteUrl() */ public function setWebsiteUrl($website_url) { + if (is_null($website_url)) { + throw new \InvalidArgumentException('non-nullable website_url cannot be null'); + } if ((mb_strlen($website_url) < 1)) { throw new \InvalidArgumentException('invalid length for $website_url when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 1.'); @@ -673,6 +801,9 @@ public function getSocialMediaUrl() */ public function setSocialMediaUrl($social_media_url) { + if (is_null($social_media_url)) { + throw new \InvalidArgumentException('non-nullable social_media_url cannot be null'); + } if ((mb_strlen($social_media_url) < 1)) { throw new \InvalidArgumentException('invalid length for $social_media_url when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 1.'); @@ -702,6 +833,9 @@ public function getRegionsOfOperation() */ public function setRegionsOfOperation($regions_of_operation) { + if (is_null($regions_of_operation)) { + throw new \InvalidArgumentException('non-nullable regions_of_operation cannot be null'); + } $this->container['regions_of_operation'] = $regions_of_operation; @@ -728,6 +862,9 @@ public function getStockExchange() */ public function setStockExchange($stock_exchange) { + if (is_null($stock_exchange)) { + throw new \InvalidArgumentException('non-nullable stock_exchange cannot be null'); + } $this->container['stock_exchange'] = $stock_exchange; return $this; @@ -752,8 +889,11 @@ public function getStockTicker() */ public function setStockTicker($stock_ticker) { + if (is_null($stock_ticker)) { + throw new \InvalidArgumentException('non-nullable stock_ticker cannot be null'); + } - if (!is_null($stock_ticker) && (mb_strlen($stock_ticker) < 0)) { + if ((mb_strlen($stock_ticker) < 0)) { throw new \InvalidArgumentException('invalid length for $stock_ticker when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 0.'); } @@ -781,6 +921,11 @@ public function getMessagingVolumeHigh() */ public function setMessagingVolumeHigh($messaging_volume_high) { + if (is_null($messaging_volume_high)) { + throw new \InvalidArgumentException('non-nullable messaging_volume_high cannot be null'); + } + + $this->container['messaging_volume_high'] = $messaging_volume_high; return $this; @@ -805,6 +950,9 @@ public function getAddress1() */ public function setAddress1($address1) { + if (is_null($address1)) { + throw new \InvalidArgumentException('non-nullable address1 cannot be null'); + } if ((mb_strlen($address1) < 1)) { throw new \InvalidArgumentException('invalid length for $address1 when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 1.'); @@ -834,8 +982,11 @@ public function getAddress2() */ public function setAddress2($address2) { + if (is_null($address2)) { + throw new \InvalidArgumentException('non-nullable address2 cannot be null'); + } - if (!is_null($address2) && (mb_strlen($address2) < 0)) { + if ((mb_strlen($address2) < 0)) { throw new \InvalidArgumentException('invalid length for $address2 when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 0.'); } @@ -863,6 +1014,9 @@ public function getCity() */ public function setCity($city) { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } if ((mb_strlen($city) < 3)) { throw new \InvalidArgumentException('invalid length for $city when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 3.'); @@ -892,6 +1046,9 @@ public function getState() */ public function setState($state) { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } if ((mb_strlen($state) < 1)) { throw new \InvalidArgumentException('invalid length for $state when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 1.'); @@ -921,6 +1078,9 @@ public function getPostalCode() */ public function setPostalCode($postal_code) { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } if ((mb_strlen($postal_code) < 4)) { throw new \InvalidArgumentException('invalid length for $postal_code when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 4.'); @@ -950,6 +1110,9 @@ public function getCountry() */ public function setCountry($country) { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } if ((mb_strlen($country) < 2)) { throw new \InvalidArgumentException('invalid length for $country when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 2.'); @@ -979,6 +1142,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 1.'); @@ -1008,6 +1174,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 1.'); @@ -1037,6 +1206,9 @@ public function getEmail() */ public function setEmail($email) { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } if ((mb_strlen($email) < 6)) { throw new \InvalidArgumentException('invalid length for $email when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 6.'); @@ -1066,6 +1238,9 @@ public function getJobTitle() */ public function setJobTitle($job_title) { + if (is_null($job_title)) { + throw new \InvalidArgumentException('non-nullable job_title cannot be null'); + } if ((mb_strlen($job_title) < 2)) { throw new \InvalidArgumentException('invalid length for $job_title when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 2.'); @@ -1095,6 +1270,9 @@ public function getJobPosition() */ public function setJobPosition($job_position) { + if (is_null($job_position)) { + throw new \InvalidArgumentException('non-nullable job_position cannot be null'); + } $this->container['job_position'] = $job_position; return $this; @@ -1119,6 +1297,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } if ((mb_strlen($phone_number) < 7)) { throw new \InvalidArgumentException('invalid length for $phone_number when calling WTA2PApplicationUpdateParams., must be bigger than or equal to 7.'); @@ -1135,7 +1316,7 @@ public function setPhoneNumber($phone_number) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1147,6 +1328,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1160,7 +1342,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1176,7 +1358,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1188,6 +1370,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAdvertisementCredit.php b/lib/Model/WTAdvertisementCredit.php index 4c8d156..f54ddcf 100644 --- a/lib/Model/WTAdvertisementCredit.php +++ b/lib/Model/WTAdvertisementCredit.php @@ -2,7 +2,7 @@ /** * WTAdvertisementCredit * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAdvertisementCredit implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,12 +59,12 @@ class WTAdvertisementCredit implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'title' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'payment_design_id' => 'string', 'max_uses' => 'int', 'discount_value' => 'int', 'employee_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -98,6 +96,34 @@ class WTAdvertisementCredit implements ModelInterface, ArrayAccess, \JsonSeriali 'discount_value_string' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'value_type' => false, + 'payment_design_id' => false, + 'max_uses' => false, + 'discount_value' => false, + 'employee_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'discount_value_decimal' => false, + 'discount_value_string' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -118,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -239,19 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['max_uses'] = $data['max_uses'] ?? null; - $this->container['discount_value'] = $data['discount_value'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['discount_value_decimal'] = $data['discount_value_decimal'] ?? null; - $this->container['discount_value_string'] = $data['discount_value_string'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('max_uses', $data ?? [], null); + $this->setIfExists('discount_value', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('discount_value_decimal', $data ?? [], null); + $this->setIfExists('discount_value_string', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -320,14 +416,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -392,6 +480,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTAdvertisementCredit., must be bigger than or equal to 1.'); @@ -405,7 +496,7 @@ public function setTitle($title) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -415,12 +506,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -445,14 +539,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTAdvertisementCredit., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTAdvertisementCredit., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling WTAdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling WTAdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -479,6 +576,9 @@ public function getMaxUses() */ public function setMaxUses($max_uses) { + if (is_null($max_uses)) { + throw new \InvalidArgumentException('non-nullable max_uses cannot be null'); + } if (($max_uses < 0)) { throw new \InvalidArgumentException('invalid value for $max_uses when calling WTAdvertisementCredit., must be bigger than or equal to 0.'); @@ -508,6 +608,9 @@ public function getDiscountValue() */ public function setDiscountValue($discount_value) { + if (is_null($discount_value)) { + throw new \InvalidArgumentException('non-nullable discount_value cannot be null'); + } if (($discount_value < 0)) { throw new \InvalidArgumentException('invalid value for $discount_value when calling WTAdvertisementCredit., must be bigger than or equal to 0.'); @@ -537,14 +640,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTAdvertisementCredit., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTAdvertisementCredit., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling WTAdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling WTAdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -555,7 +661,7 @@ public function setEmployeeId($employee_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -565,19 +671,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTAdvertisementCredit., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTAdvertisementCredit., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -602,14 +704,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTAdvertisementCredit., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTAdvertisementCredit., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTAdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTAdvertisementCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -636,6 +741,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -660,6 +768,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -684,6 +795,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -708,6 +822,9 @@ public function getDiscountValueDecimal() */ public function setDiscountValueDecimal($discount_value_decimal) { + if (is_null($discount_value_decimal)) { + throw new \InvalidArgumentException('non-nullable discount_value_decimal cannot be null'); + } $this->container['discount_value_decimal'] = $discount_value_decimal; return $this; @@ -732,6 +849,9 @@ public function getDiscountValueString() */ public function setDiscountValueString($discount_value_string) { + if (is_null($discount_value_string)) { + throw new \InvalidArgumentException('non-nullable discount_value_string cannot be null'); + } $this->container['discount_value_string'] = $discount_value_string; return $this; @@ -743,7 +863,7 @@ public function setDiscountValueString($discount_value_string) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -755,6 +875,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -768,7 +889,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -784,7 +905,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -796,6 +917,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAdvertisementCreditCreateParams.php b/lib/Model/WTAdvertisementCreditCreateParams.php index e6edabf..5fa414a 100644 --- a/lib/Model/WTAdvertisementCreditCreateParams.php +++ b/lib/Model/WTAdvertisementCreditCreateParams.php @@ -2,7 +2,7 @@ /** * WTAdvertisementCreditCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAdvertisementCreditCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,7 +59,7 @@ class WTAdvertisementCreditCreateParams implements ModelInterface, ArrayAccess, */ protected static $openAPITypes = [ 'title' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'payment_design_id' => 'string', 'max_uses' => 'int', 'discount_value' => 'int' @@ -82,6 +80,26 @@ class WTAdvertisementCreditCreateParams implements ModelInterface, ArrayAccess, 'discount_value' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'value_type' => false, + 'payment_design_id' => false, + 'max_uses' => false, + 'discount_value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['max_uses'] = $data['max_uses'] ?? null; - $this->container['discount_value'] = $data['discount_value'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('max_uses', $data ?? [], null); + $this->setIfExists('discount_value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -288,6 +376,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTAdvertisementCreditCreateParams., must be bigger than or equal to 1.'); @@ -301,7 +392,7 @@ public function setTitle($title) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -311,12 +402,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -341,14 +435,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTAdvertisementCreditCreateParams., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTAdvertisementCreditCreateParams., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling WTAdvertisementCreditCreateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling WTAdvertisementCreditCreateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -375,6 +472,9 @@ public function getMaxUses() */ public function setMaxUses($max_uses) { + if (is_null($max_uses)) { + throw new \InvalidArgumentException('non-nullable max_uses cannot be null'); + } if (($max_uses < 0)) { throw new \InvalidArgumentException('invalid value for $max_uses when calling WTAdvertisementCreditCreateParams., must be bigger than or equal to 0.'); @@ -404,6 +504,9 @@ public function getDiscountValue() */ public function setDiscountValue($discount_value) { + if (is_null($discount_value)) { + throw new \InvalidArgumentException('non-nullable discount_value cannot be null'); + } if (($discount_value < 1)) { throw new \InvalidArgumentException('invalid value for $discount_value when calling WTAdvertisementCreditCreateParams., must be bigger than or equal to 1.'); @@ -420,7 +523,7 @@ public function setDiscountValue($discount_value) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -432,6 +535,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -445,7 +549,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -461,7 +565,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -473,6 +577,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAdvertisementCreditScan.php b/lib/Model/WTAdvertisementCreditScan.php index 46cf664..47b2973 100644 --- a/lib/Model/WTAdvertisementCreditScan.php +++ b/lib/Model/WTAdvertisementCreditScan.php @@ -2,7 +2,7 @@ /** * WTAdvertisementCreditScan * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAdvertisementCreditScan implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,9 +58,9 @@ class WTAdvertisementCreditScan implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', - 'transaction_type' => 'string', - 'register_id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', + 'transaction_type' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType', + 'register_id' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID', 'redeemed_source' => 'string', 'redeemed_transaction_id' => 'string', 'redeemed_amount' => 'int', @@ -118,6 +116,44 @@ class WTAdvertisementCreditScan implements ModelInterface, ArrayAccess, \JsonSer 'date_time_refunded' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'transaction_type' => false, + 'register_id' => false, + 'redeemed_source' => false, + 'redeemed_transaction_id' => false, + 'redeemed_amount' => false, + 'is_redeemed' => false, + 'refunded_transaction_id' => false, + 'refunded_amount' => false, + 'status' => false, + 'authorized_against_check_number' => false, + 'authorized_amount' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'advertisement_credit_id' => false, + 'redeemed_amount_decimal' => false, + 'redeemed_amount_string' => false, + 'authorized_amount_decimal' => false, + 'authorized_amount_string' => false, + 'date_time_redeemed' => true, + 'date_time_refunded' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -138,6 +174,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -289,29 +377,47 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['redeemed_source'] = $data['redeemed_source'] ?? null; - $this->container['redeemed_transaction_id'] = $data['redeemed_transaction_id'] ?? null; - $this->container['redeemed_amount'] = $data['redeemed_amount'] ?? null; - $this->container['is_redeemed'] = $data['is_redeemed'] ?? null; - $this->container['refunded_transaction_id'] = $data['refunded_transaction_id'] ?? null; - $this->container['refunded_amount'] = $data['refunded_amount'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['authorized_against_check_number'] = $data['authorized_against_check_number'] ?? null; - $this->container['authorized_amount'] = $data['authorized_amount'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['advertisement_credit_id'] = $data['advertisement_credit_id'] ?? null; - $this->container['redeemed_amount_decimal'] = $data['redeemed_amount_decimal'] ?? null; - $this->container['redeemed_amount_string'] = $data['redeemed_amount_string'] ?? null; - $this->container['authorized_amount_decimal'] = $data['authorized_amount_decimal'] ?? null; - $this->container['authorized_amount_string'] = $data['authorized_amount_string'] ?? null; - $this->container['date_time_redeemed'] = $data['date_time_redeemed'] ?? null; - $this->container['date_time_refunded'] = $data['date_time_refunded'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('redeemed_source', $data ?? [], null); + $this->setIfExists('redeemed_transaction_id', $data ?? [], null); + $this->setIfExists('redeemed_amount', $data ?? [], null); + $this->setIfExists('is_redeemed', $data ?? [], null); + $this->setIfExists('refunded_transaction_id', $data ?? [], null); + $this->setIfExists('refunded_amount', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('authorized_against_check_number', $data ?? [], null); + $this->setIfExists('authorized_amount', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('advertisement_credit_id', $data ?? [], null); + $this->setIfExists('redeemed_amount_decimal', $data ?? [], null); + $this->setIfExists('redeemed_amount_string', $data ?? [], null); + $this->setIfExists('authorized_amount_decimal', $data ?? [], null); + $this->setIfExists('authorized_amount_string', $data ?? [], null); + $this->setIfExists('date_time_redeemed', $data ?? [], null); + $this->setIfExists('date_time_refunded', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -326,14 +432,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['transaction_type'] === null) { $invalidProperties[] = "'transaction_type' can't be null"; } @@ -454,7 +552,7 @@ public function valid() /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -464,19 +562,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTAdvertisementCreditScan., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTAdvertisementCreditScan., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -485,7 +579,7 @@ public function setId($id) /** * Gets transaction_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType */ public function getTransactionType() { @@ -495,12 +589,15 @@ public function getTransactionType() /** * Sets transaction_type * - * @param string $transaction_type The type of the transaction - only redemption at the moment + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType $transaction_type transaction_type * * @return self */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -509,7 +606,7 @@ public function setTransactionType($transaction_type) /** * Gets register_id * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID */ public function getRegisterId() { @@ -519,12 +616,15 @@ public function getRegisterId() /** * Sets register_id * - * @param string $register_id The ID of the register where the transaction occurred + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID $register_id register_id * * @return self */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -549,6 +649,9 @@ public function getRedeemedSource() */ public function setRedeemedSource($redeemed_source) { + if (is_null($redeemed_source)) { + throw new \InvalidArgumentException('non-nullable redeemed_source cannot be null'); + } $this->container['redeemed_source'] = $redeemed_source; return $this; @@ -573,6 +676,9 @@ public function getRedeemedTransactionId() */ public function setRedeemedTransactionId($redeemed_transaction_id) { + if (is_null($redeemed_transaction_id)) { + throw new \InvalidArgumentException('non-nullable redeemed_transaction_id cannot be null'); + } $this->container['redeemed_transaction_id'] = $redeemed_transaction_id; return $this; @@ -597,6 +703,9 @@ public function getRedeemedAmount() */ public function setRedeemedAmount($redeemed_amount) { + if (is_null($redeemed_amount)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount cannot be null'); + } if (($redeemed_amount < 0)) { throw new \InvalidArgumentException('invalid value for $redeemed_amount when calling WTAdvertisementCreditScan., must be bigger than or equal to 0.'); @@ -626,6 +735,9 @@ public function getIsRedeemed() */ public function setIsRedeemed($is_redeemed) { + if (is_null($is_redeemed)) { + throw new \InvalidArgumentException('non-nullable is_redeemed cannot be null'); + } $this->container['is_redeemed'] = $is_redeemed; return $this; @@ -650,6 +762,9 @@ public function getRefundedTransactionId() */ public function setRefundedTransactionId($refunded_transaction_id) { + if (is_null($refunded_transaction_id)) { + throw new \InvalidArgumentException('non-nullable refunded_transaction_id cannot be null'); + } $this->container['refunded_transaction_id'] = $refunded_transaction_id; return $this; @@ -674,6 +789,9 @@ public function getRefundedAmount() */ public function setRefundedAmount($refunded_amount) { + if (is_null($refunded_amount)) { + throw new \InvalidArgumentException('non-nullable refunded_amount cannot be null'); + } if (($refunded_amount < 0)) { throw new \InvalidArgumentException('invalid value for $refunded_amount when calling WTAdvertisementCreditScan., must be bigger than or equal to 0.'); @@ -703,6 +821,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -727,6 +848,9 @@ public function getAuthorizedAgainstCheckNumber() */ public function setAuthorizedAgainstCheckNumber($authorized_against_check_number) { + if (is_null($authorized_against_check_number)) { + throw new \InvalidArgumentException('non-nullable authorized_against_check_number cannot be null'); + } $this->container['authorized_against_check_number'] = $authorized_against_check_number; return $this; @@ -751,6 +875,9 @@ public function getAuthorizedAmount() */ public function setAuthorizedAmount($authorized_amount) { + if (is_null($authorized_amount)) { + throw new \InvalidArgumentException('non-nullable authorized_amount cannot be null'); + } if (($authorized_amount < 0)) { throw new \InvalidArgumentException('invalid value for $authorized_amount when calling WTAdvertisementCreditScan., must be bigger than or equal to 0.'); @@ -780,14 +907,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTAdvertisementCreditScan., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTAdvertisementCreditScan., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTAdvertisementCreditScan., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTAdvertisementCreditScan., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -814,6 +944,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -838,6 +971,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -862,6 +998,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -886,14 +1025,17 @@ public function getAdvertisementCreditId() */ public function setAdvertisementCreditId($advertisement_credit_id) { + if (is_null($advertisement_credit_id)) { + throw new \InvalidArgumentException('non-nullable advertisement_credit_id cannot be null'); + } if ((mb_strlen($advertisement_credit_id) > 10)) { throw new \InvalidArgumentException('invalid length for $advertisement_credit_id when calling WTAdvertisementCreditScan., must be smaller than or equal to 10.'); } if ((mb_strlen($advertisement_credit_id) < 10)) { throw new \InvalidArgumentException('invalid length for $advertisement_credit_id when calling WTAdvertisementCreditScan., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $advertisement_credit_id))) { - throw new \InvalidArgumentException("invalid value for $advertisement_credit_id when calling WTAdvertisementCreditScan., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($advertisement_credit_id)))) { + throw new \InvalidArgumentException("invalid value for \$advertisement_credit_id when calling WTAdvertisementCreditScan., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['advertisement_credit_id'] = $advertisement_credit_id; @@ -920,6 +1062,9 @@ public function getRedeemedAmountDecimal() */ public function setRedeemedAmountDecimal($redeemed_amount_decimal) { + if (is_null($redeemed_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount_decimal cannot be null'); + } $this->container['redeemed_amount_decimal'] = $redeemed_amount_decimal; return $this; @@ -944,6 +1089,9 @@ public function getRedeemedAmountString() */ public function setRedeemedAmountString($redeemed_amount_string) { + if (is_null($redeemed_amount_string)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount_string cannot be null'); + } $this->container['redeemed_amount_string'] = $redeemed_amount_string; return $this; @@ -968,6 +1116,9 @@ public function getAuthorizedAmountDecimal() */ public function setAuthorizedAmountDecimal($authorized_amount_decimal) { + if (is_null($authorized_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable authorized_amount_decimal cannot be null'); + } $this->container['authorized_amount_decimal'] = $authorized_amount_decimal; return $this; @@ -992,6 +1143,9 @@ public function getAuthorizedAmountString() */ public function setAuthorizedAmountString($authorized_amount_string) { + if (is_null($authorized_amount_string)) { + throw new \InvalidArgumentException('non-nullable authorized_amount_string cannot be null'); + } $this->container['authorized_amount_string'] = $authorized_amount_string; return $this; @@ -1016,6 +1170,16 @@ public function getDateTimeRedeemed() */ public function setDateTimeRedeemed($date_time_redeemed) { + if (is_null($date_time_redeemed)) { + array_push($this->openAPINullablesSetToNull, 'date_time_redeemed'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_time_redeemed', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['date_time_redeemed'] = $date_time_redeemed; return $this; @@ -1040,6 +1204,16 @@ public function getDateTimeRefunded() */ public function setDateTimeRefunded($date_time_refunded) { + if (is_null($date_time_refunded)) { + array_push($this->openAPINullablesSetToNull, 'date_time_refunded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_time_refunded', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['date_time_refunded'] = $date_time_refunded; return $this; @@ -1051,7 +1225,7 @@ public function setDateTimeRefunded($date_time_refunded) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1063,6 +1237,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1076,7 +1251,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1092,7 +1267,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1104,6 +1279,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAdvertisementCreditUpdateParams.php b/lib/Model/WTAdvertisementCreditUpdateParams.php index 98a04c0..9e79403 100644 --- a/lib/Model/WTAdvertisementCreditUpdateParams.php +++ b/lib/Model/WTAdvertisementCreditUpdateParams.php @@ -2,7 +2,7 @@ /** * WTAdvertisementCreditUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAdvertisementCreditUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,7 +59,7 @@ class WTAdvertisementCreditUpdateParams implements ModelInterface, ArrayAccess, */ protected static $openAPITypes = [ 'title' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'payment_design_id' => 'string', 'max_uses' => 'int', 'discount_value' => 'int' @@ -82,6 +80,26 @@ class WTAdvertisementCreditUpdateParams implements ModelInterface, ArrayAccess, 'discount_value' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'value_type' => false, + 'payment_design_id' => false, + 'max_uses' => false, + 'discount_value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['max_uses'] = $data['max_uses'] ?? null; - $this->container['discount_value'] = $data['discount_value'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('max_uses', $data ?? [], null); + $this->setIfExists('discount_value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -288,6 +376,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTAdvertisementCreditUpdateParams., must be bigger than or equal to 1.'); @@ -301,7 +392,7 @@ public function setTitle($title) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -311,12 +402,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -341,14 +435,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTAdvertisementCreditUpdateParams., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTAdvertisementCreditUpdateParams., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling WTAdvertisementCreditUpdateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling WTAdvertisementCreditUpdateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -375,6 +472,9 @@ public function getMaxUses() */ public function setMaxUses($max_uses) { + if (is_null($max_uses)) { + throw new \InvalidArgumentException('non-nullable max_uses cannot be null'); + } if (($max_uses < 0)) { throw new \InvalidArgumentException('invalid value for $max_uses when calling WTAdvertisementCreditUpdateParams., must be bigger than or equal to 0.'); @@ -404,6 +504,9 @@ public function getDiscountValue() */ public function setDiscountValue($discount_value) { + if (is_null($discount_value)) { + throw new \InvalidArgumentException('non-nullable discount_value cannot be null'); + } if (($discount_value < 1)) { throw new \InvalidArgumentException('invalid value for $discount_value when calling WTAdvertisementCreditUpdateParams., must be bigger than or equal to 1.'); @@ -420,7 +523,7 @@ public function setDiscountValue($discount_value) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -432,6 +535,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -445,7 +549,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -461,7 +565,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -473,6 +577,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAmenityCreateParams.php b/lib/Model/WTAmenityCreateParams.php index e611de5..40ec17a 100644 --- a/lib/Model/WTAmenityCreateParams.php +++ b/lib/Model/WTAmenityCreateParams.php @@ -2,7 +2,7 @@ /** * WTAmenityCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAmenityCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTAmenityCreateParams implements ModelInterface, ArrayAccess, \JsonSeriali 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTAmenityCreateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTAmenityCreateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTAmenityCreateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAmenityUpdateParams.php b/lib/Model/WTAmenityUpdateParams.php index dd93947..418842e 100644 --- a/lib/Model/WTAmenityUpdateParams.php +++ b/lib/Model/WTAmenityUpdateParams.php @@ -2,7 +2,7 @@ /** * WTAmenityUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAmenityUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTAmenityUpdateParams implements ModelInterface, ArrayAccess, \JsonSeriali 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTAmenityUpdateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTAmenityUpdateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTAmenityUpdateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAuthenticationCheckSessionTokenStatusResponse.php b/lib/Model/WTAuthenticationCheckSessionTokenStatusResponse.php index 13e936b..f6b6c85 100644 --- a/lib/Model/WTAuthenticationCheckSessionTokenStatusResponse.php +++ b/lib/Model/WTAuthenticationCheckSessionTokenStatusResponse.php @@ -2,7 +2,7 @@ /** * WTAuthenticationCheckSessionTokenStatusResponse * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAuthenticationCheckSessionTokenStatusResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTAuthenticationCheckSessionTokenStatusResponse implements ModelInterface, 'status' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -163,7 +229,7 @@ public function getModelName() return self::$openAPIModelName; } - const STATUS_VALID = 'Valid'; + public const STATUS_VALID = 'Valid'; /** * Gets allowable values of the enum @@ -192,7 +258,25 @@ public function getStatusAllowableValues() */ public function __construct(array $data = null) { - $this->container['status'] = $data['status'] ?? null; + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -250,6 +334,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $allowedValues = $this->getStatusAllowableValues(); if (!in_array($status, $allowedValues, true)) { throw new \InvalidArgumentException( @@ -271,7 +358,7 @@ public function setStatus($status) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -283,6 +370,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -296,7 +384,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -312,7 +400,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -324,6 +412,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAuthenticationForgotPassword.php b/lib/Model/WTAuthenticationForgotPassword.php index a74d140..dd3afc0 100644 --- a/lib/Model/WTAuthenticationForgotPassword.php +++ b/lib/Model/WTAuthenticationForgotPassword.php @@ -2,7 +2,7 @@ /** * WTAuthenticationForgotPassword * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAuthenticationForgotPassword implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTAuthenticationForgotPassword implements ModelInterface, ArrayAccess, \Js 'email' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'email' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['email'] = $data['email'] ?? null; + $this->setIfExists('email', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -228,6 +312,9 @@ public function getEmail() */ public function setEmail($email) { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } $this->container['email'] = $email; return $this; @@ -239,7 +326,7 @@ public function setEmail($email) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -251,6 +338,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -264,7 +352,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -280,7 +368,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -292,6 +380,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAuthenticationLoginRequest.php b/lib/Model/WTAuthenticationLoginRequest.php index a6a3588..d1aee5a 100644 --- a/lib/Model/WTAuthenticationLoginRequest.php +++ b/lib/Model/WTAuthenticationLoginRequest.php @@ -2,7 +2,7 @@ /** * WTAuthenticationLoginRequest * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAuthenticationLoginRequest implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTAuthenticationLoginRequest implements ModelInterface, ArrayAccess, \Json 'password' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'username' => false, + 'password' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['username'] = $data['username'] ?? null; - $this->container['password'] = $data['password'] ?? null; + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -245,6 +330,9 @@ public function getUsername() */ public function setUsername($username) { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } if ((mb_strlen($username) < 1)) { throw new \InvalidArgumentException('invalid length for $username when calling WTAuthenticationLoginRequest., must be bigger than or equal to 1.'); @@ -274,6 +362,9 @@ public function getPassword() */ public function setPassword($password) { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } if ((mb_strlen($password) < 1)) { throw new \InvalidArgumentException('invalid length for $password when calling WTAuthenticationLoginRequest., must be bigger than or equal to 1.'); @@ -290,7 +381,7 @@ public function setPassword($password) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -302,6 +393,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -315,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -331,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -343,6 +435,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAuthenticationLoginResponse.php b/lib/Model/WTAuthenticationLoginResponse.php index f97ac03..27e66eb 100644 --- a/lib/Model/WTAuthenticationLoginResponse.php +++ b/lib/Model/WTAuthenticationLoginResponse.php @@ -2,7 +2,7 @@ /** * WTAuthenticationLoginResponse * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAuthenticationLoginResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -104,6 +102,37 @@ class WTAuthenticationLoginResponse implements ModelInterface, ArrayAccess, \Jso 'custom_domain' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'first_name' => false, + 'last_name' => false, + 'username' => false, + 'email' => false, + 'merchant_id' => false, + 'employee_id' => false, + 'profile_picture_url' => false, + 'job_title' => false, + 'department' => false, + 'merchant_name' => false, + 'merchant_currency_abbreviation' => false, + 'merchant_industry' => false, + 'custom_domain' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -124,6 +153,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -254,22 +335,40 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['username'] = $data['username'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['profile_picture_url'] = $data['profile_picture_url'] ?? null; - $this->container['job_title'] = $data['job_title'] ?? null; - $this->container['department'] = $data['department'] ?? null; - $this->container['merchant_name'] = $data['merchant_name'] ?? null; - $this->container['merchant_currency_abbreviation'] = $data['merchant_currency_abbreviation'] ?? null; - $this->container['merchant_industry'] = $data['merchant_industry'] ?? null; - $this->container['custom_domain'] = $data['custom_domain'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('profile_picture_url', $data ?? [], null); + $this->setIfExists('job_title', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('merchant_name', $data ?? [], null); + $this->setIfExists('merchant_currency_abbreviation', $data ?? [], null); + $this->setIfExists('merchant_industry', $data ?? [], null); + $this->setIfExists('custom_domain', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -357,6 +456,9 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -381,6 +483,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -405,6 +510,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -429,6 +537,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } $this->container['first_name'] = $first_name; return $this; @@ -453,6 +564,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } $this->container['last_name'] = $last_name; return $this; @@ -477,6 +591,9 @@ public function getUsername() */ public function setUsername($username) { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } $this->container['username'] = $username; return $this; @@ -501,6 +618,9 @@ public function getEmail() */ public function setEmail($email) { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } $this->container['email'] = $email; return $this; @@ -525,6 +645,9 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } $this->container['merchant_id'] = $merchant_id; return $this; @@ -549,6 +672,9 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } $this->container['employee_id'] = $employee_id; return $this; @@ -573,6 +699,9 @@ public function getProfilePictureUrl() */ public function setProfilePictureUrl($profile_picture_url) { + if (is_null($profile_picture_url)) { + throw new \InvalidArgumentException('non-nullable profile_picture_url cannot be null'); + } $this->container['profile_picture_url'] = $profile_picture_url; return $this; @@ -597,6 +726,9 @@ public function getJobTitle() */ public function setJobTitle($job_title) { + if (is_null($job_title)) { + throw new \InvalidArgumentException('non-nullable job_title cannot be null'); + } $this->container['job_title'] = $job_title; return $this; @@ -621,6 +753,9 @@ public function getDepartment() */ public function setDepartment($department) { + if (is_null($department)) { + throw new \InvalidArgumentException('non-nullable department cannot be null'); + } $this->container['department'] = $department; return $this; @@ -645,6 +780,9 @@ public function getMerchantName() */ public function setMerchantName($merchant_name) { + if (is_null($merchant_name)) { + throw new \InvalidArgumentException('non-nullable merchant_name cannot be null'); + } $this->container['merchant_name'] = $merchant_name; return $this; @@ -669,6 +807,9 @@ public function getMerchantCurrencyAbbreviation() */ public function setMerchantCurrencyAbbreviation($merchant_currency_abbreviation) { + if (is_null($merchant_currency_abbreviation)) { + throw new \InvalidArgumentException('non-nullable merchant_currency_abbreviation cannot be null'); + } $this->container['merchant_currency_abbreviation'] = $merchant_currency_abbreviation; return $this; @@ -693,6 +834,9 @@ public function getMerchantIndustry() */ public function setMerchantIndustry($merchant_industry) { + if (is_null($merchant_industry)) { + throw new \InvalidArgumentException('non-nullable merchant_industry cannot be null'); + } $this->container['merchant_industry'] = $merchant_industry; return $this; @@ -717,6 +861,9 @@ public function getCustomDomain() */ public function setCustomDomain($custom_domain) { + if (is_null($custom_domain)) { + throw new \InvalidArgumentException('non-nullable custom_domain cannot be null'); + } $this->container['custom_domain'] = $custom_domain; return $this; @@ -728,7 +875,7 @@ public function setCustomDomain($custom_domain) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -740,6 +887,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -753,7 +901,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -769,7 +917,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -781,6 +929,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAuthenticationRegister.php b/lib/Model/WTAuthenticationRegister.php index ca923d2..3a7652e 100644 --- a/lib/Model/WTAuthenticationRegister.php +++ b/lib/Model/WTAuthenticationRegister.php @@ -2,7 +2,7 @@ /** * WTAuthenticationRegister * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAuthenticationRegister implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -75,7 +73,9 @@ class WTAuthenticationRegister implements ModelInterface, ArrayAccess, \JsonSeri 'zip' => 'string', 'country' => 'string', 'phone_number' => 'string', - 'ein' => 'string' + 'ein' => 'string', + 'ga_client_id' => 'string', + 'ga_measurement_id' => 'string' ]; /** @@ -101,9 +101,44 @@ class WTAuthenticationRegister implements ModelInterface, ArrayAccess, \JsonSeri 'zip' => null, 'country' => null, 'phone_number' => null, - 'ein' => null + 'ein' => null, + 'ga_client_id' => null, + 'ga_measurement_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email' => false, + 'password' => false, + 'hear_about_us' => false, + 'hear_about_us_details' => false, + 'company_name' => false, + 'merchant_type' => false, + 'street_address1' => false, + 'street_address2' => false, + 'city' => false, + 'state' => false, + 'zip' => false, + 'country' => false, + 'phone_number' => false, + 'ein' => false, + 'ga_client_id' => false, + 'ga_measurement_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -124,6 +159,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -146,7 +233,9 @@ public static function openAPIFormats() 'zip' => 'zip', 'country' => 'country', 'phone_number' => 'phoneNumber', - 'ein' => 'ein' + 'ein' => 'ein', + 'ga_client_id' => 'ga_client_id', + 'ga_measurement_id' => 'ga_measurement_id' ]; /** @@ -170,7 +259,9 @@ public static function openAPIFormats() 'zip' => 'setZip', 'country' => 'setCountry', 'phone_number' => 'setPhoneNumber', - 'ein' => 'setEin' + 'ein' => 'setEin', + 'ga_client_id' => 'setGaClientId', + 'ga_measurement_id' => 'setGaMeasurementId' ]; /** @@ -194,7 +285,9 @@ public static function openAPIFormats() 'zip' => 'getZip', 'country' => 'getCountry', 'phone_number' => 'getPhoneNumber', - 'ein' => 'getEin' + 'ein' => 'getEin', + 'ga_client_id' => 'getGaClientId', + 'ga_measurement_id' => 'getGaMeasurementId' ]; /** @@ -254,22 +347,42 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['password'] = $data['password'] ?? null; - $this->container['hear_about_us'] = $data['hear_about_us'] ?? null; - $this->container['hear_about_us_details'] = $data['hear_about_us_details'] ?? null; - $this->container['company_name'] = $data['company_name'] ?? null; - $this->container['merchant_type'] = $data['merchant_type'] ?? null; - $this->container['street_address1'] = $data['street_address1'] ?? null; - $this->container['street_address2'] = $data['street_address2'] ?? null; - $this->container['city'] = $data['city'] ?? null; - $this->container['state'] = $data['state'] ?? null; - $this->container['zip'] = $data['zip'] ?? null; - $this->container['country'] = $data['country'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['ein'] = $data['ein'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('hear_about_us', $data ?? [], null); + $this->setIfExists('hear_about_us_details', $data ?? [], null); + $this->setIfExists('company_name', $data ?? [], null); + $this->setIfExists('merchant_type', $data ?? [], null); + $this->setIfExists('street_address1', $data ?? [], null); + $this->setIfExists('street_address2', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('zip', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('ein', $data ?? [], null); + $this->setIfExists('ga_client_id', $data ?? [], null); + $this->setIfExists('ga_measurement_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -354,6 +467,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } $this->container['first_name'] = $first_name; return $this; @@ -378,6 +494,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } $this->container['last_name'] = $last_name; return $this; @@ -402,6 +521,9 @@ public function getEmail() */ public function setEmail($email) { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } $this->container['email'] = $email; return $this; @@ -426,6 +548,9 @@ public function getPassword() */ public function setPassword($password) { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } $this->container['password'] = $password; return $this; @@ -450,6 +575,9 @@ public function getHearAboutUs() */ public function setHearAboutUs($hear_about_us) { + if (is_null($hear_about_us)) { + throw new \InvalidArgumentException('non-nullable hear_about_us cannot be null'); + } $this->container['hear_about_us'] = $hear_about_us; return $this; @@ -474,6 +602,9 @@ public function getHearAboutUsDetails() */ public function setHearAboutUsDetails($hear_about_us_details) { + if (is_null($hear_about_us_details)) { + throw new \InvalidArgumentException('non-nullable hear_about_us_details cannot be null'); + } $this->container['hear_about_us_details'] = $hear_about_us_details; return $this; @@ -498,6 +629,9 @@ public function getCompanyName() */ public function setCompanyName($company_name) { + if (is_null($company_name)) { + throw new \InvalidArgumentException('non-nullable company_name cannot be null'); + } $this->container['company_name'] = $company_name; return $this; @@ -522,6 +656,9 @@ public function getMerchantType() */ public function setMerchantType($merchant_type) { + if (is_null($merchant_type)) { + throw new \InvalidArgumentException('non-nullable merchant_type cannot be null'); + } $this->container['merchant_type'] = $merchant_type; return $this; @@ -546,6 +683,9 @@ public function getStreetAddress1() */ public function setStreetAddress1($street_address1) { + if (is_null($street_address1)) { + throw new \InvalidArgumentException('non-nullable street_address1 cannot be null'); + } $this->container['street_address1'] = $street_address1; return $this; @@ -570,6 +710,9 @@ public function getStreetAddress2() */ public function setStreetAddress2($street_address2) { + if (is_null($street_address2)) { + throw new \InvalidArgumentException('non-nullable street_address2 cannot be null'); + } $this->container['street_address2'] = $street_address2; return $this; @@ -594,6 +737,9 @@ public function getCity() */ public function setCity($city) { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } $this->container['city'] = $city; return $this; @@ -618,6 +764,9 @@ public function getState() */ public function setState($state) { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } $this->container['state'] = $state; return $this; @@ -642,6 +791,9 @@ public function getZip() */ public function setZip($zip) { + if (is_null($zip)) { + throw new \InvalidArgumentException('non-nullable zip cannot be null'); + } $this->container['zip'] = $zip; return $this; @@ -666,6 +818,9 @@ public function getCountry() */ public function setCountry($country) { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } $this->container['country'] = $country; return $this; @@ -690,6 +845,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -714,10 +872,67 @@ public function getEin() */ public function setEin($ein) { + if (is_null($ein)) { + throw new \InvalidArgumentException('non-nullable ein cannot be null'); + } $this->container['ein'] = $ein; return $this; } + + /** + * Gets ga_client_id + * + * @return string|null + */ + public function getGaClientId() + { + return $this->container['ga_client_id']; + } + + /** + * Sets ga_client_id + * + * @param string|null $ga_client_id ga_client_id + * + * @return self + */ + public function setGaClientId($ga_client_id) + { + if (is_null($ga_client_id)) { + throw new \InvalidArgumentException('non-nullable ga_client_id cannot be null'); + } + $this->container['ga_client_id'] = $ga_client_id; + + return $this; + } + + /** + * Gets ga_measurement_id + * + * @return string|null + */ + public function getGaMeasurementId() + { + return $this->container['ga_measurement_id']; + } + + /** + * Sets ga_measurement_id + * + * @param string|null $ga_measurement_id ga_measurement_id + * + * @return self + */ + public function setGaMeasurementId($ga_measurement_id) + { + if (is_null($ga_measurement_id)) { + throw new \InvalidArgumentException('non-nullable ga_measurement_id cannot be null'); + } + $this->container['ga_measurement_id'] = $ga_measurement_id; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -725,7 +940,7 @@ public function setEin($ein) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -737,6 +952,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -750,7 +966,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -766,7 +982,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -778,6 +994,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAuthenticationRequestResetPassword.php b/lib/Model/WTAuthenticationRequestResetPassword.php index 6107fa4..182e82a 100644 --- a/lib/Model/WTAuthenticationRequestResetPassword.php +++ b/lib/Model/WTAuthenticationRequestResetPassword.php @@ -2,7 +2,7 @@ /** * WTAuthenticationRequestResetPassword * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAuthenticationRequestResetPassword implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTAuthenticationRequestResetPassword implements ModelInterface, ArrayAcces 'employee_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['employee_id'] = $data['employee_id'] ?? null; + $this->setIfExists('employee_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -240,14 +324,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTAuthenticationRequestResetPassword., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTAuthenticationRequestResetPassword., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling WTAuthenticationRequestResetPassword., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling WTAuthenticationRequestResetPassword., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -261,7 +348,7 @@ public function setEmployeeId($employee_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -273,6 +360,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -286,7 +374,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -302,7 +390,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -314,6 +402,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAuthenticationResetPassword.php b/lib/Model/WTAuthenticationResetPassword.php index dca5234..a0c5dd7 100644 --- a/lib/Model/WTAuthenticationResetPassword.php +++ b/lib/Model/WTAuthenticationResetPassword.php @@ -2,7 +2,7 @@ /** * WTAuthenticationResetPassword * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAuthenticationResetPassword implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTAuthenticationResetPassword implements ModelInterface, ArrayAccess, \Jso 'token' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'username' => false, + 'password' => false, + 'token' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['username'] = $data['username'] ?? null; - $this->container['password'] = $data['password'] ?? null; - $this->container['token'] = $data['token'] ?? null; + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -254,6 +340,9 @@ public function getUsername() */ public function setUsername($username) { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } if ((mb_strlen($username) < 1)) { throw new \InvalidArgumentException('invalid length for $username when calling WTAuthenticationResetPassword., must be bigger than or equal to 1.'); @@ -283,6 +372,9 @@ public function getPassword() */ public function setPassword($password) { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } if ((mb_strlen($password) < 1)) { throw new \InvalidArgumentException('invalid length for $password when calling WTAuthenticationResetPassword., must be bigger than or equal to 1.'); @@ -312,6 +404,9 @@ public function getToken() */ public function setToken($token) { + if (is_null($token)) { + throw new \InvalidArgumentException('non-nullable token cannot be null'); + } $this->container['token'] = $token; return $this; @@ -323,7 +418,7 @@ public function setToken($token) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -335,6 +430,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -348,7 +444,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -364,7 +460,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -376,6 +472,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTAuthenticationSSOLoginForDiscourse.php b/lib/Model/WTAuthenticationSSOLoginForDiscourse.php index bbdf687..ef03e37 100644 --- a/lib/Model/WTAuthenticationSSOLoginForDiscourse.php +++ b/lib/Model/WTAuthenticationSSOLoginForDiscourse.php @@ -2,7 +2,7 @@ /** * WTAuthenticationSSOLoginForDiscourse * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTAuthenticationSSOLoginForDiscourse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -80,6 +78,25 @@ class WTAuthenticationSSOLoginForDiscourse implements ModelInterface, ArrayAcces 'sig_payload' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'username' => false, + 'password' => false, + 'sso_payload' => false, + 'sig_payload' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +117,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -194,10 +263,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['username'] = $data['username'] ?? null; - $this->container['password'] = $data['password'] ?? null; - $this->container['sso_payload'] = $data['sso_payload'] ?? null; - $this->container['sig_payload'] = $data['sig_payload'] ?? null; + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + $this->setIfExists('sso_payload', $data ?? [], null); + $this->setIfExists('sig_payload', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -263,6 +350,9 @@ public function getUsername() */ public function setUsername($username) { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } if ((mb_strlen($username) < 1)) { throw new \InvalidArgumentException('invalid length for $username when calling WTAuthenticationSSOLoginForDiscourse., must be bigger than or equal to 1.'); @@ -292,6 +382,9 @@ public function getPassword() */ public function setPassword($password) { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } if ((mb_strlen($password) < 1)) { throw new \InvalidArgumentException('invalid length for $password when calling WTAuthenticationSSOLoginForDiscourse., must be bigger than or equal to 1.'); @@ -321,6 +414,9 @@ public function getSsoPayload() */ public function setSsoPayload($sso_payload) { + if (is_null($sso_payload)) { + throw new \InvalidArgumentException('non-nullable sso_payload cannot be null'); + } $this->container['sso_payload'] = $sso_payload; return $this; @@ -345,6 +441,9 @@ public function getSigPayload() */ public function setSigPayload($sig_payload) { + if (is_null($sig_payload)) { + throw new \InvalidArgumentException('non-nullable sig_payload cannot be null'); + } $this->container['sig_payload'] = $sig_payload; return $this; @@ -356,7 +455,7 @@ public function setSigPayload($sig_payload) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -368,6 +467,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -381,7 +481,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -397,7 +497,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -409,6 +509,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTBillingChangePlan.php b/lib/Model/WTBillingChangePlan.php index 7b61523..8688e01 100644 --- a/lib/Model/WTBillingChangePlan.php +++ b/lib/Model/WTBillingChangePlan.php @@ -2,7 +2,7 @@ /** * WTBillingChangePlan * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTBillingChangePlan implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTBillingChangePlan implements ModelInterface, ArrayAccess, \JsonSerializa 'plan_name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'plan_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['plan_name'] = $data['plan_name'] ?? null; + $this->setIfExists('plan_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -232,6 +316,9 @@ public function getPlanName() */ public function setPlanName($plan_name) { + if (is_null($plan_name)) { + throw new \InvalidArgumentException('non-nullable plan_name cannot be null'); + } if ((mb_strlen($plan_name) < 1)) { throw new \InvalidArgumentException('invalid length for $plan_name when calling WTBillingChangePlan., must be bigger than or equal to 1.'); @@ -248,7 +335,7 @@ public function setPlanName($plan_name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,6 +347,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -273,7 +361,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -289,7 +377,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -301,6 +389,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTBillingSavePaymentMethod.php b/lib/Model/WTBillingSavePaymentMethod.php index fe94622..b9db566 100644 --- a/lib/Model/WTBillingSavePaymentMethod.php +++ b/lib/Model/WTBillingSavePaymentMethod.php @@ -2,7 +2,7 @@ /** * WTBillingSavePaymentMethod * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTBillingSavePaymentMethod implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTBillingSavePaymentMethod implements ModelInterface, ArrayAccess, \JsonSe 'payment_method_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'payment_method_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['payment_method_id'] = $data['payment_method_id'] ?? null; + $this->setIfExists('payment_method_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -232,6 +316,9 @@ public function getPaymentMethodId() */ public function setPaymentMethodId($payment_method_id) { + if (is_null($payment_method_id)) { + throw new \InvalidArgumentException('non-nullable payment_method_id cannot be null'); + } if ((mb_strlen($payment_method_id) < 1)) { throw new \InvalidArgumentException('invalid length for $payment_method_id when calling WTBillingSavePaymentMethod., must be bigger than or equal to 1.'); @@ -248,7 +335,7 @@ public function setPaymentMethodId($payment_method_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,6 +347,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -273,7 +361,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -289,7 +377,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -301,6 +389,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTBillingVerifyPaymentMethodResponse.php b/lib/Model/WTBillingVerifyPaymentMethodResponse.php index 8c36331..ee1e58c 100644 --- a/lib/Model/WTBillingVerifyPaymentMethodResponse.php +++ b/lib/Model/WTBillingVerifyPaymentMethodResponse.php @@ -2,7 +2,7 @@ /** * WTBillingVerifyPaymentMethodResponse * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTBillingVerifyPaymentMethodResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTBillingVerifyPaymentMethodResponse implements ModelInterface, ArrayAcces 'subscription' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'is_payment_method_provided' => false, + 'subscription' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['is_payment_method_provided'] = $data['is_payment_method_provided'] ?? null; - $this->container['subscription'] = $data['subscription'] ?? null; + $this->setIfExists('is_payment_method_provided', $data ?? [], null); + $this->setIfExists('subscription', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -237,6 +322,9 @@ public function getIsPaymentMethodProvided() */ public function setIsPaymentMethodProvided($is_payment_method_provided) { + if (is_null($is_payment_method_provided)) { + throw new \InvalidArgumentException('non-nullable is_payment_method_provided cannot be null'); + } $this->container['is_payment_method_provided'] = $is_payment_method_provided; return $this; @@ -261,6 +349,9 @@ public function getSubscription() */ public function setSubscription($subscription) { + if (is_null($subscription)) { + throw new \InvalidArgumentException('non-nullable subscription cannot be null'); + } $this->container['subscription'] = $subscription; return $this; @@ -272,7 +363,7 @@ public function setSubscription($subscription) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -284,6 +375,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -297,7 +389,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -313,7 +405,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -325,6 +417,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTCountResult.php b/lib/Model/WTCountResult.php index 3783c21..fe02935 100644 --- a/lib/Model/WTCountResult.php +++ b/lib/Model/WTCountResult.php @@ -2,7 +2,7 @@ /** * WTCountResult * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTCountResult implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class WTCountResult implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'count' => 'double' + 'count' => 'float' ]; /** @@ -74,6 +72,22 @@ class WTCountResult implements ModelInterface, ArrayAccess, \JsonSerializable 'count' => 'double' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['count'] = $data['count'] ?? null; + $this->setIfExists('count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -212,7 +296,7 @@ public function valid() /** * Gets count * - * @return double + * @return float */ public function getCount() { @@ -222,12 +306,15 @@ public function getCount() /** * Sets count * - * @param double $count count + * @param float $count count * * @return self */ public function setCount($count) { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } $this->container['count'] = $count; return $this; @@ -239,7 +326,7 @@ public function setCount($count) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -251,6 +338,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -264,7 +352,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -280,7 +368,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -292,6 +380,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTCustomerSearchByMemberID.php b/lib/Model/WTCustomerSearchByMemberID.php index 756d358..de0ea82 100644 --- a/lib/Model/WTCustomerSearchByMemberID.php +++ b/lib/Model/WTCustomerSearchByMemberID.php @@ -2,7 +2,7 @@ /** * WTCustomerSearchByMemberID * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTCustomerSearchByMemberID implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTCustomerSearchByMemberID implements ModelInterface, ArrayAccess, \JsonSe 'member_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'member_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['member_id'] = $data['member_id'] ?? null; + $this->setIfExists('member_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -232,6 +316,9 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } if ((mb_strlen($member_id) < 1)) { throw new \InvalidArgumentException('invalid length for $member_id when calling WTCustomerSearchByMemberID., must be bigger than or equal to 1.'); @@ -248,7 +335,7 @@ public function setMemberId($member_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,6 +347,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -273,7 +361,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -289,7 +377,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -301,6 +389,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTCustomerSearchByPhoneNumber.php b/lib/Model/WTCustomerSearchByPhoneNumber.php index 24ffef6..8668493 100644 --- a/lib/Model/WTCustomerSearchByPhoneNumber.php +++ b/lib/Model/WTCustomerSearchByPhoneNumber.php @@ -2,7 +2,7 @@ /** * WTCustomerSearchByPhoneNumber * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTCustomerSearchByPhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTCustomerSearchByPhoneNumber implements ModelInterface, ArrayAccess, \Jso 'phone_number' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phone_number'] = $data['phone_number'] ?? null; + $this->setIfExists('phone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -232,6 +316,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } if ((mb_strlen($phone_number) < 1)) { throw new \InvalidArgumentException('invalid length for $phone_number when calling WTCustomerSearchByPhoneNumber., must be bigger than or equal to 1.'); @@ -248,7 +335,7 @@ public function setPhoneNumber($phone_number) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,6 +347,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -273,7 +361,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -289,7 +377,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -301,6 +389,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTDiningCreateParams.php b/lib/Model/WTDiningCreateParams.php index a74066e..8b6e5ff 100644 --- a/lib/Model/WTDiningCreateParams.php +++ b/lib/Model/WTDiningCreateParams.php @@ -2,7 +2,7 @@ /** * WTDiningCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTDiningCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTDiningCreateParams implements ModelInterface, ArrayAccess, \JsonSerializ 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTDiningCreateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTDiningCreateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTDiningCreateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTDiningUpdateParams.php b/lib/Model/WTDiningUpdateParams.php index f98a91c..c1a9ad5 100644 --- a/lib/Model/WTDiningUpdateParams.php +++ b/lib/Model/WTDiningUpdateParams.php @@ -2,7 +2,7 @@ /** * WTDiningUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTDiningUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTDiningUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializ 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTDiningUpdateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTDiningUpdateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTDiningUpdateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTDynamicVoucher.php b/lib/Model/WTDynamicVoucher.php index 2dc8840..397fe95 100644 --- a/lib/Model/WTDynamicVoucher.php +++ b/lib/Model/WTDynamicVoucher.php @@ -2,7 +2,7 @@ /** * WTDynamicVoucher * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTDynamicVoucher implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class WTDynamicVoucher implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'start_date' => '\DateTime', 'expiration_date' => '\DateTime', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'title' => 'string', 'notes' => 'string', 'merchants_reference_id' => 'string', @@ -87,11 +85,11 @@ class WTDynamicVoucher implements ModelInterface, ArrayAccess, \JsonSerializable 'starting_value_string' => 'string', 'max_budget_decimal' => 'string', 'max_budget_string' => 'string', - 'current_value' => 'double', + 'current_value' => 'float', 'current_value_decimal' => 'string', 'current_value_string' => 'string', - 'status' => 'string', - 'temporal_decrease_frequency_type' => 'string', + 'status' => '\OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus', + 'temporal_decrease_frequency_type' => '\OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType', 'summary' => '\OpenAPI\Client\Model\WTDynamicVoucherSummary' ]; @@ -138,6 +136,54 @@ class WTDynamicVoucher implements ModelInterface, ArrayAccess, \JsonSerializable 'summary' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'start_date' => false, + 'expiration_date' => false, + 'id' => false, + 'title' => false, + 'notes' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'employee_id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'starting_value' => false, + 'max_budget' => false, + 'temporal_decrease_amount' => false, + 'temporal_decrease_frequency' => false, + 'numerical_decrease_amount' => false, + 'numerical_decrease_frequency' => false, + 'temporal_decrease_amount_decimal' => false, + 'temporal_decrease_amount_string' => false, + 'numerical_decrease_amount_decimal' => false, + 'numerical_decrease_amount_string' => false, + 'starting_value_decimal' => false, + 'starting_value_string' => false, + 'max_budget_decimal' => false, + 'max_budget_string' => false, + 'current_value' => false, + 'current_value_decimal' => false, + 'current_value_string' => false, + 'status' => false, + 'temporal_decrease_frequency_type' => false, + 'summary' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -158,6 +204,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -339,39 +437,57 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['start_date'] = $data['start_date'] ?? null; - $this->container['expiration_date'] = $data['expiration_date'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['starting_value'] = $data['starting_value'] ?? null; - $this->container['max_budget'] = $data['max_budget'] ?? null; - $this->container['temporal_decrease_amount'] = $data['temporal_decrease_amount'] ?? null; - $this->container['temporal_decrease_frequency'] = $data['temporal_decrease_frequency'] ?? null; - $this->container['numerical_decrease_amount'] = $data['numerical_decrease_amount'] ?? null; - $this->container['numerical_decrease_frequency'] = $data['numerical_decrease_frequency'] ?? null; - $this->container['temporal_decrease_amount_decimal'] = $data['temporal_decrease_amount_decimal'] ?? null; - $this->container['temporal_decrease_amount_string'] = $data['temporal_decrease_amount_string'] ?? null; - $this->container['numerical_decrease_amount_decimal'] = $data['numerical_decrease_amount_decimal'] ?? null; - $this->container['numerical_decrease_amount_string'] = $data['numerical_decrease_amount_string'] ?? null; - $this->container['starting_value_decimal'] = $data['starting_value_decimal'] ?? null; - $this->container['starting_value_string'] = $data['starting_value_string'] ?? null; - $this->container['max_budget_decimal'] = $data['max_budget_decimal'] ?? null; - $this->container['max_budget_string'] = $data['max_budget_string'] ?? null; - $this->container['current_value'] = $data['current_value'] ?? null; - $this->container['current_value_decimal'] = $data['current_value_decimal'] ?? null; - $this->container['current_value_string'] = $data['current_value_string'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['temporal_decrease_frequency_type'] = $data['temporal_decrease_frequency_type'] ?? null; - $this->container['summary'] = $data['summary'] ?? null; + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('starting_value', $data ?? [], null); + $this->setIfExists('max_budget', $data ?? [], null); + $this->setIfExists('temporal_decrease_amount', $data ?? [], null); + $this->setIfExists('temporal_decrease_frequency', $data ?? [], null); + $this->setIfExists('numerical_decrease_amount', $data ?? [], null); + $this->setIfExists('numerical_decrease_frequency', $data ?? [], null); + $this->setIfExists('temporal_decrease_amount_decimal', $data ?? [], null); + $this->setIfExists('temporal_decrease_amount_string', $data ?? [], null); + $this->setIfExists('numerical_decrease_amount_decimal', $data ?? [], null); + $this->setIfExists('numerical_decrease_amount_string', $data ?? [], null); + $this->setIfExists('starting_value_decimal', $data ?? [], null); + $this->setIfExists('starting_value_string', $data ?? [], null); + $this->setIfExists('max_budget_decimal', $data ?? [], null); + $this->setIfExists('max_budget_string', $data ?? [], null); + $this->setIfExists('current_value', $data ?? [], null); + $this->setIfExists('current_value_decimal', $data ?? [], null); + $this->setIfExists('current_value_string', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('temporal_decrease_frequency_type', $data ?? [], null); + $this->setIfExists('summary', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -392,14 +508,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['title'] === null) { $invalidProperties[] = "'title' can't be null"; } @@ -576,6 +684,9 @@ public function getStartDate() */ public function setStartDate($start_date) { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } $this->container['start_date'] = $start_date; return $this; @@ -600,6 +711,9 @@ public function getExpirationDate() */ public function setExpirationDate($expiration_date) { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } $this->container['expiration_date'] = $expiration_date; return $this; @@ -608,7 +722,7 @@ public function setExpirationDate($expiration_date) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -618,19 +732,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTDynamicVoucher., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTDynamicVoucher., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -655,6 +765,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTDynamicVoucher., must be bigger than or equal to 1.'); @@ -684,6 +797,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -708,6 +824,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -732,6 +851,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -756,14 +878,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTDynamicVoucher., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTDynamicVoucher., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling WTDynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling WTDynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -790,14 +915,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTDynamicVoucher., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTDynamicVoucher., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling WTDynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling WTDynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -824,14 +952,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTDynamicVoucher., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTDynamicVoucher., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTDynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTDynamicVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -858,6 +989,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -882,6 +1016,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -906,6 +1043,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -930,6 +1070,9 @@ public function getStartingValue() */ public function setStartingValue($starting_value) { + if (is_null($starting_value)) { + throw new \InvalidArgumentException('non-nullable starting_value cannot be null'); + } if (($starting_value < 0)) { throw new \InvalidArgumentException('invalid value for $starting_value when calling WTDynamicVoucher., must be bigger than or equal to 0.'); @@ -959,6 +1102,9 @@ public function getMaxBudget() */ public function setMaxBudget($max_budget) { + if (is_null($max_budget)) { + throw new \InvalidArgumentException('non-nullable max_budget cannot be null'); + } if (($max_budget < 0)) { throw new \InvalidArgumentException('invalid value for $max_budget when calling WTDynamicVoucher., must be bigger than or equal to 0.'); @@ -988,6 +1134,9 @@ public function getTemporalDecreaseAmount() */ public function setTemporalDecreaseAmount($temporal_decrease_amount) { + if (is_null($temporal_decrease_amount)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_amount cannot be null'); + } if (($temporal_decrease_amount < 0)) { throw new \InvalidArgumentException('invalid value for $temporal_decrease_amount when calling WTDynamicVoucher., must be bigger than or equal to 0.'); @@ -1017,6 +1166,9 @@ public function getTemporalDecreaseFrequency() */ public function setTemporalDecreaseFrequency($temporal_decrease_frequency) { + if (is_null($temporal_decrease_frequency)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_frequency cannot be null'); + } if (($temporal_decrease_frequency < 0)) { throw new \InvalidArgumentException('invalid value for $temporal_decrease_frequency when calling WTDynamicVoucher., must be bigger than or equal to 0.'); @@ -1046,8 +1198,11 @@ public function getNumericalDecreaseAmount() */ public function setNumericalDecreaseAmount($numerical_decrease_amount) { + if (is_null($numerical_decrease_amount)) { + throw new \InvalidArgumentException('non-nullable numerical_decrease_amount cannot be null'); + } - if (!is_null($numerical_decrease_amount) && ($numerical_decrease_amount < 0)) { + if (($numerical_decrease_amount < 0)) { throw new \InvalidArgumentException('invalid value for $numerical_decrease_amount when calling WTDynamicVoucher., must be bigger than or equal to 0.'); } @@ -1075,8 +1230,11 @@ public function getNumericalDecreaseFrequency() */ public function setNumericalDecreaseFrequency($numerical_decrease_frequency) { + if (is_null($numerical_decrease_frequency)) { + throw new \InvalidArgumentException('non-nullable numerical_decrease_frequency cannot be null'); + } - if (!is_null($numerical_decrease_frequency) && ($numerical_decrease_frequency < 0)) { + if (($numerical_decrease_frequency < 0)) { throw new \InvalidArgumentException('invalid value for $numerical_decrease_frequency when calling WTDynamicVoucher., must be bigger than or equal to 0.'); } @@ -1104,6 +1262,9 @@ public function getTemporalDecreaseAmountDecimal() */ public function setTemporalDecreaseAmountDecimal($temporal_decrease_amount_decimal) { + if (is_null($temporal_decrease_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_amount_decimal cannot be null'); + } $this->container['temporal_decrease_amount_decimal'] = $temporal_decrease_amount_decimal; return $this; @@ -1128,6 +1289,9 @@ public function getTemporalDecreaseAmountString() */ public function setTemporalDecreaseAmountString($temporal_decrease_amount_string) { + if (is_null($temporal_decrease_amount_string)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_amount_string cannot be null'); + } $this->container['temporal_decrease_amount_string'] = $temporal_decrease_amount_string; return $this; @@ -1152,6 +1316,9 @@ public function getNumericalDecreaseAmountDecimal() */ public function setNumericalDecreaseAmountDecimal($numerical_decrease_amount_decimal) { + if (is_null($numerical_decrease_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable numerical_decrease_amount_decimal cannot be null'); + } $this->container['numerical_decrease_amount_decimal'] = $numerical_decrease_amount_decimal; return $this; @@ -1176,6 +1343,9 @@ public function getNumericalDecreaseAmountString() */ public function setNumericalDecreaseAmountString($numerical_decrease_amount_string) { + if (is_null($numerical_decrease_amount_string)) { + throw new \InvalidArgumentException('non-nullable numerical_decrease_amount_string cannot be null'); + } $this->container['numerical_decrease_amount_string'] = $numerical_decrease_amount_string; return $this; @@ -1200,6 +1370,9 @@ public function getStartingValueDecimal() */ public function setStartingValueDecimal($starting_value_decimal) { + if (is_null($starting_value_decimal)) { + throw new \InvalidArgumentException('non-nullable starting_value_decimal cannot be null'); + } $this->container['starting_value_decimal'] = $starting_value_decimal; return $this; @@ -1224,6 +1397,9 @@ public function getStartingValueString() */ public function setStartingValueString($starting_value_string) { + if (is_null($starting_value_string)) { + throw new \InvalidArgumentException('non-nullable starting_value_string cannot be null'); + } $this->container['starting_value_string'] = $starting_value_string; return $this; @@ -1248,6 +1424,9 @@ public function getMaxBudgetDecimal() */ public function setMaxBudgetDecimal($max_budget_decimal) { + if (is_null($max_budget_decimal)) { + throw new \InvalidArgumentException('non-nullable max_budget_decimal cannot be null'); + } $this->container['max_budget_decimal'] = $max_budget_decimal; return $this; @@ -1272,6 +1451,9 @@ public function getMaxBudgetString() */ public function setMaxBudgetString($max_budget_string) { + if (is_null($max_budget_string)) { + throw new \InvalidArgumentException('non-nullable max_budget_string cannot be null'); + } $this->container['max_budget_string'] = $max_budget_string; return $this; @@ -1280,7 +1462,7 @@ public function setMaxBudgetString($max_budget_string) /** * Gets current_value * - * @return double + * @return float */ public function getCurrentValue() { @@ -1290,12 +1472,15 @@ public function getCurrentValue() /** * Sets current_value * - * @param double $current_value current_value + * @param float $current_value current_value * * @return self */ public function setCurrentValue($current_value) { + if (is_null($current_value)) { + throw new \InvalidArgumentException('non-nullable current_value cannot be null'); + } $this->container['current_value'] = $current_value; return $this; @@ -1320,6 +1505,9 @@ public function getCurrentValueDecimal() */ public function setCurrentValueDecimal($current_value_decimal) { + if (is_null($current_value_decimal)) { + throw new \InvalidArgumentException('non-nullable current_value_decimal cannot be null'); + } $this->container['current_value_decimal'] = $current_value_decimal; return $this; @@ -1344,6 +1532,9 @@ public function getCurrentValueString() */ public function setCurrentValueString($current_value_string) { + if (is_null($current_value_string)) { + throw new \InvalidArgumentException('non-nullable current_value_string cannot be null'); + } $this->container['current_value_string'] = $current_value_string; return $this; @@ -1352,7 +1543,7 @@ public function setCurrentValueString($current_value_string) /** * Gets status * - * @return string + * @return \OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus */ public function getStatus() { @@ -1362,12 +1553,15 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param \OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus $status status * * @return self */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -1376,7 +1570,7 @@ public function setStatus($status) /** * Gets temporal_decrease_frequency_type * - * @return string + * @return \OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType */ public function getTemporalDecreaseFrequencyType() { @@ -1386,12 +1580,15 @@ public function getTemporalDecreaseFrequencyType() /** * Sets temporal_decrease_frequency_type * - * @param string $temporal_decrease_frequency_type temporal_decrease_frequency_type + * @param \OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType $temporal_decrease_frequency_type temporal_decrease_frequency_type * * @return self */ public function setTemporalDecreaseFrequencyType($temporal_decrease_frequency_type) { + if (is_null($temporal_decrease_frequency_type)) { + throw new \InvalidArgumentException('non-nullable temporal_decrease_frequency_type cannot be null'); + } $this->container['temporal_decrease_frequency_type'] = $temporal_decrease_frequency_type; return $this; @@ -1416,6 +1613,9 @@ public function getSummary() */ public function setSummary($summary) { + if (is_null($summary)) { + throw new \InvalidArgumentException('non-nullable summary cannot be null'); + } $this->container['summary'] = $summary; return $this; @@ -1427,7 +1627,7 @@ public function setSummary($summary) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1439,6 +1639,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1452,7 +1653,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1468,7 +1669,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1480,6 +1681,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTDynamicVoucherCreateParams.php b/lib/Model/WTDynamicVoucherCreateParams.php index c97ba8c..c0e2047 100644 --- a/lib/Model/WTDynamicVoucherCreateParams.php +++ b/lib/Model/WTDynamicVoucherCreateParams.php @@ -2,7 +2,7 @@ /** * WTDynamicVoucherCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTDynamicVoucherCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,9 +67,9 @@ class WTDynamicVoucherCreateParams implements ModelInterface, ArrayAccess, \Json 'max_budget' => 'int', 'decrease_amount' => 'int', 'frequency' => 'int', - 'frequency_type' => 'string', - 'decrease_by' => 'double', - 'decrease_every' => 'double' + 'frequency_type' => '\OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType', + 'decrease_by' => 'float', + 'decrease_every' => 'float' ]; /** @@ -96,6 +94,33 @@ class WTDynamicVoucherCreateParams implements ModelInterface, ArrayAccess, \Json 'decrease_every' => 'double' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'notes' => false, + 'payment_design_id' => false, + 'date_time_start' => false, + 'date_time_expiration' => false, + 'starting_value' => false, + 'max_budget' => false, + 'decrease_amount' => false, + 'frequency' => false, + 'frequency_type' => false, + 'decrease_by' => false, + 'decrease_every' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -116,6 +141,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -234,18 +311,36 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['date_time_start'] = $data['date_time_start'] ?? null; - $this->container['date_time_expiration'] = $data['date_time_expiration'] ?? null; - $this->container['starting_value'] = $data['starting_value'] ?? null; - $this->container['max_budget'] = $data['max_budget'] ?? null; - $this->container['decrease_amount'] = $data['decrease_amount'] ?? null; - $this->container['frequency'] = $data['frequency'] ?? null; - $this->container['frequency_type'] = $data['frequency_type'] ?? null; - $this->container['decrease_by'] = $data['decrease_by'] ?? null; - $this->container['decrease_every'] = $data['decrease_every'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('date_time_start', $data ?? [], null); + $this->setIfExists('date_time_expiration', $data ?? [], null); + $this->setIfExists('starting_value', $data ?? [], null); + $this->setIfExists('max_budget', $data ?? [], null); + $this->setIfExists('decrease_amount', $data ?? [], null); + $this->setIfExists('frequency', $data ?? [], null); + $this->setIfExists('frequency_type', $data ?? [], null); + $this->setIfExists('decrease_by', $data ?? [], null); + $this->setIfExists('decrease_every', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -353,6 +448,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTDynamicVoucherCreateParams., must be bigger than or equal to 1.'); @@ -382,6 +480,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -406,14 +507,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTDynamicVoucherCreateParams., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTDynamicVoucherCreateParams., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling WTDynamicVoucherCreateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling WTDynamicVoucherCreateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -440,6 +544,9 @@ public function getDateTimeStart() */ public function setDateTimeStart($date_time_start) { + if (is_null($date_time_start)) { + throw new \InvalidArgumentException('non-nullable date_time_start cannot be null'); + } $this->container['date_time_start'] = $date_time_start; return $this; @@ -464,6 +571,9 @@ public function getDateTimeExpiration() */ public function setDateTimeExpiration($date_time_expiration) { + if (is_null($date_time_expiration)) { + throw new \InvalidArgumentException('non-nullable date_time_expiration cannot be null'); + } $this->container['date_time_expiration'] = $date_time_expiration; return $this; @@ -488,6 +598,9 @@ public function getStartingValue() */ public function setStartingValue($starting_value) { + if (is_null($starting_value)) { + throw new \InvalidArgumentException('non-nullable starting_value cannot be null'); + } if (($starting_value < 0)) { throw new \InvalidArgumentException('invalid value for $starting_value when calling WTDynamicVoucherCreateParams., must be bigger than or equal to 0.'); @@ -517,6 +630,9 @@ public function getMaxBudget() */ public function setMaxBudget($max_budget) { + if (is_null($max_budget)) { + throw new \InvalidArgumentException('non-nullable max_budget cannot be null'); + } if (($max_budget < 0)) { throw new \InvalidArgumentException('invalid value for $max_budget when calling WTDynamicVoucherCreateParams., must be bigger than or equal to 0.'); @@ -546,6 +662,9 @@ public function getDecreaseAmount() */ public function setDecreaseAmount($decrease_amount) { + if (is_null($decrease_amount)) { + throw new \InvalidArgumentException('non-nullable decrease_amount cannot be null'); + } if (($decrease_amount < 0)) { throw new \InvalidArgumentException('invalid value for $decrease_amount when calling WTDynamicVoucherCreateParams., must be bigger than or equal to 0.'); @@ -575,6 +694,9 @@ public function getFrequency() */ public function setFrequency($frequency) { + if (is_null($frequency)) { + throw new \InvalidArgumentException('non-nullable frequency cannot be null'); + } if (($frequency < 0)) { throw new \InvalidArgumentException('invalid value for $frequency when calling WTDynamicVoucherCreateParams., must be bigger than or equal to 0.'); @@ -588,7 +710,7 @@ public function setFrequency($frequency) /** * Gets frequency_type * - * @return string + * @return \OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType */ public function getFrequencyType() { @@ -598,12 +720,15 @@ public function getFrequencyType() /** * Sets frequency_type * - * @param string $frequency_type frequency_type + * @param \OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType $frequency_type frequency_type * * @return self */ public function setFrequencyType($frequency_type) { + if (is_null($frequency_type)) { + throw new \InvalidArgumentException('non-nullable frequency_type cannot be null'); + } $this->container['frequency_type'] = $frequency_type; return $this; @@ -612,7 +737,7 @@ public function setFrequencyType($frequency_type) /** * Gets decrease_by * - * @return double|null + * @return float|null */ public function getDecreaseBy() { @@ -622,12 +747,15 @@ public function getDecreaseBy() /** * Sets decrease_by * - * @param double|null $decrease_by decrease_by + * @param float|null $decrease_by decrease_by * * @return self */ public function setDecreaseBy($decrease_by) { + if (is_null($decrease_by)) { + throw new \InvalidArgumentException('non-nullable decrease_by cannot be null'); + } $this->container['decrease_by'] = $decrease_by; return $this; @@ -636,7 +764,7 @@ public function setDecreaseBy($decrease_by) /** * Gets decrease_every * - * @return double|null + * @return float|null */ public function getDecreaseEvery() { @@ -646,12 +774,15 @@ public function getDecreaseEvery() /** * Sets decrease_every * - * @param double|null $decrease_every decrease_every + * @param float|null $decrease_every decrease_every * * @return self */ public function setDecreaseEvery($decrease_every) { + if (is_null($decrease_every)) { + throw new \InvalidArgumentException('non-nullable decrease_every cannot be null'); + } $this->container['decrease_every'] = $decrease_every; return $this; @@ -663,7 +794,7 @@ public function setDecreaseEvery($decrease_every) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -675,6 +806,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -688,7 +820,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -704,7 +836,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -716,6 +848,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTDynamicVoucherRedemption.php b/lib/Model/WTDynamicVoucherRedemption.php index 2043d77..12ac2c0 100644 --- a/lib/Model/WTDynamicVoucherRedemption.php +++ b/lib/Model/WTDynamicVoucherRedemption.php @@ -2,7 +2,7 @@ /** * WTDynamicVoucherRedemption * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTDynamicVoucherRedemption implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -65,9 +63,9 @@ class WTDynamicVoucherRedemption implements ModelInterface, ArrayAccess, \JsonSe 'dynamic_voucher_id' => 'string', 'redeemed_source' => 'string', 'redeemed_transaction_id' => 'string', - 'transaction_type' => 'string', - 'register_id' => 'string', - 'id' => 'string', + 'transaction_type' => '\OpenAPI\Client\Model\WTDynamicVoucherRedemptionTransactionType', + 'register_id' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -116,6 +114,43 @@ class WTDynamicVoucherRedemption implements ModelInterface, ArrayAccess, \JsonSe 'parent_object_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'session_key' => false, + 'redeemed_amount' => false, + 'dynamic_voucher_id' => false, + 'redeemed_source' => false, + 'redeemed_transaction_id' => false, + 'transaction_type' => false, + 'register_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'redeemed_at' => true, + 'refunded_at' => true, + 'refunded_transaction_id' => false, + 'refunded_amount' => false, + 'status' => false, + 'redeemed_amount_decimal' => false, + 'redeemed_amount_string' => false, + 'discount_received' => false, + 'meta_value' => false, + 'parent_object_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -136,6 +171,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -284,28 +371,46 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['session_key'] = $data['session_key'] ?? null; - $this->container['redeemed_amount'] = $data['redeemed_amount'] ?? null; - $this->container['dynamic_voucher_id'] = $data['dynamic_voucher_id'] ?? null; - $this->container['redeemed_source'] = $data['redeemed_source'] ?? null; - $this->container['redeemed_transaction_id'] = $data['redeemed_transaction_id'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['redeemed_at'] = $data['redeemed_at'] ?? null; - $this->container['refunded_at'] = $data['refunded_at'] ?? null; - $this->container['refunded_transaction_id'] = $data['refunded_transaction_id'] ?? null; - $this->container['refunded_amount'] = $data['refunded_amount'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['redeemed_amount_decimal'] = $data['redeemed_amount_decimal'] ?? null; - $this->container['redeemed_amount_string'] = $data['redeemed_amount_string'] ?? null; - $this->container['discount_received'] = $data['discount_received'] ?? null; - $this->container['meta_value'] = $data['meta_value'] ?? null; - $this->container['parent_object_id'] = $data['parent_object_id'] ?? null; + $this->setIfExists('session_key', $data ?? [], null); + $this->setIfExists('redeemed_amount', $data ?? [], null); + $this->setIfExists('dynamic_voucher_id', $data ?? [], null); + $this->setIfExists('redeemed_source', $data ?? [], null); + $this->setIfExists('redeemed_transaction_id', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('redeemed_at', $data ?? [], null); + $this->setIfExists('refunded_at', $data ?? [], null); + $this->setIfExists('refunded_transaction_id', $data ?? [], null); + $this->setIfExists('refunded_amount', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('redeemed_amount_decimal', $data ?? [], null); + $this->setIfExists('redeemed_amount_string', $data ?? [], null); + $this->setIfExists('discount_received', $data ?? [], null); + $this->setIfExists('meta_value', $data ?? [], null); + $this->setIfExists('parent_object_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -357,14 +462,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -463,6 +560,9 @@ public function getSessionKey() */ public function setSessionKey($session_key) { + if (is_null($session_key)) { + throw new \InvalidArgumentException('non-nullable session_key cannot be null'); + } $this->container['session_key'] = $session_key; @@ -489,6 +589,9 @@ public function getRedeemedAmount() */ public function setRedeemedAmount($redeemed_amount) { + if (is_null($redeemed_amount)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount cannot be null'); + } if (($redeemed_amount < 0)) { throw new \InvalidArgumentException('invalid value for $redeemed_amount when calling WTDynamicVoucherRedemption., must be bigger than or equal to 0.'); @@ -518,14 +621,17 @@ public function getDynamicVoucherId() */ public function setDynamicVoucherId($dynamic_voucher_id) { + if (is_null($dynamic_voucher_id)) { + throw new \InvalidArgumentException('non-nullable dynamic_voucher_id cannot be null'); + } if ((mb_strlen($dynamic_voucher_id) > 10)) { throw new \InvalidArgumentException('invalid length for $dynamic_voucher_id when calling WTDynamicVoucherRedemption., must be smaller than or equal to 10.'); } if ((mb_strlen($dynamic_voucher_id) < 10)) { throw new \InvalidArgumentException('invalid length for $dynamic_voucher_id when calling WTDynamicVoucherRedemption., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $dynamic_voucher_id))) { - throw new \InvalidArgumentException("invalid value for $dynamic_voucher_id when calling WTDynamicVoucherRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($dynamic_voucher_id)))) { + throw new \InvalidArgumentException("invalid value for \$dynamic_voucher_id when calling WTDynamicVoucherRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['dynamic_voucher_id'] = $dynamic_voucher_id; @@ -552,6 +658,9 @@ public function getRedeemedSource() */ public function setRedeemedSource($redeemed_source) { + if (is_null($redeemed_source)) { + throw new \InvalidArgumentException('non-nullable redeemed_source cannot be null'); + } $this->container['redeemed_source'] = $redeemed_source; return $this; @@ -576,6 +685,9 @@ public function getRedeemedTransactionId() */ public function setRedeemedTransactionId($redeemed_transaction_id) { + if (is_null($redeemed_transaction_id)) { + throw new \InvalidArgumentException('non-nullable redeemed_transaction_id cannot be null'); + } $this->container['redeemed_transaction_id'] = $redeemed_transaction_id; return $this; @@ -584,7 +696,7 @@ public function setRedeemedTransactionId($redeemed_transaction_id) /** * Gets transaction_type * - * @return string + * @return \OpenAPI\Client\Model\WTDynamicVoucherRedemptionTransactionType */ public function getTransactionType() { @@ -594,12 +706,15 @@ public function getTransactionType() /** * Sets transaction_type * - * @param string $transaction_type The type of the transaction - only redemption at the moment + * @param \OpenAPI\Client\Model\WTDynamicVoucherRedemptionTransactionType $transaction_type transaction_type * * @return self */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -608,7 +723,7 @@ public function setTransactionType($transaction_type) /** * Gets register_id * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID */ public function getRegisterId() { @@ -618,12 +733,15 @@ public function getRegisterId() /** * Sets register_id * - * @param string $register_id The ID of the register where the transaction occurred + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID $register_id register_id * * @return self */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -632,7 +750,7 @@ public function setRegisterId($register_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -642,19 +760,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTDynamicVoucherRedemption., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTDynamicVoucherRedemption., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -679,14 +793,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTDynamicVoucherRedemption., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTDynamicVoucherRedemption., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTDynamicVoucherRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTDynamicVoucherRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -713,6 +830,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -737,6 +857,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -761,6 +884,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -785,6 +911,16 @@ public function getRedeemedAt() */ public function setRedeemedAt($redeemed_at) { + if (is_null($redeemed_at)) { + array_push($this->openAPINullablesSetToNull, 'redeemed_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('redeemed_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['redeemed_at'] = $redeemed_at; return $this; @@ -809,6 +945,16 @@ public function getRefundedAt() */ public function setRefundedAt($refunded_at) { + if (is_null($refunded_at)) { + array_push($this->openAPINullablesSetToNull, 'refunded_at'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('refunded_at', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['refunded_at'] = $refunded_at; return $this; @@ -833,6 +979,9 @@ public function getRefundedTransactionId() */ public function setRefundedTransactionId($refunded_transaction_id) { + if (is_null($refunded_transaction_id)) { + throw new \InvalidArgumentException('non-nullable refunded_transaction_id cannot be null'); + } $this->container['refunded_transaction_id'] = $refunded_transaction_id; return $this; @@ -857,6 +1006,9 @@ public function getRefundedAmount() */ public function setRefundedAmount($refunded_amount) { + if (is_null($refunded_amount)) { + throw new \InvalidArgumentException('non-nullable refunded_amount cannot be null'); + } if (($refunded_amount < 0)) { throw new \InvalidArgumentException('invalid value for $refunded_amount when calling WTDynamicVoucherRedemption., must be bigger than or equal to 0.'); @@ -886,6 +1038,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -910,6 +1065,9 @@ public function getRedeemedAmountDecimal() */ public function setRedeemedAmountDecimal($redeemed_amount_decimal) { + if (is_null($redeemed_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount_decimal cannot be null'); + } $this->container['redeemed_amount_decimal'] = $redeemed_amount_decimal; return $this; @@ -934,6 +1092,9 @@ public function getRedeemedAmountString() */ public function setRedeemedAmountString($redeemed_amount_string) { + if (is_null($redeemed_amount_string)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount_string cannot be null'); + } $this->container['redeemed_amount_string'] = $redeemed_amount_string; return $this; @@ -958,6 +1119,9 @@ public function getDiscountReceived() */ public function setDiscountReceived($discount_received) { + if (is_null($discount_received)) { + throw new \InvalidArgumentException('non-nullable discount_received cannot be null'); + } $this->container['discount_received'] = $discount_received; return $this; @@ -982,6 +1146,9 @@ public function getMetaValue() */ public function setMetaValue($meta_value) { + if (is_null($meta_value)) { + throw new \InvalidArgumentException('non-nullable meta_value cannot be null'); + } $this->container['meta_value'] = $meta_value; return $this; @@ -1006,14 +1173,17 @@ public function getParentObjectId() */ public function setParentObjectId($parent_object_id) { + if (is_null($parent_object_id)) { + throw new \InvalidArgumentException('non-nullable parent_object_id cannot be null'); + } if ((mb_strlen($parent_object_id) > 10)) { throw new \InvalidArgumentException('invalid length for $parent_object_id when calling WTDynamicVoucherRedemption., must be smaller than or equal to 10.'); } if ((mb_strlen($parent_object_id) < 10)) { throw new \InvalidArgumentException('invalid length for $parent_object_id when calling WTDynamicVoucherRedemption., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $parent_object_id))) { - throw new \InvalidArgumentException("invalid value for $parent_object_id when calling WTDynamicVoucherRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($parent_object_id)))) { + throw new \InvalidArgumentException("invalid value for \$parent_object_id when calling WTDynamicVoucherRedemption., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['parent_object_id'] = $parent_object_id; @@ -1027,7 +1197,7 @@ public function setParentObjectId($parent_object_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1039,6 +1209,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1052,7 +1223,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1068,7 +1239,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1080,6 +1251,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTDynamicVoucherRedemptionTransactionType.php b/lib/Model/WTDynamicVoucherRedemptionTransactionType.php new file mode 100644 index 0000000..c775e5c --- /dev/null +++ b/lib/Model/WTDynamicVoucherRedemptionTransactionType.php @@ -0,0 +1,383 @@ + + */ +class WTDynamicVoucherRedemptionTransactionType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTDynamicVoucherRedemption_transactionType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTDynamicVoucherSummary.php b/lib/Model/WTDynamicVoucherSummary.php index 8bb4d35..bedf918 100644 --- a/lib/Model/WTDynamicVoucherSummary.php +++ b/lib/Model/WTDynamicVoucherSummary.php @@ -2,7 +2,7 @@ /** * WTDynamicVoucherSummary * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTDynamicVoucherSummary implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,27 +60,27 @@ class WTDynamicVoucherSummary implements ModelInterface, ArrayAccess, \JsonSeria protected static $openAPITypes = [ 'calc_error' => 'bool', 'calc_error_details' => 'string', - 'current_value' => 'double', + 'current_value' => 'float', 'current_value_decimal' => 'string', 'current_value_string' => 'string', 'time_value_zero' => 'bool', - 'time_value_zero_subtracted_amount' => 'double', - 'total_number_redeemed' => 'double', - 'total_value_redeemed' => 'double', - 'total_budget_remaining' => 'double', + 'time_value_zero_subtracted_amount' => 'float', + 'total_number_redeemed' => 'float', + 'total_value_redeemed' => 'float', + 'total_budget_remaining' => 'float', 'maximum_budget_exhausted' => 'bool', - 'maximum_budget_exhausted_by' => 'double', + 'maximum_budget_exhausted_by' => 'float', 'maximum_budget_exhausted_by_decimal' => 'string', 'maximum_budget_exhausted_by_string' => 'string', - 'maximum_budget_exhausted_total_value_redeemed' => 'double', + 'maximum_budget_exhausted_total_value_redeemed' => 'float', 'maximum_budget_exhausted_total_value_redeemed_decimal' => 'string', 'maximum_budget_exhausted_total_value_redeemed_string' => 'string', - 'total_amount_subtracted' => 'double', + 'total_amount_subtracted' => 'float', 'total_amount_subtracted_decimal' => 'string', 'total_amount_subtracted_string' => 'string', - 'total_decremented_multiple' => 'double', + 'total_decremented_multiple' => 'float', 'redeemed_keys' => 'string[]', - 'status' => 'string', + 'status' => '\OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus', 'expired' => 'bool' ]; @@ -120,6 +118,45 @@ class WTDynamicVoucherSummary implements ModelInterface, ArrayAccess, \JsonSeria 'expired' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'calc_error' => false, + 'calc_error_details' => false, + 'current_value' => false, + 'current_value_decimal' => false, + 'current_value_string' => false, + 'time_value_zero' => false, + 'time_value_zero_subtracted_amount' => false, + 'total_number_redeemed' => false, + 'total_value_redeemed' => false, + 'total_budget_remaining' => false, + 'maximum_budget_exhausted' => false, + 'maximum_budget_exhausted_by' => false, + 'maximum_budget_exhausted_by_decimal' => false, + 'maximum_budget_exhausted_by_string' => false, + 'maximum_budget_exhausted_total_value_redeemed' => false, + 'maximum_budget_exhausted_total_value_redeemed_decimal' => false, + 'maximum_budget_exhausted_total_value_redeemed_string' => false, + 'total_amount_subtracted' => false, + 'total_amount_subtracted_decimal' => false, + 'total_amount_subtracted_string' => false, + 'total_decremented_multiple' => false, + 'redeemed_keys' => false, + 'status' => false, + 'expired' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -140,6 +177,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -294,30 +383,48 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['calc_error'] = $data['calc_error'] ?? null; - $this->container['calc_error_details'] = $data['calc_error_details'] ?? null; - $this->container['current_value'] = $data['current_value'] ?? null; - $this->container['current_value_decimal'] = $data['current_value_decimal'] ?? null; - $this->container['current_value_string'] = $data['current_value_string'] ?? null; - $this->container['time_value_zero'] = $data['time_value_zero'] ?? null; - $this->container['time_value_zero_subtracted_amount'] = $data['time_value_zero_subtracted_amount'] ?? null; - $this->container['total_number_redeemed'] = $data['total_number_redeemed'] ?? null; - $this->container['total_value_redeemed'] = $data['total_value_redeemed'] ?? null; - $this->container['total_budget_remaining'] = $data['total_budget_remaining'] ?? null; - $this->container['maximum_budget_exhausted'] = $data['maximum_budget_exhausted'] ?? null; - $this->container['maximum_budget_exhausted_by'] = $data['maximum_budget_exhausted_by'] ?? null; - $this->container['maximum_budget_exhausted_by_decimal'] = $data['maximum_budget_exhausted_by_decimal'] ?? null; - $this->container['maximum_budget_exhausted_by_string'] = $data['maximum_budget_exhausted_by_string'] ?? null; - $this->container['maximum_budget_exhausted_total_value_redeemed'] = $data['maximum_budget_exhausted_total_value_redeemed'] ?? null; - $this->container['maximum_budget_exhausted_total_value_redeemed_decimal'] = $data['maximum_budget_exhausted_total_value_redeemed_decimal'] ?? null; - $this->container['maximum_budget_exhausted_total_value_redeemed_string'] = $data['maximum_budget_exhausted_total_value_redeemed_string'] ?? null; - $this->container['total_amount_subtracted'] = $data['total_amount_subtracted'] ?? null; - $this->container['total_amount_subtracted_decimal'] = $data['total_amount_subtracted_decimal'] ?? null; - $this->container['total_amount_subtracted_string'] = $data['total_amount_subtracted_string'] ?? null; - $this->container['total_decremented_multiple'] = $data['total_decremented_multiple'] ?? null; - $this->container['redeemed_keys'] = $data['redeemed_keys'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['expired'] = $data['expired'] ?? null; + $this->setIfExists('calc_error', $data ?? [], null); + $this->setIfExists('calc_error_details', $data ?? [], null); + $this->setIfExists('current_value', $data ?? [], null); + $this->setIfExists('current_value_decimal', $data ?? [], null); + $this->setIfExists('current_value_string', $data ?? [], null); + $this->setIfExists('time_value_zero', $data ?? [], null); + $this->setIfExists('time_value_zero_subtracted_amount', $data ?? [], null); + $this->setIfExists('total_number_redeemed', $data ?? [], null); + $this->setIfExists('total_value_redeemed', $data ?? [], null); + $this->setIfExists('total_budget_remaining', $data ?? [], null); + $this->setIfExists('maximum_budget_exhausted', $data ?? [], null); + $this->setIfExists('maximum_budget_exhausted_by', $data ?? [], null); + $this->setIfExists('maximum_budget_exhausted_by_decimal', $data ?? [], null); + $this->setIfExists('maximum_budget_exhausted_by_string', $data ?? [], null); + $this->setIfExists('maximum_budget_exhausted_total_value_redeemed', $data ?? [], null); + $this->setIfExists('maximum_budget_exhausted_total_value_redeemed_decimal', $data ?? [], null); + $this->setIfExists('maximum_budget_exhausted_total_value_redeemed_string', $data ?? [], null); + $this->setIfExists('total_amount_subtracted', $data ?? [], null); + $this->setIfExists('total_amount_subtracted_decimal', $data ?? [], null); + $this->setIfExists('total_amount_subtracted_string', $data ?? [], null); + $this->setIfExists('total_decremented_multiple', $data ?? [], null); + $this->setIfExists('redeemed_keys', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('expired', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -435,6 +542,9 @@ public function getCalcError() */ public function setCalcError($calc_error) { + if (is_null($calc_error)) { + throw new \InvalidArgumentException('non-nullable calc_error cannot be null'); + } $this->container['calc_error'] = $calc_error; return $this; @@ -459,6 +569,9 @@ public function getCalcErrorDetails() */ public function setCalcErrorDetails($calc_error_details) { + if (is_null($calc_error_details)) { + throw new \InvalidArgumentException('non-nullable calc_error_details cannot be null'); + } $this->container['calc_error_details'] = $calc_error_details; return $this; @@ -467,7 +580,7 @@ public function setCalcErrorDetails($calc_error_details) /** * Gets current_value * - * @return double + * @return float */ public function getCurrentValue() { @@ -477,12 +590,15 @@ public function getCurrentValue() /** * Sets current_value * - * @param double $current_value current_value + * @param float $current_value current_value * * @return self */ public function setCurrentValue($current_value) { + if (is_null($current_value)) { + throw new \InvalidArgumentException('non-nullable current_value cannot be null'); + } $this->container['current_value'] = $current_value; return $this; @@ -507,6 +623,9 @@ public function getCurrentValueDecimal() */ public function setCurrentValueDecimal($current_value_decimal) { + if (is_null($current_value_decimal)) { + throw new \InvalidArgumentException('non-nullable current_value_decimal cannot be null'); + } $this->container['current_value_decimal'] = $current_value_decimal; return $this; @@ -531,6 +650,9 @@ public function getCurrentValueString() */ public function setCurrentValueString($current_value_string) { + if (is_null($current_value_string)) { + throw new \InvalidArgumentException('non-nullable current_value_string cannot be null'); + } $this->container['current_value_string'] = $current_value_string; return $this; @@ -555,6 +677,9 @@ public function getTimeValueZero() */ public function setTimeValueZero($time_value_zero) { + if (is_null($time_value_zero)) { + throw new \InvalidArgumentException('non-nullable time_value_zero cannot be null'); + } $this->container['time_value_zero'] = $time_value_zero; return $this; @@ -563,7 +688,7 @@ public function setTimeValueZero($time_value_zero) /** * Gets time_value_zero_subtracted_amount * - * @return double + * @return float */ public function getTimeValueZeroSubtractedAmount() { @@ -573,12 +698,15 @@ public function getTimeValueZeroSubtractedAmount() /** * Sets time_value_zero_subtracted_amount * - * @param double $time_value_zero_subtracted_amount time_value_zero_subtracted_amount + * @param float $time_value_zero_subtracted_amount time_value_zero_subtracted_amount * * @return self */ public function setTimeValueZeroSubtractedAmount($time_value_zero_subtracted_amount) { + if (is_null($time_value_zero_subtracted_amount)) { + throw new \InvalidArgumentException('non-nullable time_value_zero_subtracted_amount cannot be null'); + } $this->container['time_value_zero_subtracted_amount'] = $time_value_zero_subtracted_amount; return $this; @@ -587,7 +715,7 @@ public function setTimeValueZeroSubtractedAmount($time_value_zero_subtracted_amo /** * Gets total_number_redeemed * - * @return double + * @return float */ public function getTotalNumberRedeemed() { @@ -597,12 +725,15 @@ public function getTotalNumberRedeemed() /** * Sets total_number_redeemed * - * @param double $total_number_redeemed total_number_redeemed + * @param float $total_number_redeemed total_number_redeemed * * @return self */ public function setTotalNumberRedeemed($total_number_redeemed) { + if (is_null($total_number_redeemed)) { + throw new \InvalidArgumentException('non-nullable total_number_redeemed cannot be null'); + } $this->container['total_number_redeemed'] = $total_number_redeemed; return $this; @@ -611,7 +742,7 @@ public function setTotalNumberRedeemed($total_number_redeemed) /** * Gets total_value_redeemed * - * @return double + * @return float */ public function getTotalValueRedeemed() { @@ -621,12 +752,15 @@ public function getTotalValueRedeemed() /** * Sets total_value_redeemed * - * @param double $total_value_redeemed total_value_redeemed + * @param float $total_value_redeemed total_value_redeemed * * @return self */ public function setTotalValueRedeemed($total_value_redeemed) { + if (is_null($total_value_redeemed)) { + throw new \InvalidArgumentException('non-nullable total_value_redeemed cannot be null'); + } $this->container['total_value_redeemed'] = $total_value_redeemed; return $this; @@ -635,7 +769,7 @@ public function setTotalValueRedeemed($total_value_redeemed) /** * Gets total_budget_remaining * - * @return double + * @return float */ public function getTotalBudgetRemaining() { @@ -645,12 +779,15 @@ public function getTotalBudgetRemaining() /** * Sets total_budget_remaining * - * @param double $total_budget_remaining total_budget_remaining + * @param float $total_budget_remaining total_budget_remaining * * @return self */ public function setTotalBudgetRemaining($total_budget_remaining) { + if (is_null($total_budget_remaining)) { + throw new \InvalidArgumentException('non-nullable total_budget_remaining cannot be null'); + } $this->container['total_budget_remaining'] = $total_budget_remaining; return $this; @@ -675,6 +812,9 @@ public function getMaximumBudgetExhausted() */ public function setMaximumBudgetExhausted($maximum_budget_exhausted) { + if (is_null($maximum_budget_exhausted)) { + throw new \InvalidArgumentException('non-nullable maximum_budget_exhausted cannot be null'); + } $this->container['maximum_budget_exhausted'] = $maximum_budget_exhausted; return $this; @@ -683,7 +823,7 @@ public function setMaximumBudgetExhausted($maximum_budget_exhausted) /** * Gets maximum_budget_exhausted_by * - * @return double + * @return float */ public function getMaximumBudgetExhaustedBy() { @@ -693,12 +833,15 @@ public function getMaximumBudgetExhaustedBy() /** * Sets maximum_budget_exhausted_by * - * @param double $maximum_budget_exhausted_by maximum_budget_exhausted_by + * @param float $maximum_budget_exhausted_by maximum_budget_exhausted_by * * @return self */ public function setMaximumBudgetExhaustedBy($maximum_budget_exhausted_by) { + if (is_null($maximum_budget_exhausted_by)) { + throw new \InvalidArgumentException('non-nullable maximum_budget_exhausted_by cannot be null'); + } $this->container['maximum_budget_exhausted_by'] = $maximum_budget_exhausted_by; return $this; @@ -723,6 +866,9 @@ public function getMaximumBudgetExhaustedByDecimal() */ public function setMaximumBudgetExhaustedByDecimal($maximum_budget_exhausted_by_decimal) { + if (is_null($maximum_budget_exhausted_by_decimal)) { + throw new \InvalidArgumentException('non-nullable maximum_budget_exhausted_by_decimal cannot be null'); + } $this->container['maximum_budget_exhausted_by_decimal'] = $maximum_budget_exhausted_by_decimal; return $this; @@ -747,6 +893,9 @@ public function getMaximumBudgetExhaustedByString() */ public function setMaximumBudgetExhaustedByString($maximum_budget_exhausted_by_string) { + if (is_null($maximum_budget_exhausted_by_string)) { + throw new \InvalidArgumentException('non-nullable maximum_budget_exhausted_by_string cannot be null'); + } $this->container['maximum_budget_exhausted_by_string'] = $maximum_budget_exhausted_by_string; return $this; @@ -755,7 +904,7 @@ public function setMaximumBudgetExhaustedByString($maximum_budget_exhausted_by_s /** * Gets maximum_budget_exhausted_total_value_redeemed * - * @return double + * @return float */ public function getMaximumBudgetExhaustedTotalValueRedeemed() { @@ -765,12 +914,15 @@ public function getMaximumBudgetExhaustedTotalValueRedeemed() /** * Sets maximum_budget_exhausted_total_value_redeemed * - * @param double $maximum_budget_exhausted_total_value_redeemed maximum_budget_exhausted_total_value_redeemed + * @param float $maximum_budget_exhausted_total_value_redeemed maximum_budget_exhausted_total_value_redeemed * * @return self */ public function setMaximumBudgetExhaustedTotalValueRedeemed($maximum_budget_exhausted_total_value_redeemed) { + if (is_null($maximum_budget_exhausted_total_value_redeemed)) { + throw new \InvalidArgumentException('non-nullable maximum_budget_exhausted_total_value_redeemed cannot be null'); + } $this->container['maximum_budget_exhausted_total_value_redeemed'] = $maximum_budget_exhausted_total_value_redeemed; return $this; @@ -795,6 +947,9 @@ public function getMaximumBudgetExhaustedTotalValueRedeemedDecimal() */ public function setMaximumBudgetExhaustedTotalValueRedeemedDecimal($maximum_budget_exhausted_total_value_redeemed_decimal) { + if (is_null($maximum_budget_exhausted_total_value_redeemed_decimal)) { + throw new \InvalidArgumentException('non-nullable maximum_budget_exhausted_total_value_redeemed_decimal cannot be null'); + } $this->container['maximum_budget_exhausted_total_value_redeemed_decimal'] = $maximum_budget_exhausted_total_value_redeemed_decimal; return $this; @@ -819,6 +974,9 @@ public function getMaximumBudgetExhaustedTotalValueRedeemedString() */ public function setMaximumBudgetExhaustedTotalValueRedeemedString($maximum_budget_exhausted_total_value_redeemed_string) { + if (is_null($maximum_budget_exhausted_total_value_redeemed_string)) { + throw new \InvalidArgumentException('non-nullable maximum_budget_exhausted_total_value_redeemed_string cannot be null'); + } $this->container['maximum_budget_exhausted_total_value_redeemed_string'] = $maximum_budget_exhausted_total_value_redeemed_string; return $this; @@ -827,7 +985,7 @@ public function setMaximumBudgetExhaustedTotalValueRedeemedString($maximum_budge /** * Gets total_amount_subtracted * - * @return double + * @return float */ public function getTotalAmountSubtracted() { @@ -837,12 +995,15 @@ public function getTotalAmountSubtracted() /** * Sets total_amount_subtracted * - * @param double $total_amount_subtracted total_amount_subtracted + * @param float $total_amount_subtracted total_amount_subtracted * * @return self */ public function setTotalAmountSubtracted($total_amount_subtracted) { + if (is_null($total_amount_subtracted)) { + throw new \InvalidArgumentException('non-nullable total_amount_subtracted cannot be null'); + } $this->container['total_amount_subtracted'] = $total_amount_subtracted; return $this; @@ -867,6 +1028,9 @@ public function getTotalAmountSubtractedDecimal() */ public function setTotalAmountSubtractedDecimal($total_amount_subtracted_decimal) { + if (is_null($total_amount_subtracted_decimal)) { + throw new \InvalidArgumentException('non-nullable total_amount_subtracted_decimal cannot be null'); + } $this->container['total_amount_subtracted_decimal'] = $total_amount_subtracted_decimal; return $this; @@ -891,6 +1055,9 @@ public function getTotalAmountSubtractedString() */ public function setTotalAmountSubtractedString($total_amount_subtracted_string) { + if (is_null($total_amount_subtracted_string)) { + throw new \InvalidArgumentException('non-nullable total_amount_subtracted_string cannot be null'); + } $this->container['total_amount_subtracted_string'] = $total_amount_subtracted_string; return $this; @@ -899,7 +1066,7 @@ public function setTotalAmountSubtractedString($total_amount_subtracted_string) /** * Gets total_decremented_multiple * - * @return double + * @return float */ public function getTotalDecrementedMultiple() { @@ -909,12 +1076,15 @@ public function getTotalDecrementedMultiple() /** * Sets total_decremented_multiple * - * @param double $total_decremented_multiple total_decremented_multiple + * @param float $total_decremented_multiple total_decremented_multiple * * @return self */ public function setTotalDecrementedMultiple($total_decremented_multiple) { + if (is_null($total_decremented_multiple)) { + throw new \InvalidArgumentException('non-nullable total_decremented_multiple cannot be null'); + } $this->container['total_decremented_multiple'] = $total_decremented_multiple; return $this; @@ -939,6 +1109,9 @@ public function getRedeemedKeys() */ public function setRedeemedKeys($redeemed_keys) { + if (is_null($redeemed_keys)) { + throw new \InvalidArgumentException('non-nullable redeemed_keys cannot be null'); + } $this->container['redeemed_keys'] = $redeemed_keys; return $this; @@ -947,7 +1120,7 @@ public function setRedeemedKeys($redeemed_keys) /** * Gets status * - * @return string + * @return \OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus */ public function getStatus() { @@ -957,12 +1130,15 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param \OpenAPI\Client\Model\WTDynamicVoucherSummaryStatus $status status * * @return self */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -987,6 +1163,9 @@ public function getExpired() */ public function setExpired($expired) { + if (is_null($expired)) { + throw new \InvalidArgumentException('non-nullable expired cannot be null'); + } $this->container['expired'] = $expired; return $this; @@ -998,7 +1177,7 @@ public function setExpired($expired) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1010,6 +1189,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1023,7 +1203,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1039,7 +1219,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1051,6 +1231,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTDynamicVoucherSummaryStatus.php b/lib/Model/WTDynamicVoucherSummaryStatus.php new file mode 100644 index 0000000..ea82f14 --- /dev/null +++ b/lib/Model/WTDynamicVoucherSummaryStatus.php @@ -0,0 +1,382 @@ + + */ +class WTDynamicVoucherSummaryStatus implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTDynamicVoucherSummary_status'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTDynamicVoucherUpdateParams.php b/lib/Model/WTDynamicVoucherUpdateParams.php index 68d0573..026a415 100644 --- a/lib/Model/WTDynamicVoucherUpdateParams.php +++ b/lib/Model/WTDynamicVoucherUpdateParams.php @@ -2,7 +2,7 @@ /** * WTDynamicVoucherUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTDynamicVoucherUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,9 +67,9 @@ class WTDynamicVoucherUpdateParams implements ModelInterface, ArrayAccess, \Json 'max_budget' => 'int', 'decrease_amount' => 'int', 'frequency' => 'int', - 'frequency_type' => 'string', - 'decrease_by' => 'double', - 'decrease_every' => 'double' + 'frequency_type' => '\OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType', + 'decrease_by' => 'float', + 'decrease_every' => 'float' ]; /** @@ -96,6 +94,33 @@ class WTDynamicVoucherUpdateParams implements ModelInterface, ArrayAccess, \Json 'decrease_every' => 'double' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'notes' => false, + 'payment_design_id' => false, + 'date_time_start' => false, + 'date_time_expiration' => false, + 'starting_value' => false, + 'max_budget' => false, + 'decrease_amount' => false, + 'frequency' => false, + 'frequency_type' => false, + 'decrease_by' => false, + 'decrease_every' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -116,6 +141,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -234,18 +311,36 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['date_time_start'] = $data['date_time_start'] ?? null; - $this->container['date_time_expiration'] = $data['date_time_expiration'] ?? null; - $this->container['starting_value'] = $data['starting_value'] ?? null; - $this->container['max_budget'] = $data['max_budget'] ?? null; - $this->container['decrease_amount'] = $data['decrease_amount'] ?? null; - $this->container['frequency'] = $data['frequency'] ?? null; - $this->container['frequency_type'] = $data['frequency_type'] ?? null; - $this->container['decrease_by'] = $data['decrease_by'] ?? null; - $this->container['decrease_every'] = $data['decrease_every'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('date_time_start', $data ?? [], null); + $this->setIfExists('date_time_expiration', $data ?? [], null); + $this->setIfExists('starting_value', $data ?? [], null); + $this->setIfExists('max_budget', $data ?? [], null); + $this->setIfExists('decrease_amount', $data ?? [], null); + $this->setIfExists('frequency', $data ?? [], null); + $this->setIfExists('frequency_type', $data ?? [], null); + $this->setIfExists('decrease_by', $data ?? [], null); + $this->setIfExists('decrease_every', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -353,6 +448,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTDynamicVoucherUpdateParams., must be bigger than or equal to 1.'); @@ -382,6 +480,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -406,14 +507,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTDynamicVoucherUpdateParams., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTDynamicVoucherUpdateParams., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling WTDynamicVoucherUpdateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling WTDynamicVoucherUpdateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -440,6 +544,9 @@ public function getDateTimeStart() */ public function setDateTimeStart($date_time_start) { + if (is_null($date_time_start)) { + throw new \InvalidArgumentException('non-nullable date_time_start cannot be null'); + } $this->container['date_time_start'] = $date_time_start; return $this; @@ -464,6 +571,9 @@ public function getDateTimeExpiration() */ public function setDateTimeExpiration($date_time_expiration) { + if (is_null($date_time_expiration)) { + throw new \InvalidArgumentException('non-nullable date_time_expiration cannot be null'); + } $this->container['date_time_expiration'] = $date_time_expiration; return $this; @@ -488,6 +598,9 @@ public function getStartingValue() */ public function setStartingValue($starting_value) { + if (is_null($starting_value)) { + throw new \InvalidArgumentException('non-nullable starting_value cannot be null'); + } if (($starting_value < 0)) { throw new \InvalidArgumentException('invalid value for $starting_value when calling WTDynamicVoucherUpdateParams., must be bigger than or equal to 0.'); @@ -517,6 +630,9 @@ public function getMaxBudget() */ public function setMaxBudget($max_budget) { + if (is_null($max_budget)) { + throw new \InvalidArgumentException('non-nullable max_budget cannot be null'); + } if (($max_budget < 0)) { throw new \InvalidArgumentException('invalid value for $max_budget when calling WTDynamicVoucherUpdateParams., must be bigger than or equal to 0.'); @@ -546,6 +662,9 @@ public function getDecreaseAmount() */ public function setDecreaseAmount($decrease_amount) { + if (is_null($decrease_amount)) { + throw new \InvalidArgumentException('non-nullable decrease_amount cannot be null'); + } if (($decrease_amount < 0)) { throw new \InvalidArgumentException('invalid value for $decrease_amount when calling WTDynamicVoucherUpdateParams., must be bigger than or equal to 0.'); @@ -575,6 +694,9 @@ public function getFrequency() */ public function setFrequency($frequency) { + if (is_null($frequency)) { + throw new \InvalidArgumentException('non-nullable frequency cannot be null'); + } if (($frequency < 0)) { throw new \InvalidArgumentException('invalid value for $frequency when calling WTDynamicVoucherUpdateParams., must be bigger than or equal to 0.'); @@ -588,7 +710,7 @@ public function setFrequency($frequency) /** * Gets frequency_type * - * @return string + * @return \OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType */ public function getFrequencyType() { @@ -598,12 +720,15 @@ public function getFrequencyType() /** * Sets frequency_type * - * @param string $frequency_type frequency_type + * @param \OpenAPI\Client\Model\DynamicVoucherTemporalDecreaseFrequencyType $frequency_type frequency_type * * @return self */ public function setFrequencyType($frequency_type) { + if (is_null($frequency_type)) { + throw new \InvalidArgumentException('non-nullable frequency_type cannot be null'); + } $this->container['frequency_type'] = $frequency_type; return $this; @@ -612,7 +737,7 @@ public function setFrequencyType($frequency_type) /** * Gets decrease_by * - * @return double|null + * @return float|null */ public function getDecreaseBy() { @@ -622,12 +747,15 @@ public function getDecreaseBy() /** * Sets decrease_by * - * @param double|null $decrease_by decrease_by + * @param float|null $decrease_by decrease_by * * @return self */ public function setDecreaseBy($decrease_by) { + if (is_null($decrease_by)) { + throw new \InvalidArgumentException('non-nullable decrease_by cannot be null'); + } $this->container['decrease_by'] = $decrease_by; return $this; @@ -636,7 +764,7 @@ public function setDecreaseBy($decrease_by) /** * Gets decrease_every * - * @return double|null + * @return float|null */ public function getDecreaseEvery() { @@ -646,12 +774,15 @@ public function getDecreaseEvery() /** * Sets decrease_every * - * @param double|null $decrease_every decrease_every + * @param float|null $decrease_every decrease_every * * @return self */ public function setDecreaseEvery($decrease_every) { + if (is_null($decrease_every)) { + throw new \InvalidArgumentException('non-nullable decrease_every cannot be null'); + } $this->container['decrease_every'] = $decrease_every; return $this; @@ -663,7 +794,7 @@ public function setDecreaseEvery($decrease_every) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -675,6 +806,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -688,7 +820,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -704,7 +836,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -716,6 +848,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmailSubscriberCreateParams.php b/lib/Model/WTEmailSubscriberCreateParams.php index 8d69e14..fc8f439 100644 --- a/lib/Model/WTEmailSubscriberCreateParams.php +++ b/lib/Model/WTEmailSubscriberCreateParams.php @@ -2,7 +2,7 @@ /** * WTEmailSubscriberCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmailSubscriberCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTEmailSubscriberCreateParams implements ModelInterface, ArrayAccess, \Jso 'email_address' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email_address' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -254,6 +340,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling WTEmailSubscriberCreateParams., must be bigger than or equal to 1.'); @@ -283,6 +372,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling WTEmailSubscriberCreateParams., must be bigger than or equal to 1.'); @@ -312,6 +404,9 @@ public function getEmailAddress() */ public function setEmailAddress($email_address) { + if (is_null($email_address)) { + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -323,7 +418,7 @@ public function setEmailAddress($email_address) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -335,6 +430,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -348,7 +444,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -364,7 +460,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -376,6 +472,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmailSubscriberCreateParamsWalletUI.php b/lib/Model/WTEmailSubscriberCreateParamsWalletUI.php index 6695a57..b1b7c00 100644 --- a/lib/Model/WTEmailSubscriberCreateParamsWalletUI.php +++ b/lib/Model/WTEmailSubscriberCreateParamsWalletUI.php @@ -2,7 +2,7 @@ /** * WTEmailSubscriberCreateParamsWalletUI * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmailSubscriberCreateParamsWalletUI implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -80,6 +78,25 @@ class WTEmailSubscriberCreateParamsWalletUI implements ModelInterface, ArrayAcce 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email_address' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +117,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -194,10 +263,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -275,6 +362,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling WTEmailSubscriberCreateParamsWalletUI., must be bigger than or equal to 1.'); @@ -304,6 +394,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling WTEmailSubscriberCreateParamsWalletUI., must be bigger than or equal to 1.'); @@ -333,6 +426,9 @@ public function getEmailAddress() */ public function setEmailAddress($email_address) { + if (is_null($email_address)) { + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -357,14 +453,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTEmailSubscriberCreateParamsWalletUI., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTEmailSubscriberCreateParamsWalletUI., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTEmailSubscriberCreateParamsWalletUI., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTEmailSubscriberCreateParamsWalletUI., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -378,7 +477,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -390,6 +489,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -403,7 +503,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -419,7 +519,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -431,6 +531,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmailSubscriberUpdateParams.php b/lib/Model/WTEmailSubscriberUpdateParams.php index 10a2dd4..66d8919 100644 --- a/lib/Model/WTEmailSubscriberUpdateParams.php +++ b/lib/Model/WTEmailSubscriberUpdateParams.php @@ -2,7 +2,7 @@ /** * WTEmailSubscriberUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmailSubscriberUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTEmailSubscriberUpdateParams implements ModelInterface, ArrayAccess, \Jso 'email_address' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email_address' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -254,6 +340,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling WTEmailSubscriberUpdateParams., must be bigger than or equal to 1.'); @@ -283,6 +372,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling WTEmailSubscriberUpdateParams., must be bigger than or equal to 1.'); @@ -312,6 +404,9 @@ public function getEmailAddress() */ public function setEmailAddress($email_address) { + if (is_null($email_address)) { + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + } $this->container['email_address'] = $email_address; return $this; @@ -323,7 +418,7 @@ public function setEmailAddress($email_address) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -335,6 +430,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -348,7 +444,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -364,7 +460,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -376,6 +472,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployee.php b/lib/Model/WTEmployee.php index 232cffa..b9c1b12 100644 --- a/lib/Model/WTEmployee.php +++ b/lib/Model/WTEmployee.php @@ -2,7 +2,7 @@ /** * WTEmployee * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployee implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,14 +67,14 @@ class WTEmployee implements ModelInterface, ArrayAccess, \JsonSerializable 'employee_id' => 'string', 'job_title' => 'string', 'department' => 'string', - 'schedule_start_day' => 'string', - 'schedule_start_hour' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_start_minute' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_start_meridiem' => 'string', - 'schedule_end_day' => 'string', - 'schedule_end_hour' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_end_minute' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_end_meridiem' => 'string', + 'schedule_start_day' => '\OpenAPI\Client\Model\EmployeeScheduleStartDay', + 'schedule_start_hour' => '\OpenAPI\Client\Model\EmployeeScheduleStartHour', + 'schedule_start_minute' => '\OpenAPI\Client\Model\EmployeeScheduleStartMinute', + 'schedule_start_meridiem' => '\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem', + 'schedule_end_day' => '\OpenAPI\Client\Model\EmployeeScheduleStartDay', + 'schedule_end_hour' => '\OpenAPI\Client\Model\EmployeeScheduleStartHour', + 'schedule_end_minute' => '\OpenAPI\Client\Model\EmployeeScheduleStartMinute', + 'schedule_end_meridiem' => '\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem', 'id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -85,7 +83,7 @@ class WTEmployee implements ModelInterface, ArrayAccess, \JsonSerializable 'profile_picture_url' => 'string', 'merchant_id' => 'string', 'session_token' => 'string', - 'failed_login_attempts' => 'double', + 'failed_login_attempts' => 'float', 'last_login_date' => '\DateTime', 'cfuvid' => 'string', 'schedule' => 'object', @@ -132,6 +130,51 @@ class WTEmployee implements ModelInterface, ArrayAccess, \JsonSerializable 'is_email_notification_disabled' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email' => false, + 'phone_number' => false, + 'is_public_representative' => false, + 'wallet_sequence_number' => false, + 'employee_id' => false, + 'job_title' => false, + 'department' => false, + 'schedule_start_day' => false, + 'schedule_start_hour' => false, + 'schedule_start_minute' => false, + 'schedule_start_meridiem' => false, + 'schedule_end_day' => false, + 'schedule_end_hour' => false, + 'schedule_end_minute' => false, + 'schedule_end_meridiem' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'username' => false, + 'email_verified' => false, + 'profile_picture_url' => false, + 'merchant_id' => false, + 'session_token' => false, + 'failed_login_attempts' => false, + 'last_login_date' => false, + 'cfuvid' => false, + 'schedule' => false, + 'is_email_notification_disabled' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -152,6 +195,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -324,36 +419,54 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['is_public_representative'] = $data['is_public_representative'] ?? null; - $this->container['wallet_sequence_number'] = $data['wallet_sequence_number'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['job_title'] = $data['job_title'] ?? null; - $this->container['department'] = $data['department'] ?? null; - $this->container['schedule_start_day'] = $data['schedule_start_day'] ?? null; - $this->container['schedule_start_hour'] = $data['schedule_start_hour'] ?? null; - $this->container['schedule_start_minute'] = $data['schedule_start_minute'] ?? null; - $this->container['schedule_start_meridiem'] = $data['schedule_start_meridiem'] ?? null; - $this->container['schedule_end_day'] = $data['schedule_end_day'] ?? null; - $this->container['schedule_end_hour'] = $data['schedule_end_hour'] ?? null; - $this->container['schedule_end_minute'] = $data['schedule_end_minute'] ?? null; - $this->container['schedule_end_meridiem'] = $data['schedule_end_meridiem'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['username'] = $data['username'] ?? null; - $this->container['email_verified'] = $data['email_verified'] ?? null; - $this->container['profile_picture_url'] = $data['profile_picture_url'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['session_token'] = $data['session_token'] ?? null; - $this->container['failed_login_attempts'] = $data['failed_login_attempts'] ?? null; - $this->container['last_login_date'] = $data['last_login_date'] ?? null; - $this->container['cfuvid'] = $data['cfuvid'] ?? null; - $this->container['schedule'] = $data['schedule'] ?? null; - $this->container['is_email_notification_disabled'] = $data['is_email_notification_disabled'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('is_public_representative', $data ?? [], null); + $this->setIfExists('wallet_sequence_number', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('job_title', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('schedule_start_day', $data ?? [], null); + $this->setIfExists('schedule_start_hour', $data ?? [], null); + $this->setIfExists('schedule_start_minute', $data ?? [], null); + $this->setIfExists('schedule_start_meridiem', $data ?? [], null); + $this->setIfExists('schedule_end_day', $data ?? [], null); + $this->setIfExists('schedule_end_hour', $data ?? [], null); + $this->setIfExists('schedule_end_minute', $data ?? [], null); + $this->setIfExists('schedule_end_meridiem', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('email_verified', $data ?? [], null); + $this->setIfExists('profile_picture_url', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('session_token', $data ?? [], null); + $this->setIfExists('failed_login_attempts', $data ?? [], null); + $this->setIfExists('last_login_date', $data ?? [], null); + $this->setIfExists('cfuvid', $data ?? [], null); + $this->setIfExists('schedule', $data ?? [], null); + $this->setIfExists('is_email_notification_disabled', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -498,6 +611,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling WTEmployee., must be bigger than or equal to 1.'); @@ -527,6 +643,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling WTEmployee., must be bigger than or equal to 1.'); @@ -556,6 +675,9 @@ public function getEmail() */ public function setEmail($email) { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } if ((mb_strlen($email) < 1)) { throw new \InvalidArgumentException('invalid length for $email when calling WTEmployee., must be bigger than or equal to 1.'); @@ -585,6 +707,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -609,6 +734,9 @@ public function getIsPublicRepresentative() */ public function setIsPublicRepresentative($is_public_representative) { + if (is_null($is_public_representative)) { + throw new \InvalidArgumentException('non-nullable is_public_representative cannot be null'); + } $this->container['is_public_representative'] = $is_public_representative; return $this; @@ -633,6 +761,9 @@ public function getWalletSequenceNumber() */ public function setWalletSequenceNumber($wallet_sequence_number) { + if (is_null($wallet_sequence_number)) { + throw new \InvalidArgumentException('non-nullable wallet_sequence_number cannot be null'); + } $this->container['wallet_sequence_number'] = $wallet_sequence_number; return $this; @@ -657,6 +788,9 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) < 0)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTEmployee., must be bigger than or equal to 0.'); @@ -686,6 +820,9 @@ public function getJobTitle() */ public function setJobTitle($job_title) { + if (is_null($job_title)) { + throw new \InvalidArgumentException('non-nullable job_title cannot be null'); + } if ((mb_strlen($job_title) < 0)) { throw new \InvalidArgumentException('invalid length for $job_title when calling WTEmployee., must be bigger than or equal to 0.'); @@ -715,6 +852,9 @@ public function getDepartment() */ public function setDepartment($department) { + if (is_null($department)) { + throw new \InvalidArgumentException('non-nullable department cannot be null'); + } if ((mb_strlen($department) < 0)) { throw new \InvalidArgumentException('invalid length for $department when calling WTEmployee., must be bigger than or equal to 0.'); @@ -728,7 +868,7 @@ public function setDepartment($department) /** * Gets schedule_start_day * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartDay|null */ public function getScheduleStartDay() { @@ -738,12 +878,15 @@ public function getScheduleStartDay() /** * Sets schedule_start_day * - * @param string|null $schedule_start_day schedule_start_day + * @param \OpenAPI\Client\Model\EmployeeScheduleStartDay|null $schedule_start_day schedule_start_day * * @return self */ public function setScheduleStartDay($schedule_start_day) { + if (is_null($schedule_start_day)) { + throw new \InvalidArgumentException('non-nullable schedule_start_day cannot be null'); + } $this->container['schedule_start_day'] = $schedule_start_day; return $this; @@ -752,7 +895,7 @@ public function setScheduleStartDay($schedule_start_day) /** * Gets schedule_start_hour * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartHour|null */ public function getScheduleStartHour() { @@ -762,12 +905,15 @@ public function getScheduleStartHour() /** * Sets schedule_start_hour * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_start_hour schedule_start_hour + * @param \OpenAPI\Client\Model\EmployeeScheduleStartHour|null $schedule_start_hour schedule_start_hour * * @return self */ public function setScheduleStartHour($schedule_start_hour) { + if (is_null($schedule_start_hour)) { + throw new \InvalidArgumentException('non-nullable schedule_start_hour cannot be null'); + } $this->container['schedule_start_hour'] = $schedule_start_hour; return $this; @@ -776,7 +922,7 @@ public function setScheduleStartHour($schedule_start_hour) /** * Gets schedule_start_minute * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null */ public function getScheduleStartMinute() { @@ -786,12 +932,15 @@ public function getScheduleStartMinute() /** * Sets schedule_start_minute * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_start_minute schedule_start_minute + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null $schedule_start_minute schedule_start_minute * * @return self */ public function setScheduleStartMinute($schedule_start_minute) { + if (is_null($schedule_start_minute)) { + throw new \InvalidArgumentException('non-nullable schedule_start_minute cannot be null'); + } $this->container['schedule_start_minute'] = $schedule_start_minute; return $this; @@ -800,7 +949,7 @@ public function setScheduleStartMinute($schedule_start_minute) /** * Gets schedule_start_meridiem * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null */ public function getScheduleStartMeridiem() { @@ -810,12 +959,15 @@ public function getScheduleStartMeridiem() /** * Sets schedule_start_meridiem * - * @param string|null $schedule_start_meridiem schedule_start_meridiem + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null $schedule_start_meridiem schedule_start_meridiem * * @return self */ public function setScheduleStartMeridiem($schedule_start_meridiem) { + if (is_null($schedule_start_meridiem)) { + throw new \InvalidArgumentException('non-nullable schedule_start_meridiem cannot be null'); + } $this->container['schedule_start_meridiem'] = $schedule_start_meridiem; return $this; @@ -824,7 +976,7 @@ public function setScheduleStartMeridiem($schedule_start_meridiem) /** * Gets schedule_end_day * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartDay|null */ public function getScheduleEndDay() { @@ -834,12 +986,15 @@ public function getScheduleEndDay() /** * Sets schedule_end_day * - * @param string|null $schedule_end_day schedule_end_day + * @param \OpenAPI\Client\Model\EmployeeScheduleStartDay|null $schedule_end_day schedule_end_day * * @return self */ public function setScheduleEndDay($schedule_end_day) { + if (is_null($schedule_end_day)) { + throw new \InvalidArgumentException('non-nullable schedule_end_day cannot be null'); + } $this->container['schedule_end_day'] = $schedule_end_day; return $this; @@ -848,7 +1003,7 @@ public function setScheduleEndDay($schedule_end_day) /** * Gets schedule_end_hour * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartHour|null */ public function getScheduleEndHour() { @@ -858,12 +1013,15 @@ public function getScheduleEndHour() /** * Sets schedule_end_hour * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_end_hour schedule_end_hour + * @param \OpenAPI\Client\Model\EmployeeScheduleStartHour|null $schedule_end_hour schedule_end_hour * * @return self */ public function setScheduleEndHour($schedule_end_hour) { + if (is_null($schedule_end_hour)) { + throw new \InvalidArgumentException('non-nullable schedule_end_hour cannot be null'); + } $this->container['schedule_end_hour'] = $schedule_end_hour; return $this; @@ -872,7 +1030,7 @@ public function setScheduleEndHour($schedule_end_hour) /** * Gets schedule_end_minute * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null */ public function getScheduleEndMinute() { @@ -882,12 +1040,15 @@ public function getScheduleEndMinute() /** * Sets schedule_end_minute * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_end_minute schedule_end_minute + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null $schedule_end_minute schedule_end_minute * * @return self */ public function setScheduleEndMinute($schedule_end_minute) { + if (is_null($schedule_end_minute)) { + throw new \InvalidArgumentException('non-nullable schedule_end_minute cannot be null'); + } $this->container['schedule_end_minute'] = $schedule_end_minute; return $this; @@ -896,7 +1057,7 @@ public function setScheduleEndMinute($schedule_end_minute) /** * Gets schedule_end_meridiem * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null */ public function getScheduleEndMeridiem() { @@ -906,12 +1067,15 @@ public function getScheduleEndMeridiem() /** * Sets schedule_end_meridiem * - * @param string|null $schedule_end_meridiem schedule_end_meridiem + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null $schedule_end_meridiem schedule_end_meridiem * * @return self */ public function setScheduleEndMeridiem($schedule_end_meridiem) { + if (is_null($schedule_end_meridiem)) { + throw new \InvalidArgumentException('non-nullable schedule_end_meridiem cannot be null'); + } $this->container['schedule_end_meridiem'] = $schedule_end_meridiem; return $this; @@ -936,14 +1100,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling WTEmployee., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling WTEmployee., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling WTEmployee., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling WTEmployee., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -970,6 +1137,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -994,6 +1164,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -1018,6 +1191,9 @@ public function getUsername() */ public function setUsername($username) { + if (is_null($username)) { + throw new \InvalidArgumentException('non-nullable username cannot be null'); + } $this->container['username'] = $username; return $this; @@ -1042,6 +1218,9 @@ public function getEmailVerified() */ public function setEmailVerified($email_verified) { + if (is_null($email_verified)) { + throw new \InvalidArgumentException('non-nullable email_verified cannot be null'); + } $this->container['email_verified'] = $email_verified; return $this; @@ -1066,6 +1245,9 @@ public function getProfilePictureUrl() */ public function setProfilePictureUrl($profile_picture_url) { + if (is_null($profile_picture_url)) { + throw new \InvalidArgumentException('non-nullable profile_picture_url cannot be null'); + } $this->container['profile_picture_url'] = $profile_picture_url; return $this; @@ -1090,14 +1272,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTEmployee., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTEmployee., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTEmployee., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTEmployee., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -1124,6 +1309,9 @@ public function getSessionToken() */ public function setSessionToken($session_token) { + if (is_null($session_token)) { + throw new \InvalidArgumentException('non-nullable session_token cannot be null'); + } $this->container['session_token'] = $session_token; return $this; @@ -1132,7 +1320,7 @@ public function setSessionToken($session_token) /** * Gets failed_login_attempts * - * @return double|null + * @return float|null */ public function getFailedLoginAttempts() { @@ -1142,12 +1330,15 @@ public function getFailedLoginAttempts() /** * Sets failed_login_attempts * - * @param double|null $failed_login_attempts failed_login_attempts + * @param float|null $failed_login_attempts failed_login_attempts * * @return self */ public function setFailedLoginAttempts($failed_login_attempts) { + if (is_null($failed_login_attempts)) { + throw new \InvalidArgumentException('non-nullable failed_login_attempts cannot be null'); + } $this->container['failed_login_attempts'] = $failed_login_attempts; return $this; @@ -1172,6 +1363,9 @@ public function getLastLoginDate() */ public function setLastLoginDate($last_login_date) { + if (is_null($last_login_date)) { + throw new \InvalidArgumentException('non-nullable last_login_date cannot be null'); + } $this->container['last_login_date'] = $last_login_date; return $this; @@ -1196,6 +1390,9 @@ public function getCfuvid() */ public function setCfuvid($cfuvid) { + if (is_null($cfuvid)) { + throw new \InvalidArgumentException('non-nullable cfuvid cannot be null'); + } $this->container['cfuvid'] = $cfuvid; return $this; @@ -1220,6 +1417,9 @@ public function getSchedule() */ public function setSchedule($schedule) { + if (is_null($schedule)) { + throw new \InvalidArgumentException('non-nullable schedule cannot be null'); + } $this->container['schedule'] = $schedule; return $this; @@ -1244,6 +1444,9 @@ public function getIsEmailNotificationDisabled() */ public function setIsEmailNotificationDisabled($is_email_notification_disabled) { + if (is_null($is_email_notification_disabled)) { + throw new \InvalidArgumentException('non-nullable is_email_notification_disabled cannot be null'); + } $this->container['is_email_notification_disabled'] = $is_email_notification_disabled; return $this; @@ -1255,7 +1458,7 @@ public function setIsEmailNotificationDisabled($is_email_notification_disabled) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1267,6 +1470,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1280,7 +1484,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1296,7 +1500,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1308,6 +1512,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeAPIKey.php b/lib/Model/WTEmployeeAPIKey.php index 38ff3eb..0c8ac05 100644 --- a/lib/Model/WTEmployeeAPIKey.php +++ b/lib/Model/WTEmployeeAPIKey.php @@ -2,7 +2,7 @@ /** * WTEmployeeAPIKey * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeAPIKey implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class WTEmployeeAPIKey implements ModelInterface, ArrayAccess, \JsonSerializable 'title' => 'string', 'description' => 'string', 'employee_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -90,6 +88,30 @@ class WTEmployeeAPIKey implements ModelInterface, ArrayAccess, \JsonSerializable 'api_key' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'employee_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'api_key' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -110,6 +132,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -219,15 +293,33 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['api_key'] = $data['api_key'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('api_key', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -271,14 +363,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -337,6 +421,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTEmployeeAPIKey., must be bigger than or equal to 1.'); @@ -366,6 +453,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTEmployeeAPIKey., must be bigger than or equal to 1.'); @@ -395,14 +485,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTEmployeeAPIKey., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTEmployeeAPIKey., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling WTEmployeeAPIKey., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling WTEmployeeAPIKey., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -413,7 +506,7 @@ public function setEmployeeId($employee_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -423,19 +516,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTEmployeeAPIKey., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTEmployeeAPIKey., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -460,14 +549,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTEmployeeAPIKey., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTEmployeeAPIKey., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTEmployeeAPIKey., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTEmployeeAPIKey., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -494,6 +586,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -518,6 +613,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -542,6 +640,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -566,6 +667,9 @@ public function getApiKey() */ public function setApiKey($api_key) { + if (is_null($api_key)) { + throw new \InvalidArgumentException('non-nullable api_key cannot be null'); + } $this->container['api_key'] = $api_key; return $this; @@ -577,7 +681,7 @@ public function setApiKey($api_key) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -589,6 +693,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -602,7 +707,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -618,7 +723,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -630,6 +735,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeAPIKeyCreateParams.php b/lib/Model/WTEmployeeAPIKeyCreateParams.php index 49f853d..67390e1 100644 --- a/lib/Model/WTEmployeeAPIKeyCreateParams.php +++ b/lib/Model/WTEmployeeAPIKeyCreateParams.php @@ -2,7 +2,7 @@ /** * WTEmployeeAPIKeyCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeAPIKeyCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTEmployeeAPIKeyCreateParams implements ModelInterface, ArrayAccess, \Json 'description' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -245,6 +330,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTEmployeeAPIKeyCreateParams., must be bigger than or equal to 1.'); @@ -274,6 +362,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTEmployeeAPIKeyCreateParams., must be bigger than or equal to 1.'); @@ -290,7 +381,7 @@ public function setDescription($description) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -302,6 +393,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -315,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -331,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -343,6 +435,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeAPIKeyUpdateParams.php b/lib/Model/WTEmployeeAPIKeyUpdateParams.php index 1714949..59e43cc 100644 --- a/lib/Model/WTEmployeeAPIKeyUpdateParams.php +++ b/lib/Model/WTEmployeeAPIKeyUpdateParams.php @@ -2,7 +2,7 @@ /** * WTEmployeeAPIKeyUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeAPIKeyUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTEmployeeAPIKeyUpdateParams implements ModelInterface, ArrayAccess, \Json 'description' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -245,6 +330,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTEmployeeAPIKeyUpdateParams., must be bigger than or equal to 1.'); @@ -274,6 +362,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTEmployeeAPIKeyUpdateParams., must be bigger than or equal to 1.'); @@ -290,7 +381,7 @@ public function setDescription($description) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -302,6 +393,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -315,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -331,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -343,6 +435,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeCreate.php b/lib/Model/WTEmployeeCreate.php index de5fded..3b891f0 100644 --- a/lib/Model/WTEmployeeCreate.php +++ b/lib/Model/WTEmployeeCreate.php @@ -2,7 +2,7 @@ /** * WTEmployeeCreate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeCreate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,14 +67,14 @@ class WTEmployeeCreate implements ModelInterface, ArrayAccess, \JsonSerializable 'employee_id' => 'string', 'job_title' => 'string', 'department' => 'string', - 'schedule_start_day' => 'string', - 'schedule_start_hour' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_start_minute' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_start_meridiem' => 'string', - 'schedule_end_day' => 'string', - 'schedule_end_hour' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_end_minute' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_end_meridiem' => 'string' + 'schedule_start_day' => '\OpenAPI\Client\Model\EmployeeScheduleStartDay', + 'schedule_start_hour' => '\OpenAPI\Client\Model\EmployeeScheduleStartHour', + 'schedule_start_minute' => '\OpenAPI\Client\Model\EmployeeScheduleStartMinute', + 'schedule_start_meridiem' => '\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem', + 'schedule_end_day' => '\OpenAPI\Client\Model\EmployeeScheduleStartDay', + 'schedule_end_hour' => '\OpenAPI\Client\Model\EmployeeScheduleStartHour', + 'schedule_end_minute' => '\OpenAPI\Client\Model\EmployeeScheduleStartMinute', + 'schedule_end_meridiem' => '\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem' ]; /** @@ -106,6 +104,38 @@ class WTEmployeeCreate implements ModelInterface, ArrayAccess, \JsonSerializable 'schedule_end_meridiem' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email' => false, + 'phone_number' => false, + 'is_public_representative' => false, + 'wallet_sequence_number' => false, + 'employee_id' => false, + 'job_title' => false, + 'department' => false, + 'schedule_start_day' => false, + 'schedule_start_hour' => false, + 'schedule_start_minute' => false, + 'schedule_start_meridiem' => false, + 'schedule_end_day' => false, + 'schedule_end_hour' => false, + 'schedule_end_minute' => false, + 'schedule_end_meridiem' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -126,6 +156,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -259,23 +341,41 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email'] = $data['email'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['is_public_representative'] = $data['is_public_representative'] ?? null; - $this->container['wallet_sequence_number'] = $data['wallet_sequence_number'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['job_title'] = $data['job_title'] ?? null; - $this->container['department'] = $data['department'] ?? null; - $this->container['schedule_start_day'] = $data['schedule_start_day'] ?? null; - $this->container['schedule_start_hour'] = $data['schedule_start_hour'] ?? null; - $this->container['schedule_start_minute'] = $data['schedule_start_minute'] ?? null; - $this->container['schedule_start_meridiem'] = $data['schedule_start_meridiem'] ?? null; - $this->container['schedule_end_day'] = $data['schedule_end_day'] ?? null; - $this->container['schedule_end_hour'] = $data['schedule_end_hour'] ?? null; - $this->container['schedule_end_minute'] = $data['schedule_end_minute'] ?? null; - $this->container['schedule_end_meridiem'] = $data['schedule_end_meridiem'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('is_public_representative', $data ?? [], null); + $this->setIfExists('wallet_sequence_number', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('job_title', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('schedule_start_day', $data ?? [], null); + $this->setIfExists('schedule_start_hour', $data ?? [], null); + $this->setIfExists('schedule_start_minute', $data ?? [], null); + $this->setIfExists('schedule_start_meridiem', $data ?? [], null); + $this->setIfExists('schedule_end_day', $data ?? [], null); + $this->setIfExists('schedule_end_hour', $data ?? [], null); + $this->setIfExists('schedule_end_minute', $data ?? [], null); + $this->setIfExists('schedule_end_meridiem', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -372,6 +472,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling WTEmployeeCreate., must be bigger than or equal to 1.'); @@ -401,6 +504,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling WTEmployeeCreate., must be bigger than or equal to 1.'); @@ -430,6 +536,9 @@ public function getEmail() */ public function setEmail($email) { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } if ((mb_strlen($email) < 1)) { throw new \InvalidArgumentException('invalid length for $email when calling WTEmployeeCreate., must be bigger than or equal to 1.'); @@ -459,6 +568,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -483,6 +595,9 @@ public function getIsPublicRepresentative() */ public function setIsPublicRepresentative($is_public_representative) { + if (is_null($is_public_representative)) { + throw new \InvalidArgumentException('non-nullable is_public_representative cannot be null'); + } $this->container['is_public_representative'] = $is_public_representative; return $this; @@ -507,6 +622,9 @@ public function getWalletSequenceNumber() */ public function setWalletSequenceNumber($wallet_sequence_number) { + if (is_null($wallet_sequence_number)) { + throw new \InvalidArgumentException('non-nullable wallet_sequence_number cannot be null'); + } $this->container['wallet_sequence_number'] = $wallet_sequence_number; return $this; @@ -531,6 +649,9 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) < 0)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTEmployeeCreate., must be bigger than or equal to 0.'); @@ -560,6 +681,9 @@ public function getJobTitle() */ public function setJobTitle($job_title) { + if (is_null($job_title)) { + throw new \InvalidArgumentException('non-nullable job_title cannot be null'); + } if ((mb_strlen($job_title) < 0)) { throw new \InvalidArgumentException('invalid length for $job_title when calling WTEmployeeCreate., must be bigger than or equal to 0.'); @@ -589,6 +713,9 @@ public function getDepartment() */ public function setDepartment($department) { + if (is_null($department)) { + throw new \InvalidArgumentException('non-nullable department cannot be null'); + } if ((mb_strlen($department) < 0)) { throw new \InvalidArgumentException('invalid length for $department when calling WTEmployeeCreate., must be bigger than or equal to 0.'); @@ -602,7 +729,7 @@ public function setDepartment($department) /** * Gets schedule_start_day * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartDay|null */ public function getScheduleStartDay() { @@ -612,12 +739,15 @@ public function getScheduleStartDay() /** * Sets schedule_start_day * - * @param string|null $schedule_start_day schedule_start_day + * @param \OpenAPI\Client\Model\EmployeeScheduleStartDay|null $schedule_start_day schedule_start_day * * @return self */ public function setScheduleStartDay($schedule_start_day) { + if (is_null($schedule_start_day)) { + throw new \InvalidArgumentException('non-nullable schedule_start_day cannot be null'); + } $this->container['schedule_start_day'] = $schedule_start_day; return $this; @@ -626,7 +756,7 @@ public function setScheduleStartDay($schedule_start_day) /** * Gets schedule_start_hour * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartHour|null */ public function getScheduleStartHour() { @@ -636,12 +766,15 @@ public function getScheduleStartHour() /** * Sets schedule_start_hour * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_start_hour schedule_start_hour + * @param \OpenAPI\Client\Model\EmployeeScheduleStartHour|null $schedule_start_hour schedule_start_hour * * @return self */ public function setScheduleStartHour($schedule_start_hour) { + if (is_null($schedule_start_hour)) { + throw new \InvalidArgumentException('non-nullable schedule_start_hour cannot be null'); + } $this->container['schedule_start_hour'] = $schedule_start_hour; return $this; @@ -650,7 +783,7 @@ public function setScheduleStartHour($schedule_start_hour) /** * Gets schedule_start_minute * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null */ public function getScheduleStartMinute() { @@ -660,12 +793,15 @@ public function getScheduleStartMinute() /** * Sets schedule_start_minute * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_start_minute schedule_start_minute + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null $schedule_start_minute schedule_start_minute * * @return self */ public function setScheduleStartMinute($schedule_start_minute) { + if (is_null($schedule_start_minute)) { + throw new \InvalidArgumentException('non-nullable schedule_start_minute cannot be null'); + } $this->container['schedule_start_minute'] = $schedule_start_minute; return $this; @@ -674,7 +810,7 @@ public function setScheduleStartMinute($schedule_start_minute) /** * Gets schedule_start_meridiem * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null */ public function getScheduleStartMeridiem() { @@ -684,12 +820,15 @@ public function getScheduleStartMeridiem() /** * Sets schedule_start_meridiem * - * @param string|null $schedule_start_meridiem schedule_start_meridiem + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null $schedule_start_meridiem schedule_start_meridiem * * @return self */ public function setScheduleStartMeridiem($schedule_start_meridiem) { + if (is_null($schedule_start_meridiem)) { + throw new \InvalidArgumentException('non-nullable schedule_start_meridiem cannot be null'); + } $this->container['schedule_start_meridiem'] = $schedule_start_meridiem; return $this; @@ -698,7 +837,7 @@ public function setScheduleStartMeridiem($schedule_start_meridiem) /** * Gets schedule_end_day * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartDay|null */ public function getScheduleEndDay() { @@ -708,12 +847,15 @@ public function getScheduleEndDay() /** * Sets schedule_end_day * - * @param string|null $schedule_end_day schedule_end_day + * @param \OpenAPI\Client\Model\EmployeeScheduleStartDay|null $schedule_end_day schedule_end_day * * @return self */ public function setScheduleEndDay($schedule_end_day) { + if (is_null($schedule_end_day)) { + throw new \InvalidArgumentException('non-nullable schedule_end_day cannot be null'); + } $this->container['schedule_end_day'] = $schedule_end_day; return $this; @@ -722,7 +864,7 @@ public function setScheduleEndDay($schedule_end_day) /** * Gets schedule_end_hour * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartHour|null */ public function getScheduleEndHour() { @@ -732,12 +874,15 @@ public function getScheduleEndHour() /** * Sets schedule_end_hour * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_end_hour schedule_end_hour + * @param \OpenAPI\Client\Model\EmployeeScheduleStartHour|null $schedule_end_hour schedule_end_hour * * @return self */ public function setScheduleEndHour($schedule_end_hour) { + if (is_null($schedule_end_hour)) { + throw new \InvalidArgumentException('non-nullable schedule_end_hour cannot be null'); + } $this->container['schedule_end_hour'] = $schedule_end_hour; return $this; @@ -746,7 +891,7 @@ public function setScheduleEndHour($schedule_end_hour) /** * Gets schedule_end_minute * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null */ public function getScheduleEndMinute() { @@ -756,12 +901,15 @@ public function getScheduleEndMinute() /** * Sets schedule_end_minute * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_end_minute schedule_end_minute + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null $schedule_end_minute schedule_end_minute * * @return self */ public function setScheduleEndMinute($schedule_end_minute) { + if (is_null($schedule_end_minute)) { + throw new \InvalidArgumentException('non-nullable schedule_end_minute cannot be null'); + } $this->container['schedule_end_minute'] = $schedule_end_minute; return $this; @@ -770,7 +918,7 @@ public function setScheduleEndMinute($schedule_end_minute) /** * Gets schedule_end_meridiem * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null */ public function getScheduleEndMeridiem() { @@ -780,12 +928,15 @@ public function getScheduleEndMeridiem() /** * Sets schedule_end_meridiem * - * @param string|null $schedule_end_meridiem schedule_end_meridiem + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null $schedule_end_meridiem schedule_end_meridiem * * @return self */ public function setScheduleEndMeridiem($schedule_end_meridiem) { + if (is_null($schedule_end_meridiem)) { + throw new \InvalidArgumentException('non-nullable schedule_end_meridiem cannot be null'); + } $this->container['schedule_end_meridiem'] = $schedule_end_meridiem; return $this; @@ -797,7 +948,7 @@ public function setScheduleEndMeridiem($schedule_end_meridiem) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -809,6 +960,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -822,7 +974,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -838,7 +990,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -850,6 +1002,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeCreateDocument.php b/lib/Model/WTEmployeeCreateDocument.php index 4d09b66..d8046fe 100644 --- a/lib/Model/WTEmployeeCreateDocument.php +++ b/lib/Model/WTEmployeeCreateDocument.php @@ -2,7 +2,7 @@ /** * WTEmployeeCreateDocument * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeCreateDocument implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTEmployeeCreateDocument implements ModelInterface, ArrayAccess, \JsonSeri 'folder' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'file_name' => false, + 'file_data' => true, + 'folder' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['file_name'] = $data['file_name'] ?? null; - $this->container['file_data'] = $data['file_data'] ?? null; - $this->container['folder'] = $data['folder'] ?? null; + $this->setIfExists('file_name', $data ?? [], null); + $this->setIfExists('file_data', $data ?? [], null); + $this->setIfExists('folder', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -247,6 +333,9 @@ public function getFileName() */ public function setFileName($file_name) { + if (is_null($file_name)) { + throw new \InvalidArgumentException('non-nullable file_name cannot be null'); + } if ((mb_strlen($file_name) < 1)) { throw new \InvalidArgumentException('invalid length for $file_name when calling WTEmployeeCreateDocument., must be bigger than or equal to 1.'); @@ -276,6 +365,16 @@ public function getFileData() */ public function setFileData($file_data) { + if (is_null($file_data)) { + array_push($this->openAPINullablesSetToNull, 'file_data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('file_data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['file_data'] = $file_data; return $this; @@ -300,6 +399,9 @@ public function getFolder() */ public function setFolder($folder) { + if (is_null($folder)) { + throw new \InvalidArgumentException('non-nullable folder cannot be null'); + } $this->container['folder'] = $folder; return $this; @@ -311,7 +413,7 @@ public function setFolder($folder) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -323,6 +425,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -336,7 +439,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -352,7 +455,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -364,6 +467,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeCreateMediaFile.php b/lib/Model/WTEmployeeCreateMediaFile.php index fb42c47..8884b4b 100644 --- a/lib/Model/WTEmployeeCreateMediaFile.php +++ b/lib/Model/WTEmployeeCreateMediaFile.php @@ -2,7 +2,7 @@ /** * WTEmployeeCreateMediaFile * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeCreateMediaFile implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTEmployeeCreateMediaFile implements ModelInterface, ArrayAccess, \JsonSer 'folder' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'file_name' => false, + 'file_data' => true, + 'folder' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['file_name'] = $data['file_name'] ?? null; - $this->container['file_data'] = $data['file_data'] ?? null; - $this->container['folder'] = $data['folder'] ?? null; + $this->setIfExists('file_name', $data ?? [], null); + $this->setIfExists('file_data', $data ?? [], null); + $this->setIfExists('folder', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -247,6 +333,9 @@ public function getFileName() */ public function setFileName($file_name) { + if (is_null($file_name)) { + throw new \InvalidArgumentException('non-nullable file_name cannot be null'); + } if ((mb_strlen($file_name) < 1)) { throw new \InvalidArgumentException('invalid length for $file_name when calling WTEmployeeCreateMediaFile., must be bigger than or equal to 1.'); @@ -276,6 +365,16 @@ public function getFileData() */ public function setFileData($file_data) { + if (is_null($file_data)) { + array_push($this->openAPINullablesSetToNull, 'file_data'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('file_data', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['file_data'] = $file_data; return $this; @@ -300,6 +399,9 @@ public function getFolder() */ public function setFolder($folder) { + if (is_null($folder)) { + throw new \InvalidArgumentException('non-nullable folder cannot be null'); + } $this->container['folder'] = $folder; return $this; @@ -311,7 +413,7 @@ public function setFolder($folder) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -323,6 +425,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -336,7 +439,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -352,7 +455,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -364,6 +467,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeCreateStaticVoucherCampaignGroup.php b/lib/Model/WTEmployeeCreateStaticVoucherCampaignGroup.php index 881bb18..e159cd5 100644 --- a/lib/Model/WTEmployeeCreateStaticVoucherCampaignGroup.php +++ b/lib/Model/WTEmployeeCreateStaticVoucherCampaignGroup.php @@ -2,7 +2,7 @@ /** * WTEmployeeCreateStaticVoucherCampaignGroup * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeCreateStaticVoucherCampaignGroup implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTEmployeeCreateStaticVoucherCampaignGroup implements ModelInterface, Arra 'name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -232,6 +316,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } if ((mb_strlen($name) < 1)) { throw new \InvalidArgumentException('invalid length for $name when calling WTEmployeeCreateStaticVoucherCampaignGroup., must be bigger than or equal to 1.'); @@ -248,7 +335,7 @@ public function setName($name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,6 +347,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -273,7 +361,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -289,7 +377,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -301,6 +389,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeFileCreate.php b/lib/Model/WTEmployeeFileCreate.php index 562918a..71a2cb1 100644 --- a/lib/Model/WTEmployeeFileCreate.php +++ b/lib/Model/WTEmployeeFileCreate.php @@ -2,7 +2,7 @@ /** * WTEmployeeFileCreate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeFileCreate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTEmployeeFileCreate implements ModelInterface, ArrayAccess, \JsonSerializ 'file_data' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'file_name' => false, + 'file_data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['file_name'] = $data['file_name'] ?? null; - $this->container['file_data'] = $data['file_data'] ?? null; + $this->setIfExists('file_name', $data ?? [], null); + $this->setIfExists('file_data', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -241,6 +326,9 @@ public function getFileName() */ public function setFileName($file_name) { + if (is_null($file_name)) { + throw new \InvalidArgumentException('non-nullable file_name cannot be null'); + } if ((mb_strlen($file_name) < 1)) { throw new \InvalidArgumentException('invalid length for $file_name when calling WTEmployeeFileCreate., must be bigger than or equal to 1.'); @@ -270,6 +358,9 @@ public function getFileData() */ public function setFileData($file_data) { + if (is_null($file_data)) { + throw new \InvalidArgumentException('non-nullable file_data cannot be null'); + } $this->container['file_data'] = $file_data; return $this; @@ -281,7 +372,7 @@ public function setFileData($file_data) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -293,6 +384,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -306,7 +398,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -322,7 +414,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -334,6 +426,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeImportRecords.php b/lib/Model/WTEmployeeImportRecords.php index 4bb175c..2ad1ca0 100644 --- a/lib/Model/WTEmployeeImportRecords.php +++ b/lib/Model/WTEmployeeImportRecords.php @@ -2,7 +2,7 @@ /** * WTEmployeeImportRecords * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeImportRecords implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTEmployeeImportRecords implements ModelInterface, ArrayAccess, \JsonSeria 'bucket' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'file_name' => false, + 'bucket' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['file_name'] = $data['file_name'] ?? null; - $this->container['bucket'] = $data['bucket'] ?? null; + $this->setIfExists('file_name', $data ?? [], null); + $this->setIfExists('bucket', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -245,6 +330,9 @@ public function getFileName() */ public function setFileName($file_name) { + if (is_null($file_name)) { + throw new \InvalidArgumentException('non-nullable file_name cannot be null'); + } if ((mb_strlen($file_name) < 1)) { throw new \InvalidArgumentException('invalid length for $file_name when calling WTEmployeeImportRecords., must be bigger than or equal to 1.'); @@ -274,6 +362,9 @@ public function getBucket() */ public function setBucket($bucket) { + if (is_null($bucket)) { + throw new \InvalidArgumentException('non-nullable bucket cannot be null'); + } if ((mb_strlen($bucket) < 1)) { throw new \InvalidArgumentException('invalid length for $bucket when calling WTEmployeeImportRecords., must be bigger than or equal to 1.'); @@ -290,7 +381,7 @@ public function setBucket($bucket) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -302,6 +393,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -315,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -331,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -343,6 +435,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeNotification.php b/lib/Model/WTEmployeeNotification.php index 0295ee2..a1ca62e 100644 --- a/lib/Model/WTEmployeeNotification.php +++ b/lib/Model/WTEmployeeNotification.php @@ -2,7 +2,7 @@ /** * WTEmployeeNotification * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeNotification implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class WTEmployeeNotification implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'type' => 'string', + 'type' => '\OpenAPI\Client\Model\WTEmployeeNotificationType', 'title' => 'string', 'content' => 'string', 'payload' => 'mixed' @@ -80,6 +78,25 @@ class WTEmployeeNotification implements ModelInterface, ArrayAccess, \JsonSerial 'payload' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'type' => false, + 'title' => false, + 'content' => false, + 'payload' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +117,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -194,10 +263,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['type'] = $data['type'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['content'] = $data['content'] ?? null; - $this->container['payload'] = $data['payload'] ?? null; + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('payload', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -244,7 +331,7 @@ public function valid() /** * Gets type * - * @return string + * @return \OpenAPI\Client\Model\WTEmployeeNotificationType */ public function getType() { @@ -254,12 +341,15 @@ public function getType() /** * Sets type * - * @param string $type type + * @param \OpenAPI\Client\Model\WTEmployeeNotificationType $type type * * @return self */ public function setType($type) { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } $this->container['type'] = $type; return $this; @@ -284,6 +374,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTEmployeeNotification., must be bigger than or equal to 1.'); @@ -313,6 +406,9 @@ public function getContent() */ public function setContent($content) { + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); + } if ((mb_strlen($content) < 1)) { throw new \InvalidArgumentException('invalid length for $content when calling WTEmployeeNotification., must be bigger than or equal to 1.'); @@ -342,6 +438,16 @@ public function getPayload() */ public function setPayload($payload) { + if (is_null($payload)) { + array_push($this->openAPINullablesSetToNull, 'payload'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('payload', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['payload'] = $payload; return $this; @@ -353,7 +459,7 @@ public function setPayload($payload) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -365,6 +471,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -378,7 +485,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -394,7 +501,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -406,6 +513,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeNotificationType.php b/lib/Model/WTEmployeeNotificationType.php new file mode 100644 index 0000000..e86f825 --- /dev/null +++ b/lib/Model/WTEmployeeNotificationType.php @@ -0,0 +1,382 @@ + + */ +class WTEmployeeNotificationType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTEmployeeNotification_type'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTEmployeePeerRoles.php b/lib/Model/WTEmployeePeerRoles.php index 064ea36..fc61ecb 100644 --- a/lib/Model/WTEmployeePeerRoles.php +++ b/lib/Model/WTEmployeePeerRoles.php @@ -2,7 +2,7 @@ /** * WTEmployeePeerRoles * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeePeerRoles implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTEmployeePeerRoles implements ModelInterface, ArrayAccess, \JsonSerializa 'roles_array' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'roles_array' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['roles_array'] = $data['roles_array'] ?? null; + $this->setIfExists('roles_array', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -225,6 +309,9 @@ public function getRolesArray() */ public function setRolesArray($roles_array) { + if (is_null($roles_array)) { + throw new \InvalidArgumentException('non-nullable roles_array cannot be null'); + } $this->container['roles_array'] = $roles_array; return $this; @@ -236,7 +323,7 @@ public function setRolesArray($roles_array) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -248,6 +335,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -261,7 +349,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -277,7 +365,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -289,6 +377,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeS3FilePresign.php b/lib/Model/WTEmployeeS3FilePresign.php index da8ef59..797bb20 100644 --- a/lib/Model/WTEmployeeS3FilePresign.php +++ b/lib/Model/WTEmployeeS3FilePresign.php @@ -2,7 +2,7 @@ /** * WTEmployeeS3FilePresign * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeS3FilePresign implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class WTEmployeeS3FilePresign implements ModelInterface, ArrayAccess, \JsonSeria protected static $openAPITypes = [ 'file_name' => 'string', 'file_type' => 'string', - 'context' => 'string' + 'context' => '\OpenAPI\Client\Model\WTEmployeeS3FilePresignContext' ]; /** @@ -78,6 +76,24 @@ class WTEmployeeS3FilePresign implements ModelInterface, ArrayAccess, \JsonSeria 'context' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'file_name' => false, + 'file_type' => false, + 'context' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['file_name'] = $data['file_name'] ?? null; - $this->container['file_type'] = $data['file_type'] ?? null; - $this->container['context'] = $data['context'] ?? null; + $this->setIfExists('file_name', $data ?? [], null); + $this->setIfExists('file_type', $data ?? [], null); + $this->setIfExists('context', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -220,10 +306,6 @@ public function listInvalidProperties() if ($this->container['context'] === null) { $invalidProperties[] = "'context' can't be null"; } - if ((mb_strlen($this->container['context']) < 1)) { - $invalidProperties[] = "invalid value for 'context', the character length must be bigger than or equal to 1."; - } - return $invalidProperties; } @@ -258,6 +340,9 @@ public function getFileName() */ public function setFileName($file_name) { + if (is_null($file_name)) { + throw new \InvalidArgumentException('non-nullable file_name cannot be null'); + } if ((mb_strlen($file_name) < 1)) { throw new \InvalidArgumentException('invalid length for $file_name when calling WTEmployeeS3FilePresign., must be bigger than or equal to 1.'); @@ -287,6 +372,9 @@ public function getFileType() */ public function setFileType($file_type) { + if (is_null($file_type)) { + throw new \InvalidArgumentException('non-nullable file_type cannot be null'); + } if ((mb_strlen($file_type) < 1)) { throw new \InvalidArgumentException('invalid length for $file_type when calling WTEmployeeS3FilePresign., must be bigger than or equal to 1.'); @@ -300,7 +388,7 @@ public function setFileType($file_type) /** * Gets context * - * @return string + * @return \OpenAPI\Client\Model\WTEmployeeS3FilePresignContext */ public function getContext() { @@ -310,17 +398,15 @@ public function getContext() /** * Sets context * - * @param string $context context + * @param \OpenAPI\Client\Model\WTEmployeeS3FilePresignContext $context context * * @return self */ public function setContext($context) { - - if ((mb_strlen($context) < 1)) { - throw new \InvalidArgumentException('invalid length for $context when calling WTEmployeeS3FilePresign., must be bigger than or equal to 1.'); + if (is_null($context)) { + throw new \InvalidArgumentException('non-nullable context cannot be null'); } - $this->container['context'] = $context; return $this; @@ -332,7 +418,7 @@ public function setContext($context) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -344,6 +430,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -357,7 +444,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -373,7 +460,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -385,6 +472,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeS3FilePresignContext.php b/lib/Model/WTEmployeeS3FilePresignContext.php new file mode 100644 index 0000000..5a3b5ab --- /dev/null +++ b/lib/Model/WTEmployeeS3FilePresignContext.php @@ -0,0 +1,382 @@ + + */ +class WTEmployeeS3FilePresignContext implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTEmployeeS3FilePresign_context'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTEmployeeScheduleSMSCampaignBroadcast.php b/lib/Model/WTEmployeeScheduleSMSCampaignBroadcast.php index 433a398..c24c3ec 100644 --- a/lib/Model/WTEmployeeScheduleSMSCampaignBroadcast.php +++ b/lib/Model/WTEmployeeScheduleSMSCampaignBroadcast.php @@ -2,7 +2,7 @@ /** * WTEmployeeScheduleSMSCampaignBroadcast * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeScheduleSMSCampaignBroadcast implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -86,6 +84,28 @@ class WTEmployeeScheduleSMSCampaignBroadcast implements ModelInterface, ArrayAcc 'timezone' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_number_id' => false, + 'message_template' => false, + 'send_qr_code' => false, + 'media_urls' => false, + 'broadcast_scheduled_at' => false, + 'locale' => false, + 'timezone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -106,6 +126,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -209,13 +281,31 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['message_template'] = $data['message_template'] ?? null; - $this->container['send_qr_code'] = $data['send_qr_code'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; - $this->container['broadcast_scheduled_at'] = $data['broadcast_scheduled_at'] ?? null; - $this->container['locale'] = $data['locale'] ?? null; - $this->container['timezone'] = $data['timezone'] ?? null; + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('message_template', $data ?? [], null); + $this->setIfExists('send_qr_code', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + $this->setIfExists('broadcast_scheduled_at', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('timezone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -291,14 +381,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTEmployeeScheduleSMSCampaignBroadcast., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTEmployeeScheduleSMSCampaignBroadcast., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling WTEmployeeScheduleSMSCampaignBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling WTEmployeeScheduleSMSCampaignBroadcast., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -325,6 +418,9 @@ public function getMessageTemplate() */ public function setMessageTemplate($message_template) { + if (is_null($message_template)) { + throw new \InvalidArgumentException('non-nullable message_template cannot be null'); + } $this->container['message_template'] = $message_template; return $this; @@ -349,6 +445,9 @@ public function getSendQrCode() */ public function setSendQrCode($send_qr_code) { + if (is_null($send_qr_code)) { + throw new \InvalidArgumentException('non-nullable send_qr_code cannot be null'); + } $this->container['send_qr_code'] = $send_qr_code; return $this; @@ -373,6 +472,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -397,6 +499,9 @@ public function getBroadcastScheduledAt() */ public function setBroadcastScheduledAt($broadcast_scheduled_at) { + if (is_null($broadcast_scheduled_at)) { + throw new \InvalidArgumentException('non-nullable broadcast_scheduled_at cannot be null'); + } $this->container['broadcast_scheduled_at'] = $broadcast_scheduled_at; return $this; @@ -421,6 +526,9 @@ public function getLocale() */ public function setLocale($locale) { + if (is_null($locale)) { + throw new \InvalidArgumentException('non-nullable locale cannot be null'); + } $this->container['locale'] = $locale; return $this; @@ -445,6 +553,9 @@ public function getTimezone() */ public function setTimezone($timezone) { + if (is_null($timezone)) { + throw new \InvalidArgumentException('non-nullable timezone cannot be null'); + } $this->container['timezone'] = $timezone; return $this; @@ -456,7 +567,7 @@ public function setTimezone($timezone) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -468,6 +579,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -481,7 +593,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -497,7 +609,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -509,6 +621,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeScheduleSimpleSMS.php b/lib/Model/WTEmployeeScheduleSimpleSMS.php index 22950b1..7084e32 100644 --- a/lib/Model/WTEmployeeScheduleSimpleSMS.php +++ b/lib/Model/WTEmployeeScheduleSimpleSMS.php @@ -2,7 +2,7 @@ /** * WTEmployeeScheduleSimpleSMS * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeScheduleSimpleSMS implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class WTEmployeeScheduleSimpleSMS implements ModelInterface, ArrayAccess, \JsonS 'message_template' => 'string', 'media_urls' => 'string[]', 'broadcast_scheduled_at' => '\DateTime', - 'list_type' => 'string', + 'list_type' => '\OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSListType', 'list_id' => 'string' ]; @@ -84,6 +82,27 @@ class WTEmployeeScheduleSimpleSMS implements ModelInterface, ArrayAccess, \JsonS 'list_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_number_id' => false, + 'message_template' => false, + 'media_urls' => false, + 'broadcast_scheduled_at' => false, + 'list_type' => false, + 'list_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['message_template'] = $data['message_template'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; - $this->container['broadcast_scheduled_at'] = $data['broadcast_scheduled_at'] ?? null; - $this->container['list_type'] = $data['list_type'] ?? null; - $this->container['list_id'] = $data['list_id'] ?? null; + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('message_template', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + $this->setIfExists('broadcast_scheduled_at', $data ?? [], null); + $this->setIfExists('list_type', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -294,14 +383,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTEmployeeScheduleSimpleSMS., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTEmployeeScheduleSimpleSMS., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling WTEmployeeScheduleSimpleSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling WTEmployeeScheduleSimpleSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -328,6 +420,9 @@ public function getMessageTemplate() */ public function setMessageTemplate($message_template) { + if (is_null($message_template)) { + throw new \InvalidArgumentException('non-nullable message_template cannot be null'); + } $this->container['message_template'] = $message_template; return $this; @@ -352,6 +447,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -376,6 +474,9 @@ public function getBroadcastScheduledAt() */ public function setBroadcastScheduledAt($broadcast_scheduled_at) { + if (is_null($broadcast_scheduled_at)) { + throw new \InvalidArgumentException('non-nullable broadcast_scheduled_at cannot be null'); + } $this->container['broadcast_scheduled_at'] = $broadcast_scheduled_at; return $this; @@ -384,7 +485,7 @@ public function setBroadcastScheduledAt($broadcast_scheduled_at) /** * Gets list_type * - * @return string + * @return \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSListType */ public function getListType() { @@ -394,12 +495,15 @@ public function getListType() /** * Sets list_type * - * @param string $list_type list_type + * @param \OpenAPI\Client\Model\WTEmployeeScheduleSimpleSMSListType $list_type list_type * * @return self */ public function setListType($list_type) { + if (is_null($list_type)) { + throw new \InvalidArgumentException('non-nullable list_type cannot be null'); + } $this->container['list_type'] = $list_type; return $this; @@ -424,14 +528,17 @@ public function getListId() */ public function setListId($list_id) { + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + } if ((mb_strlen($list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling WTEmployeeScheduleSimpleSMS., must be smaller than or equal to 10.'); } if ((mb_strlen($list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling WTEmployeeScheduleSimpleSMS., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $list_id))) { - throw new \InvalidArgumentException("invalid value for $list_id when calling WTEmployeeScheduleSimpleSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($list_id)))) { + throw new \InvalidArgumentException("invalid value for \$list_id when calling WTEmployeeScheduleSimpleSMS., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['list_id'] = $list_id; @@ -445,7 +552,7 @@ public function setListId($list_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -457,6 +564,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -470,7 +578,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -486,7 +594,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -498,6 +606,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeScheduleSimpleSMSListType.php b/lib/Model/WTEmployeeScheduleSimpleSMSListType.php new file mode 100644 index 0000000..f7dd90b --- /dev/null +++ b/lib/Model/WTEmployeeScheduleSimpleSMSListType.php @@ -0,0 +1,382 @@ + + */ +class WTEmployeeScheduleSimpleSMSListType implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTEmployeeScheduleSimpleSMS_listType'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTEmployeeScheduleSimpleSMSToRecipient.php b/lib/Model/WTEmployeeScheduleSimpleSMSToRecipient.php index 4de048a..a67365c 100644 --- a/lib/Model/WTEmployeeScheduleSimpleSMSToRecipient.php +++ b/lib/Model/WTEmployeeScheduleSimpleSMSToRecipient.php @@ -2,7 +2,7 @@ /** * WTEmployeeScheduleSimpleSMSToRecipient * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeScheduleSimpleSMSToRecipient implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -82,6 +80,26 @@ class WTEmployeeScheduleSimpleSMSToRecipient implements ModelInterface, ArrayAcc 'to_cell_phone' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_number_id' => false, + 'message_template' => false, + 'media_urls' => false, + 'broadcast_scheduled_at' => false, + 'to_cell_phone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['message_template'] = $data['message_template'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; - $this->container['broadcast_scheduled_at'] = $data['broadcast_scheduled_at'] ?? null; - $this->container['to_cell_phone'] = $data['to_cell_phone'] ?? null; + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('message_template', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + $this->setIfExists('broadcast_scheduled_at', $data ?? [], null); + $this->setIfExists('to_cell_phone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -277,14 +365,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTEmployeeScheduleSimpleSMSToRecipient., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTEmployeeScheduleSimpleSMSToRecipient., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling WTEmployeeScheduleSimpleSMSToRecipient., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling WTEmployeeScheduleSimpleSMSToRecipient., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -311,6 +402,9 @@ public function getMessageTemplate() */ public function setMessageTemplate($message_template) { + if (is_null($message_template)) { + throw new \InvalidArgumentException('non-nullable message_template cannot be null'); + } $this->container['message_template'] = $message_template; return $this; @@ -335,6 +429,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -359,6 +456,9 @@ public function getBroadcastScheduledAt() */ public function setBroadcastScheduledAt($broadcast_scheduled_at) { + if (is_null($broadcast_scheduled_at)) { + throw new \InvalidArgumentException('non-nullable broadcast_scheduled_at cannot be null'); + } $this->container['broadcast_scheduled_at'] = $broadcast_scheduled_at; return $this; @@ -383,6 +483,9 @@ public function getToCellPhone() */ public function setToCellPhone($to_cell_phone) { + if (is_null($to_cell_phone)) { + throw new \InvalidArgumentException('non-nullable to_cell_phone cannot be null'); + } if ((mb_strlen($to_cell_phone) < 1)) { throw new \InvalidArgumentException('invalid length for $to_cell_phone when calling WTEmployeeScheduleSimpleSMSToRecipient., must be bigger than or equal to 1.'); @@ -399,7 +502,7 @@ public function setToCellPhone($to_cell_phone) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -411,6 +514,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -424,7 +528,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -440,7 +544,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -452,6 +556,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeSendHelpDeskResponse.php b/lib/Model/WTEmployeeSendHelpDeskResponse.php index 1742552..d48e283 100644 --- a/lib/Model/WTEmployeeSendHelpDeskResponse.php +++ b/lib/Model/WTEmployeeSendHelpDeskResponse.php @@ -2,7 +2,7 @@ /** * WTEmployeeSendHelpDeskResponse * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeSendHelpDeskResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTEmployeeSendHelpDeskResponse implements ModelInterface, ArrayAccess, \Js 'media_urls' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'help_desk_request_id' => false, + 'message' => false, + 'media_urls' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['help_desk_request_id'] = $data['help_desk_request_id'] ?? null; - $this->container['message'] = $data['message'] ?? null; - $this->container['media_urls'] = $data['media_urls'] ?? null; + $this->setIfExists('help_desk_request_id', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('media_urls', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -259,14 +345,17 @@ public function getHelpDeskRequestId() */ public function setHelpDeskRequestId($help_desk_request_id) { + if (is_null($help_desk_request_id)) { + throw new \InvalidArgumentException('non-nullable help_desk_request_id cannot be null'); + } if ((mb_strlen($help_desk_request_id) > 10)) { throw new \InvalidArgumentException('invalid length for $help_desk_request_id when calling WTEmployeeSendHelpDeskResponse., must be smaller than or equal to 10.'); } if ((mb_strlen($help_desk_request_id) < 10)) { throw new \InvalidArgumentException('invalid length for $help_desk_request_id when calling WTEmployeeSendHelpDeskResponse., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $help_desk_request_id))) { - throw new \InvalidArgumentException("invalid value for $help_desk_request_id when calling WTEmployeeSendHelpDeskResponse., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($help_desk_request_id)))) { + throw new \InvalidArgumentException("invalid value for \$help_desk_request_id when calling WTEmployeeSendHelpDeskResponse., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['help_desk_request_id'] = $help_desk_request_id; @@ -293,6 +382,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } if ((mb_strlen($message) < 1)) { throw new \InvalidArgumentException('invalid length for $message when calling WTEmployeeSendHelpDeskResponse., must be bigger than or equal to 1.'); @@ -322,6 +414,9 @@ public function getMediaUrls() */ public function setMediaUrls($media_urls) { + if (is_null($media_urls)) { + throw new \InvalidArgumentException('non-nullable media_urls cannot be null'); + } $this->container['media_urls'] = $media_urls; return $this; @@ -333,7 +428,7 @@ public function setMediaUrls($media_urls) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -345,6 +440,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -358,7 +454,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -374,7 +470,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -386,6 +482,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeUpdate.php b/lib/Model/WTEmployeeUpdate.php index a964fda..31a2c78 100644 --- a/lib/Model/WTEmployeeUpdate.php +++ b/lib/Model/WTEmployeeUpdate.php @@ -2,7 +2,7 @@ /** * WTEmployeeUpdate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeUpdate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -68,14 +66,14 @@ class WTEmployeeUpdate implements ModelInterface, ArrayAccess, \JsonSerializable 'wallet_sequence_number' => 'int', 'job_title' => 'string', 'department' => 'string', - 'schedule_start_day' => 'string', - 'schedule_start_hour' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_start_minute' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_start_meridiem' => 'string', - 'schedule_end_day' => 'string', - 'schedule_end_hour' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_end_minute' => 'AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber', - 'schedule_end_meridiem' => 'string' + 'schedule_start_day' => '\OpenAPI\Client\Model\EmployeeScheduleStartDay', + 'schedule_start_hour' => '\OpenAPI\Client\Model\EmployeeScheduleStartHour', + 'schedule_start_minute' => '\OpenAPI\Client\Model\EmployeeScheduleStartMinute', + 'schedule_start_meridiem' => '\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem', + 'schedule_end_day' => '\OpenAPI\Client\Model\EmployeeScheduleStartDay', + 'schedule_end_hour' => '\OpenAPI\Client\Model\EmployeeScheduleStartHour', + 'schedule_end_minute' => '\OpenAPI\Client\Model\EmployeeScheduleStartMinute', + 'schedule_end_meridiem' => '\OpenAPI\Client\Model\EmployeeScheduleStartMeridiem' ]; /** @@ -104,6 +102,37 @@ class WTEmployeeUpdate implements ModelInterface, ArrayAccess, \JsonSerializable 'schedule_end_meridiem' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false, + 'first_name' => false, + 'last_name' => false, + 'phone_number' => false, + 'is_public_representative' => false, + 'wallet_sequence_number' => false, + 'job_title' => false, + 'department' => false, + 'schedule_start_day' => false, + 'schedule_start_hour' => false, + 'schedule_start_minute' => false, + 'schedule_start_meridiem' => false, + 'schedule_end_day' => false, + 'schedule_end_hour' => false, + 'schedule_end_minute' => false, + 'schedule_end_meridiem' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -124,6 +153,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -254,22 +335,40 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['is_public_representative'] = $data['is_public_representative'] ?? null; - $this->container['wallet_sequence_number'] = $data['wallet_sequence_number'] ?? null; - $this->container['job_title'] = $data['job_title'] ?? null; - $this->container['department'] = $data['department'] ?? null; - $this->container['schedule_start_day'] = $data['schedule_start_day'] ?? null; - $this->container['schedule_start_hour'] = $data['schedule_start_hour'] ?? null; - $this->container['schedule_start_minute'] = $data['schedule_start_minute'] ?? null; - $this->container['schedule_start_meridiem'] = $data['schedule_start_meridiem'] ?? null; - $this->container['schedule_end_day'] = $data['schedule_end_day'] ?? null; - $this->container['schedule_end_hour'] = $data['schedule_end_hour'] ?? null; - $this->container['schedule_end_minute'] = $data['schedule_end_minute'] ?? null; - $this->container['schedule_end_meridiem'] = $data['schedule_end_meridiem'] ?? null; + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('is_public_representative', $data ?? [], null); + $this->setIfExists('wallet_sequence_number', $data ?? [], null); + $this->setIfExists('job_title', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('schedule_start_day', $data ?? [], null); + $this->setIfExists('schedule_start_hour', $data ?? [], null); + $this->setIfExists('schedule_start_minute', $data ?? [], null); + $this->setIfExists('schedule_start_meridiem', $data ?? [], null); + $this->setIfExists('schedule_end_day', $data ?? [], null); + $this->setIfExists('schedule_end_hour', $data ?? [], null); + $this->setIfExists('schedule_end_minute', $data ?? [], null); + $this->setIfExists('schedule_end_meridiem', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -359,6 +458,9 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) < 0)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTEmployeeUpdate., must be bigger than or equal to 0.'); @@ -388,6 +490,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling WTEmployeeUpdate., must be bigger than or equal to 1.'); @@ -417,6 +522,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling WTEmployeeUpdate., must be bigger than or equal to 1.'); @@ -446,6 +554,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -470,6 +581,9 @@ public function getIsPublicRepresentative() */ public function setIsPublicRepresentative($is_public_representative) { + if (is_null($is_public_representative)) { + throw new \InvalidArgumentException('non-nullable is_public_representative cannot be null'); + } $this->container['is_public_representative'] = $is_public_representative; return $this; @@ -494,6 +608,9 @@ public function getWalletSequenceNumber() */ public function setWalletSequenceNumber($wallet_sequence_number) { + if (is_null($wallet_sequence_number)) { + throw new \InvalidArgumentException('non-nullable wallet_sequence_number cannot be null'); + } $this->container['wallet_sequence_number'] = $wallet_sequence_number; return $this; @@ -518,6 +635,9 @@ public function getJobTitle() */ public function setJobTitle($job_title) { + if (is_null($job_title)) { + throw new \InvalidArgumentException('non-nullable job_title cannot be null'); + } if ((mb_strlen($job_title) < 0)) { throw new \InvalidArgumentException('invalid length for $job_title when calling WTEmployeeUpdate., must be bigger than or equal to 0.'); @@ -547,6 +667,9 @@ public function getDepartment() */ public function setDepartment($department) { + if (is_null($department)) { + throw new \InvalidArgumentException('non-nullable department cannot be null'); + } if ((mb_strlen($department) < 0)) { throw new \InvalidArgumentException('invalid length for $department when calling WTEmployeeUpdate., must be bigger than or equal to 0.'); @@ -560,7 +683,7 @@ public function setDepartment($department) /** * Gets schedule_start_day * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartDay|null */ public function getScheduleStartDay() { @@ -570,12 +693,15 @@ public function getScheduleStartDay() /** * Sets schedule_start_day * - * @param string|null $schedule_start_day schedule_start_day + * @param \OpenAPI\Client\Model\EmployeeScheduleStartDay|null $schedule_start_day schedule_start_day * * @return self */ public function setScheduleStartDay($schedule_start_day) { + if (is_null($schedule_start_day)) { + throw new \InvalidArgumentException('non-nullable schedule_start_day cannot be null'); + } $this->container['schedule_start_day'] = $schedule_start_day; return $this; @@ -584,7 +710,7 @@ public function setScheduleStartDay($schedule_start_day) /** * Gets schedule_start_hour * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartHour|null */ public function getScheduleStartHour() { @@ -594,12 +720,15 @@ public function getScheduleStartHour() /** * Sets schedule_start_hour * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_start_hour schedule_start_hour + * @param \OpenAPI\Client\Model\EmployeeScheduleStartHour|null $schedule_start_hour schedule_start_hour * * @return self */ public function setScheduleStartHour($schedule_start_hour) { + if (is_null($schedule_start_hour)) { + throw new \InvalidArgumentException('non-nullable schedule_start_hour cannot be null'); + } $this->container['schedule_start_hour'] = $schedule_start_hour; return $this; @@ -608,7 +737,7 @@ public function setScheduleStartHour($schedule_start_hour) /** * Gets schedule_start_minute * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null */ public function getScheduleStartMinute() { @@ -618,12 +747,15 @@ public function getScheduleStartMinute() /** * Sets schedule_start_minute * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_start_minute schedule_start_minute + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null $schedule_start_minute schedule_start_minute * * @return self */ public function setScheduleStartMinute($schedule_start_minute) { + if (is_null($schedule_start_minute)) { + throw new \InvalidArgumentException('non-nullable schedule_start_minute cannot be null'); + } $this->container['schedule_start_minute'] = $schedule_start_minute; return $this; @@ -632,7 +764,7 @@ public function setScheduleStartMinute($schedule_start_minute) /** * Gets schedule_start_meridiem * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null */ public function getScheduleStartMeridiem() { @@ -642,12 +774,15 @@ public function getScheduleStartMeridiem() /** * Sets schedule_start_meridiem * - * @param string|null $schedule_start_meridiem schedule_start_meridiem + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null $schedule_start_meridiem schedule_start_meridiem * * @return self */ public function setScheduleStartMeridiem($schedule_start_meridiem) { + if (is_null($schedule_start_meridiem)) { + throw new \InvalidArgumentException('non-nullable schedule_start_meridiem cannot be null'); + } $this->container['schedule_start_meridiem'] = $schedule_start_meridiem; return $this; @@ -656,7 +791,7 @@ public function setScheduleStartMeridiem($schedule_start_meridiem) /** * Gets schedule_end_day * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartDay|null */ public function getScheduleEndDay() { @@ -666,12 +801,15 @@ public function getScheduleEndDay() /** * Sets schedule_end_day * - * @param string|null $schedule_end_day schedule_end_day + * @param \OpenAPI\Client\Model\EmployeeScheduleStartDay|null $schedule_end_day schedule_end_day * * @return self */ public function setScheduleEndDay($schedule_end_day) { + if (is_null($schedule_end_day)) { + throw new \InvalidArgumentException('non-nullable schedule_end_day cannot be null'); + } $this->container['schedule_end_day'] = $schedule_end_day; return $this; @@ -680,7 +818,7 @@ public function setScheduleEndDay($schedule_end_day) /** * Gets schedule_end_hour * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartHour|null */ public function getScheduleEndHour() { @@ -690,12 +828,15 @@ public function getScheduleEndHour() /** * Sets schedule_end_hour * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_end_hour schedule_end_hour + * @param \OpenAPI\Client\Model\EmployeeScheduleStartHour|null $schedule_end_hour schedule_end_hour * * @return self */ public function setScheduleEndHour($schedule_end_hour) { + if (is_null($schedule_end_hour)) { + throw new \InvalidArgumentException('non-nullable schedule_end_hour cannot be null'); + } $this->container['schedule_end_hour'] = $schedule_end_hour; return $this; @@ -704,7 +845,7 @@ public function setScheduleEndHour($schedule_end_hour) /** * Gets schedule_end_minute * - * @return AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null */ public function getScheduleEndMinute() { @@ -714,12 +855,15 @@ public function getScheduleEndMinute() /** * Sets schedule_end_minute * - * @param AnyOfNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumberNumber|null $schedule_end_minute schedule_end_minute + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMinute|null $schedule_end_minute schedule_end_minute * * @return self */ public function setScheduleEndMinute($schedule_end_minute) { + if (is_null($schedule_end_minute)) { + throw new \InvalidArgumentException('non-nullable schedule_end_minute cannot be null'); + } $this->container['schedule_end_minute'] = $schedule_end_minute; return $this; @@ -728,7 +872,7 @@ public function setScheduleEndMinute($schedule_end_minute) /** * Gets schedule_end_meridiem * - * @return string|null + * @return \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null */ public function getScheduleEndMeridiem() { @@ -738,12 +882,15 @@ public function getScheduleEndMeridiem() /** * Sets schedule_end_meridiem * - * @param string|null $schedule_end_meridiem schedule_end_meridiem + * @param \OpenAPI\Client\Model\EmployeeScheduleStartMeridiem|null $schedule_end_meridiem schedule_end_meridiem * * @return self */ public function setScheduleEndMeridiem($schedule_end_meridiem) { + if (is_null($schedule_end_meridiem)) { + throw new \InvalidArgumentException('non-nullable schedule_end_meridiem cannot be null'); + } $this->container['schedule_end_meridiem'] = $schedule_end_meridiem; return $this; @@ -755,7 +902,7 @@ public function setScheduleEndMeridiem($schedule_end_meridiem) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -767,6 +914,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -780,7 +928,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -796,7 +944,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -808,6 +956,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTEmployeeUpdateRecords.php b/lib/Model/WTEmployeeUpdateRecords.php index 80abf41..a3d8e01 100644 --- a/lib/Model/WTEmployeeUpdateRecords.php +++ b/lib/Model/WTEmployeeUpdateRecords.php @@ -2,7 +2,7 @@ /** * WTEmployeeUpdateRecords * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTEmployeeUpdateRecords implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTEmployeeUpdateRecords implements ModelInterface, ArrayAccess, \JsonSeria 'bucket' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'file_name' => false, + 'bucket' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['file_name'] = $data['file_name'] ?? null; - $this->container['bucket'] = $data['bucket'] ?? null; + $this->setIfExists('file_name', $data ?? [], null); + $this->setIfExists('bucket', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -245,6 +330,9 @@ public function getFileName() */ public function setFileName($file_name) { + if (is_null($file_name)) { + throw new \InvalidArgumentException('non-nullable file_name cannot be null'); + } if ((mb_strlen($file_name) < 1)) { throw new \InvalidArgumentException('invalid length for $file_name when calling WTEmployeeUpdateRecords., must be bigger than or equal to 1.'); @@ -274,6 +362,9 @@ public function getBucket() */ public function setBucket($bucket) { + if (is_null($bucket)) { + throw new \InvalidArgumentException('non-nullable bucket cannot be null'); + } if ((mb_strlen($bucket) < 1)) { throw new \InvalidArgumentException('invalid length for $bucket when calling WTEmployeeUpdateRecords., must be bigger than or equal to 1.'); @@ -290,7 +381,7 @@ public function setBucket($bucket) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -302,6 +393,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -315,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -331,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -343,6 +435,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTFetchWalletPaymentObjectsWithToken.php b/lib/Model/WTFetchWalletPaymentObjectsWithToken.php index a30d018..a10edc5 100644 --- a/lib/Model/WTFetchWalletPaymentObjectsWithToken.php +++ b/lib/Model/WTFetchWalletPaymentObjectsWithToken.php @@ -2,7 +2,7 @@ /** * WTFetchWalletPaymentObjectsWithToken * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTFetchWalletPaymentObjectsWithToken implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -82,6 +80,26 @@ class WTFetchWalletPaymentObjectsWithToken implements ModelInterface, ArrayAcces 'referrer' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_verification_token' => false, + 'merchant_id' => false, + 'page_type' => false, + 'is_refresh' => false, + 'referrer' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phone_verification_token'] = $data['phone_verification_token'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['page_type'] = $data['page_type'] ?? null; - $this->container['is_refresh'] = $data['is_refresh'] ?? null; - $this->container['referrer'] = $data['referrer'] ?? null; + $this->setIfExists('phone_verification_token', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('page_type', $data ?? [], null); + $this->setIfExists('is_refresh', $data ?? [], null); + $this->setIfExists('referrer', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -270,6 +358,9 @@ public function getPhoneVerificationToken() */ public function setPhoneVerificationToken($phone_verification_token) { + if (is_null($phone_verification_token)) { + throw new \InvalidArgumentException('non-nullable phone_verification_token cannot be null'); + } $this->container['phone_verification_token'] = $phone_verification_token; return $this; @@ -294,14 +385,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTFetchWalletPaymentObjectsWithToken., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTFetchWalletPaymentObjectsWithToken., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTFetchWalletPaymentObjectsWithToken., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTFetchWalletPaymentObjectsWithToken., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -328,6 +422,9 @@ public function getPageType() */ public function setPageType($page_type) { + if (is_null($page_type)) { + throw new \InvalidArgumentException('non-nullable page_type cannot be null'); + } $this->container['page_type'] = $page_type; return $this; @@ -352,6 +449,9 @@ public function getIsRefresh() */ public function setIsRefresh($is_refresh) { + if (is_null($is_refresh)) { + throw new \InvalidArgumentException('non-nullable is_refresh cannot be null'); + } $this->container['is_refresh'] = $is_refresh; return $this; @@ -376,6 +476,9 @@ public function getReferrer() */ public function setReferrer($referrer) { + if (is_null($referrer)) { + throw new \InvalidArgumentException('non-nullable referrer cannot be null'); + } $this->container['referrer'] = $referrer; return $this; @@ -387,7 +490,7 @@ public function setReferrer($referrer) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -399,6 +502,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -412,7 +516,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -428,7 +532,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -440,6 +544,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTGamingCreateParams.php b/lib/Model/WTGamingCreateParams.php index b86ddc7..72012fb 100644 --- a/lib/Model/WTGamingCreateParams.php +++ b/lib/Model/WTGamingCreateParams.php @@ -2,7 +2,7 @@ /** * WTGamingCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTGamingCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTGamingCreateParams implements ModelInterface, ArrayAccess, \JsonSerializ 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTGamingCreateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTGamingCreateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTGamingCreateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTGamingUpdateParams.php b/lib/Model/WTGamingUpdateParams.php index 0db4b72..68cbd93 100644 --- a/lib/Model/WTGamingUpdateParams.php +++ b/lib/Model/WTGamingUpdateParams.php @@ -2,7 +2,7 @@ /** * WTGamingUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTGamingUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTGamingUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializ 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTGamingUpdateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTGamingUpdateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTGamingUpdateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTImageGridCreateParams.php b/lib/Model/WTImageGridCreateParams.php index aa64ce9..48f898c 100644 --- a/lib/Model/WTImageGridCreateParams.php +++ b/lib/Model/WTImageGridCreateParams.php @@ -2,7 +2,7 @@ /** * WTImageGridCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTImageGridCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -82,6 +80,26 @@ class WTImageGridCreateParams implements ModelInterface, ArrayAccess, \JsonSeria 'is_pinned' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'url' => false, + 'media_url' => false, + 'sequence_number' => false, + 'is_pinned' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['sequence_number'] = $data['sequence_number'] ?? null; - $this->container['is_pinned'] = $data['is_pinned'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('sequence_number', $data ?? [], null); + $this->setIfExists('is_pinned', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -277,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTImageGridCreateParams., must be bigger than or equal to 1.'); @@ -306,6 +397,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } if ((mb_strlen($url) < 1)) { throw new \InvalidArgumentException('invalid length for $url when calling WTImageGridCreateParams., must be bigger than or equal to 1.'); @@ -335,6 +429,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } if ((mb_strlen($media_url) < 1)) { throw new \InvalidArgumentException('invalid length for $media_url when calling WTImageGridCreateParams., must be bigger than or equal to 1.'); @@ -364,6 +461,9 @@ public function getSequenceNumber() */ public function setSequenceNumber($sequence_number) { + if (is_null($sequence_number)) { + throw new \InvalidArgumentException('non-nullable sequence_number cannot be null'); + } if (($sequence_number < 1)) { throw new \InvalidArgumentException('invalid value for $sequence_number when calling WTImageGridCreateParams., must be bigger than or equal to 1.'); @@ -393,6 +493,9 @@ public function getIsPinned() */ public function setIsPinned($is_pinned) { + if (is_null($is_pinned)) { + throw new \InvalidArgumentException('non-nullable is_pinned cannot be null'); + } $this->container['is_pinned'] = $is_pinned; return $this; @@ -404,7 +507,7 @@ public function setIsPinned($is_pinned) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -416,6 +519,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -429,7 +533,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -445,7 +549,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -457,6 +561,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTImageGridUpdateParams.php b/lib/Model/WTImageGridUpdateParams.php index c38ad16..c6d286b 100644 --- a/lib/Model/WTImageGridUpdateParams.php +++ b/lib/Model/WTImageGridUpdateParams.php @@ -2,7 +2,7 @@ /** * WTImageGridUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTImageGridUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -82,6 +80,26 @@ class WTImageGridUpdateParams implements ModelInterface, ArrayAccess, \JsonSeria 'is_pinned' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'url' => false, + 'media_url' => false, + 'sequence_number' => false, + 'is_pinned' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['sequence_number'] = $data['sequence_number'] ?? null; - $this->container['is_pinned'] = $data['is_pinned'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('sequence_number', $data ?? [], null); + $this->setIfExists('is_pinned', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -277,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTImageGridUpdateParams., must be bigger than or equal to 1.'); @@ -306,6 +397,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } if ((mb_strlen($url) < 1)) { throw new \InvalidArgumentException('invalid length for $url when calling WTImageGridUpdateParams., must be bigger than or equal to 1.'); @@ -335,6 +429,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } if ((mb_strlen($media_url) < 1)) { throw new \InvalidArgumentException('invalid length for $media_url when calling WTImageGridUpdateParams., must be bigger than or equal to 1.'); @@ -364,6 +461,9 @@ public function getSequenceNumber() */ public function setSequenceNumber($sequence_number) { + if (is_null($sequence_number)) { + throw new \InvalidArgumentException('non-nullable sequence_number cannot be null'); + } if (($sequence_number < 1)) { throw new \InvalidArgumentException('invalid value for $sequence_number when calling WTImageGridUpdateParams., must be bigger than or equal to 1.'); @@ -393,6 +493,9 @@ public function getIsPinned() */ public function setIsPinned($is_pinned) { + if (is_null($is_pinned)) { + throw new \InvalidArgumentException('non-nullable is_pinned cannot be null'); + } $this->container['is_pinned'] = $is_pinned; return $this; @@ -404,7 +507,7 @@ public function setIsPinned($is_pinned) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -416,6 +519,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -429,7 +533,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -445,7 +549,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -457,6 +561,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTImportedList.php b/lib/Model/WTImportedList.php index 6566dbc..400ab86 100644 --- a/lib/Model/WTImportedList.php +++ b/lib/Model/WTImportedList.php @@ -2,7 +2,7 @@ /** * WTImportedList * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTImportedList implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class WTImportedList implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => 'bool', 'list_name' => 'string', 'phone_number_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime' @@ -88,6 +86,29 @@ class WTImportedList implements ModelInterface, ArrayAccess, \JsonSerializable 'updated_at' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false, + 'is_active' => false, + 'list_name' => false, + 'phone_number_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -214,14 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['list_name'] = $data['list_name'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('list_name', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -272,14 +363,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -335,14 +418,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTImportedList., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTImportedList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling WTImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling WTImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -369,6 +455,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -393,6 +482,9 @@ public function getListName() */ public function setListName($list_name) { + if (is_null($list_name)) { + throw new \InvalidArgumentException('non-nullable list_name cannot be null'); + } $this->container['list_name'] = $list_name; return $this; @@ -417,14 +509,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTImportedList., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTImportedList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling WTImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling WTImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -435,7 +530,7 @@ public function setPhoneNumberId($phone_number_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -445,19 +540,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTImportedList., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTImportedList., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -482,14 +573,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTImportedList., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTImportedList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTImportedList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -516,6 +610,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -540,6 +637,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -551,7 +651,7 @@ public function setUpdatedAt($updated_at) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -563,6 +663,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -576,7 +677,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -592,7 +693,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -604,6 +705,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTImportedListRecipientFromMembershipTierImport.php b/lib/Model/WTImportedListRecipientFromMembershipTierImport.php index a40e9a9..c9a40b7 100644 --- a/lib/Model/WTImportedListRecipientFromMembershipTierImport.php +++ b/lib/Model/WTImportedListRecipientFromMembershipTierImport.php @@ -2,7 +2,7 @@ /** * WTImportedListRecipientFromMembershipTierImport * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTImportedListRecipientFromMembershipTierImport implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -62,7 +60,7 @@ class WTImportedListRecipientFromMembershipTierImport implements ModelInterface, protected static $openAPITypes = [ 'list_name' => 'string', 'phone_number_id' => 'string', - 'tier_id' => 'string' + 'tier_id' => '\OpenAPI\Client\Model\WTImportedListRecipientFromMembershipTierImportTierID' ]; /** @@ -78,6 +76,24 @@ class WTImportedListRecipientFromMembershipTierImport implements ModelInterface, 'tier_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'list_name' => false, + 'phone_number_id' => false, + 'tier_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['list_name'] = $data['list_name'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['tier_id'] = $data['tier_id'] ?? null; + $this->setIfExists('list_name', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('tier_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -258,6 +344,9 @@ public function getListName() */ public function setListName($list_name) { + if (is_null($list_name)) { + throw new \InvalidArgumentException('non-nullable list_name cannot be null'); + } $this->container['list_name'] = $list_name; return $this; @@ -282,14 +371,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTImportedListRecipientFromMembershipTierImport., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTImportedListRecipientFromMembershipTierImport., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling WTImportedListRecipientFromMembershipTierImport., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling WTImportedListRecipientFromMembershipTierImport., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -300,7 +392,7 @@ public function setPhoneNumberId($phone_number_id) /** * Gets tier_id * - * @return string + * @return \OpenAPI\Client\Model\WTImportedListRecipientFromMembershipTierImportTierID */ public function getTierId() { @@ -310,12 +402,15 @@ public function getTierId() /** * Sets tier_id * - * @param string $tier_id tier_id + * @param \OpenAPI\Client\Model\WTImportedListRecipientFromMembershipTierImportTierID $tier_id tier_id * * @return self */ public function setTierId($tier_id) { + if (is_null($tier_id)) { + throw new \InvalidArgumentException('non-nullable tier_id cannot be null'); + } $this->container['tier_id'] = $tier_id; return $this; @@ -327,7 +422,7 @@ public function setTierId($tier_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -339,6 +434,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -352,7 +448,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -368,7 +464,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -380,6 +476,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTImportedListRecipientFromMembershipTierImportTierID.php b/lib/Model/WTImportedListRecipientFromMembershipTierImportTierID.php new file mode 100644 index 0000000..4596638 --- /dev/null +++ b/lib/Model/WTImportedListRecipientFromMembershipTierImportTierID.php @@ -0,0 +1,382 @@ + + */ +class WTImportedListRecipientFromMembershipTierImportTierID implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTImportedListRecipientFromMembershipTierImport_tierID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTInfoGenesisLookupRequestErrors.php b/lib/Model/WTInfoGenesisLookupRequestErrors.php index 3c51d4c..201dc3b 100644 --- a/lib/Model/WTInfoGenesisLookupRequestErrors.php +++ b/lib/Model/WTInfoGenesisLookupRequestErrors.php @@ -2,7 +2,7 @@ /** * WTInfoGenesisLookupRequestErrors * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTInfoGenesisLookupRequestErrors implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -80,6 +78,25 @@ class WTInfoGenesisLookupRequestErrors implements ModelInterface, ArrayAccess, \ 'routing_ids' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'start_date_time' => false, + 'end_date_time' => false, + 'selected_registers' => false, + 'routing_ids' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +117,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -194,10 +263,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['start_date_time'] = $data['start_date_time'] ?? null; - $this->container['end_date_time'] = $data['end_date_time'] ?? null; - $this->container['selected_registers'] = $data['selected_registers'] ?? null; - $this->container['routing_ids'] = $data['routing_ids'] ?? null; + $this->setIfExists('start_date_time', $data ?? [], null); + $this->setIfExists('end_date_time', $data ?? [], null); + $this->setIfExists('selected_registers', $data ?? [], null); + $this->setIfExists('routing_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -249,6 +336,9 @@ public function getStartDateTime() */ public function setStartDateTime($start_date_time) { + if (is_null($start_date_time)) { + throw new \InvalidArgumentException('non-nullable start_date_time cannot be null'); + } $this->container['start_date_time'] = $start_date_time; return $this; @@ -273,6 +363,9 @@ public function getEndDateTime() */ public function setEndDateTime($end_date_time) { + if (is_null($end_date_time)) { + throw new \InvalidArgumentException('non-nullable end_date_time cannot be null'); + } $this->container['end_date_time'] = $end_date_time; return $this; @@ -297,6 +390,9 @@ public function getSelectedRegisters() */ public function setSelectedRegisters($selected_registers) { + if (is_null($selected_registers)) { + throw new \InvalidArgumentException('non-nullable selected_registers cannot be null'); + } $this->container['selected_registers'] = $selected_registers; return $this; @@ -321,6 +417,9 @@ public function getRoutingIds() */ public function setRoutingIds($routing_ids) { + if (is_null($routing_ids)) { + throw new \InvalidArgumentException('non-nullable routing_ids cannot be null'); + } $this->container['routing_ids'] = $routing_ids; return $this; @@ -332,7 +431,7 @@ public function setRoutingIds($routing_ids) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -344,6 +443,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -357,7 +457,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -373,7 +473,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -385,6 +485,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTInfoGenesisRecordFilterParameters.php b/lib/Model/WTInfoGenesisRecordFilterParameters.php index 67c0ca5..a1d9d2b 100644 --- a/lib/Model/WTInfoGenesisRecordFilterParameters.php +++ b/lib/Model/WTInfoGenesisRecordFilterParameters.php @@ -2,7 +2,7 @@ /** * WTInfoGenesisRecordFilterParameters * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTInfoGenesisRecordFilterParameters implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTInfoGenesisRecordFilterParameters implements ModelInterface, ArrayAccess 'selected_registers' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'start_date_time' => false, + 'end_date_time' => false, + 'selected_registers' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['start_date_time'] = $data['start_date_time'] ?? null; - $this->container['end_date_time'] = $data['end_date_time'] ?? null; - $this->container['selected_registers'] = $data['selected_registers'] ?? null; + $this->setIfExists('start_date_time', $data ?? [], null); + $this->setIfExists('end_date_time', $data ?? [], null); + $this->setIfExists('selected_registers', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -243,6 +329,9 @@ public function getStartDateTime() */ public function setStartDateTime($start_date_time) { + if (is_null($start_date_time)) { + throw new \InvalidArgumentException('non-nullable start_date_time cannot be null'); + } $this->container['start_date_time'] = $start_date_time; return $this; @@ -267,6 +356,9 @@ public function getEndDateTime() */ public function setEndDateTime($end_date_time) { + if (is_null($end_date_time)) { + throw new \InvalidArgumentException('non-nullable end_date_time cannot be null'); + } $this->container['end_date_time'] = $end_date_time; return $this; @@ -291,6 +383,9 @@ public function getSelectedRegisters() */ public function setSelectedRegisters($selected_registers) { + if (is_null($selected_registers)) { + throw new \InvalidArgumentException('non-nullable selected_registers cannot be null'); + } $this->container['selected_registers'] = $selected_registers; return $this; @@ -302,7 +397,7 @@ public function setSelectedRegisters($selected_registers) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -314,6 +409,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -327,7 +423,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -343,7 +439,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -355,6 +451,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTInfoGenesisRoutingIDs.php b/lib/Model/WTInfoGenesisRoutingIDs.php index c3ba378..77d9c52 100644 --- a/lib/Model/WTInfoGenesisRoutingIDs.php +++ b/lib/Model/WTInfoGenesisRoutingIDs.php @@ -2,7 +2,7 @@ /** * WTInfoGenesisRoutingIDs * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTInfoGenesisRoutingIDs implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTInfoGenesisRoutingIDs implements ModelInterface, ArrayAccess, \JsonSeria 'routing_ids' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'routing_ids' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['routing_ids'] = $data['routing_ids'] ?? null; + $this->setIfExists('routing_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -228,6 +312,9 @@ public function getRoutingIds() */ public function setRoutingIds($routing_ids) { + if (is_null($routing_ids)) { + throw new \InvalidArgumentException('non-nullable routing_ids cannot be null'); + } $this->container['routing_ids'] = $routing_ids; return $this; @@ -239,7 +326,7 @@ public function setRoutingIds($routing_ids) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -251,6 +338,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -264,7 +352,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -280,7 +368,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -292,6 +380,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTInfoGenesisUniquePostingIDs.php b/lib/Model/WTInfoGenesisUniquePostingIDs.php index 15ca372..b637462 100644 --- a/lib/Model/WTInfoGenesisUniquePostingIDs.php +++ b/lib/Model/WTInfoGenesisUniquePostingIDs.php @@ -2,7 +2,7 @@ /** * WTInfoGenesisUniquePostingIDs * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTInfoGenesisUniquePostingIDs implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTInfoGenesisUniquePostingIDs implements ModelInterface, ArrayAccess, \Jso 'unique_posting_ids' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'unique_posting_ids' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['unique_posting_ids'] = $data['unique_posting_ids'] ?? null; + $this->setIfExists('unique_posting_ids', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -228,6 +312,9 @@ public function getUniquePostingIds() */ public function setUniquePostingIds($unique_posting_ids) { + if (is_null($unique_posting_ids)) { + throw new \InvalidArgumentException('non-nullable unique_posting_ids cannot be null'); + } $this->container['unique_posting_ids'] = $unique_posting_ids; return $this; @@ -239,7 +326,7 @@ public function setUniquePostingIds($unique_posting_ids) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -251,6 +338,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -264,7 +352,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -280,7 +368,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -292,6 +380,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTLinkBook.php b/lib/Model/WTLinkBook.php index 4c92d9d..d1721c4 100644 --- a/lib/Model/WTLinkBook.php +++ b/lib/Model/WTLinkBook.php @@ -2,7 +2,7 @@ /** * WTLinkBook * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTLinkBook implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,8 +62,8 @@ class WTLinkBook implements ModelInterface, ArrayAccess, \JsonSerializable 'url' => 'string', 'icon' => 'string', 'order_number' => 'int', - 'link_book_section_id' => 'stringNumber', - 'id' => 'string', + 'link_book_section_id' => '\OpenAPI\Client\Model\WTLinkBookLinkBookSectionID', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -92,6 +90,31 @@ class WTLinkBook implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'url' => false, + 'icon' => false, + 'order_number' => false, + 'link_book_section_id' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['icon'] = $data['icon'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['link_book_section_id'] = $data['link_book_section_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('link_book_section_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -334,6 +427,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTLinkBook., must be bigger than or equal to 1.'); @@ -363,6 +459,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } if ((mb_strlen($url) < 1)) { throw new \InvalidArgumentException('invalid length for $url when calling WTLinkBook., must be bigger than or equal to 1.'); @@ -392,6 +491,9 @@ public function getIcon() */ public function setIcon($icon) { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } if ((mb_strlen($icon) < 1)) { throw new \InvalidArgumentException('invalid length for $icon when calling WTLinkBook., must be bigger than or equal to 1.'); @@ -421,6 +523,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTLinkBook., must be bigger than or equal to 1.'); @@ -434,7 +539,7 @@ public function setOrderNumber($order_number) /** * Gets link_book_section_id * - * @return stringNumber|null + * @return \OpenAPI\Client\Model\WTLinkBookLinkBookSectionID|null */ public function getLinkBookSectionId() { @@ -444,12 +549,15 @@ public function getLinkBookSectionId() /** * Sets link_book_section_id * - * @param stringNumber|null $link_book_section_id link_book_section_id + * @param \OpenAPI\Client\Model\WTLinkBookLinkBookSectionID|null $link_book_section_id link_book_section_id * * @return self */ public function setLinkBookSectionId($link_book_section_id) { + if (is_null($link_book_section_id)) { + throw new \InvalidArgumentException('non-nullable link_book_section_id cannot be null'); + } $this->container['link_book_section_id'] = $link_book_section_id; return $this; @@ -458,7 +566,7 @@ public function setLinkBookSectionId($link_book_section_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -468,12 +576,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -498,6 +609,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -522,6 +636,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -546,6 +663,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -570,14 +690,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTLinkBook., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTLinkBook., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTLinkBook., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTLinkBook., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -591,7 +714,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -603,6 +726,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -616,7 +740,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -632,7 +756,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -644,6 +768,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTLinkBookCreateParams.php b/lib/Model/WTLinkBookCreateParams.php index 7b95942..6867947 100644 --- a/lib/Model/WTLinkBookCreateParams.php +++ b/lib/Model/WTLinkBookCreateParams.php @@ -2,7 +2,7 @@ /** * WTLinkBookCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTLinkBookCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class WTLinkBookCreateParams implements ModelInterface, ArrayAccess, \JsonSerial 'url' => 'string', 'icon' => 'string', 'order_number' => 'int', - 'link_book_section_id' => 'stringNumber' + 'link_book_section_id' => '\OpenAPI\Client\Model\WTLinkBookLinkBookSectionID' ]; /** @@ -82,6 +80,26 @@ class WTLinkBookCreateParams implements ModelInterface, ArrayAccess, \JsonSerial 'link_book_section_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'url' => false, + 'icon' => false, + 'order_number' => false, + 'link_book_section_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['icon'] = $data['icon'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['link_book_section_id'] = $data['link_book_section_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('link_book_section_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -277,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTLinkBookCreateParams., must be bigger than or equal to 1.'); @@ -306,6 +397,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } if ((mb_strlen($url) < 1)) { throw new \InvalidArgumentException('invalid length for $url when calling WTLinkBookCreateParams., must be bigger than or equal to 1.'); @@ -335,6 +429,9 @@ public function getIcon() */ public function setIcon($icon) { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } if ((mb_strlen($icon) < 1)) { throw new \InvalidArgumentException('invalid length for $icon when calling WTLinkBookCreateParams., must be bigger than or equal to 1.'); @@ -364,6 +461,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTLinkBookCreateParams., must be bigger than or equal to 1.'); @@ -377,7 +477,7 @@ public function setOrderNumber($order_number) /** * Gets link_book_section_id * - * @return stringNumber|null + * @return \OpenAPI\Client\Model\WTLinkBookLinkBookSectionID|null */ public function getLinkBookSectionId() { @@ -387,12 +487,15 @@ public function getLinkBookSectionId() /** * Sets link_book_section_id * - * @param stringNumber|null $link_book_section_id link_book_section_id + * @param \OpenAPI\Client\Model\WTLinkBookLinkBookSectionID|null $link_book_section_id link_book_section_id * * @return self */ public function setLinkBookSectionId($link_book_section_id) { + if (is_null($link_book_section_id)) { + throw new \InvalidArgumentException('non-nullable link_book_section_id cannot be null'); + } $this->container['link_book_section_id'] = $link_book_section_id; return $this; @@ -404,7 +507,7 @@ public function setLinkBookSectionId($link_book_section_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -416,6 +519,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -429,7 +533,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -445,7 +549,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -457,6 +561,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTLinkBookLinkBookSectionID.php b/lib/Model/WTLinkBookLinkBookSectionID.php new file mode 100644 index 0000000..694b6f3 --- /dev/null +++ b/lib/Model/WTLinkBookLinkBookSectionID.php @@ -0,0 +1,382 @@ + + */ +class WTLinkBookLinkBookSectionID implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTLinkBook_linkBookSectionID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTLinkBookSectionCreateParams.php b/lib/Model/WTLinkBookSectionCreateParams.php index 61cb459..eda53ae 100644 --- a/lib/Model/WTLinkBookSectionCreateParams.php +++ b/lib/Model/WTLinkBookSectionCreateParams.php @@ -2,7 +2,7 @@ /** * WTLinkBookSectionCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTLinkBookSectionCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTLinkBookSectionCreateParams implements ModelInterface, ArrayAccess, \Jso 'order_number' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'order_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -245,6 +330,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } if ((mb_strlen($name) < 1)) { throw new \InvalidArgumentException('invalid length for $name when calling WTLinkBookSectionCreateParams., must be bigger than or equal to 1.'); @@ -274,6 +362,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTLinkBookSectionCreateParams., must be bigger than or equal to 1.'); @@ -290,7 +381,7 @@ public function setOrderNumber($order_number) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -302,6 +393,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -315,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -331,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -343,6 +435,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTLinkBookSectionUpdateParams.php b/lib/Model/WTLinkBookSectionUpdateParams.php index 8c40c61..68e14fb 100644 --- a/lib/Model/WTLinkBookSectionUpdateParams.php +++ b/lib/Model/WTLinkBookSectionUpdateParams.php @@ -2,7 +2,7 @@ /** * WTLinkBookSectionUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTLinkBookSectionUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTLinkBookSectionUpdateParams implements ModelInterface, ArrayAccess, \Jso 'order_number' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'order_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -245,6 +330,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } if ((mb_strlen($name) < 1)) { throw new \InvalidArgumentException('invalid length for $name when calling WTLinkBookSectionUpdateParams., must be bigger than or equal to 1.'); @@ -274,6 +362,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTLinkBookSectionUpdateParams., must be bigger than or equal to 1.'); @@ -290,7 +381,7 @@ public function setOrderNumber($order_number) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -302,6 +393,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -315,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -331,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -343,6 +435,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTLinkBookUpdateParams.php b/lib/Model/WTLinkBookUpdateParams.php index 1afbb45..0c1cd60 100644 --- a/lib/Model/WTLinkBookUpdateParams.php +++ b/lib/Model/WTLinkBookUpdateParams.php @@ -2,7 +2,7 @@ /** * WTLinkBookUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTLinkBookUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class WTLinkBookUpdateParams implements ModelInterface, ArrayAccess, \JsonSerial 'url' => 'string', 'icon' => 'string', 'order_number' => 'int', - 'link_book_section_id' => 'stringNumber' + 'link_book_section_id' => '\OpenAPI\Client\Model\WTLinkBookLinkBookSectionID' ]; /** @@ -82,6 +80,26 @@ class WTLinkBookUpdateParams implements ModelInterface, ArrayAccess, \JsonSerial 'link_book_section_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'url' => false, + 'icon' => false, + 'order_number' => false, + 'link_book_section_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['icon'] = $data['icon'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['link_book_section_id'] = $data['link_book_section_id'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('link_book_section_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -277,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTLinkBookUpdateParams., must be bigger than or equal to 1.'); @@ -306,6 +397,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } if ((mb_strlen($url) < 1)) { throw new \InvalidArgumentException('invalid length for $url when calling WTLinkBookUpdateParams., must be bigger than or equal to 1.'); @@ -335,6 +429,9 @@ public function getIcon() */ public function setIcon($icon) { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } if ((mb_strlen($icon) < 1)) { throw new \InvalidArgumentException('invalid length for $icon when calling WTLinkBookUpdateParams., must be bigger than or equal to 1.'); @@ -364,6 +461,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTLinkBookUpdateParams., must be bigger than or equal to 1.'); @@ -377,7 +477,7 @@ public function setOrderNumber($order_number) /** * Gets link_book_section_id * - * @return stringNumber|null + * @return \OpenAPI\Client\Model\WTLinkBookLinkBookSectionID|null */ public function getLinkBookSectionId() { @@ -387,12 +487,15 @@ public function getLinkBookSectionId() /** * Sets link_book_section_id * - * @param stringNumber|null $link_book_section_id link_book_section_id + * @param \OpenAPI\Client\Model\WTLinkBookLinkBookSectionID|null $link_book_section_id link_book_section_id * * @return self */ public function setLinkBookSectionId($link_book_section_id) { + if (is_null($link_book_section_id)) { + throw new \InvalidArgumentException('non-nullable link_book_section_id cannot be null'); + } $this->container['link_book_section_id'] = $link_book_section_id; return $this; @@ -404,7 +507,7 @@ public function setLinkBookSectionId($link_book_section_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -416,6 +519,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -429,7 +533,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -445,7 +549,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -457,6 +561,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTLocalInstance.php b/lib/Model/WTLocalInstance.php index 7ef4f2a..ee1eb37 100644 --- a/lib/Model/WTLocalInstance.php +++ b/lib/Model/WTLocalInstance.php @@ -2,7 +2,7 @@ /** * WTLocalInstance * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTLocalInstance implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -67,8 +65,8 @@ class WTLocalInstance implements ModelInterface, ArrayAccess, \JsonSerializable 'iso_country' => 'string', 'postal_code' => 'string', 'region' => 'string', - 'longitude' => 'double', - 'latitude' => 'double', + 'longitude' => 'float', + 'latitude' => 'float', 'rate_center' => 'string', 'locality' => 'string', 'lata' => 'string', @@ -99,6 +97,34 @@ class WTLocalInstance implements ModelInterface, ArrayAccess, \JsonSerializable 'friendly_name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'capabilities' => false, + 'beta' => false, + 'address_requirements' => false, + 'iso_country' => false, + 'postal_code' => false, + 'region' => false, + 'longitude' => false, + 'latitude' => false, + 'rate_center' => false, + 'locality' => false, + 'lata' => false, + 'phone_number' => false, + 'friendly_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -119,6 +145,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -240,19 +318,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['capabilities'] = $data['capabilities'] ?? null; - $this->container['beta'] = $data['beta'] ?? null; - $this->container['address_requirements'] = $data['address_requirements'] ?? null; - $this->container['iso_country'] = $data['iso_country'] ?? null; - $this->container['postal_code'] = $data['postal_code'] ?? null; - $this->container['region'] = $data['region'] ?? null; - $this->container['longitude'] = $data['longitude'] ?? null; - $this->container['latitude'] = $data['latitude'] ?? null; - $this->container['rate_center'] = $data['rate_center'] ?? null; - $this->container['locality'] = $data['locality'] ?? null; - $this->container['lata'] = $data['lata'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['friendly_name'] = $data['friendly_name'] ?? null; + $this->setIfExists('capabilities', $data ?? [], null); + $this->setIfExists('beta', $data ?? [], null); + $this->setIfExists('address_requirements', $data ?? [], null); + $this->setIfExists('iso_country', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('region', $data ?? [], null); + $this->setIfExists('longitude', $data ?? [], null); + $this->setIfExists('latitude', $data ?? [], null); + $this->setIfExists('rate_center', $data ?? [], null); + $this->setIfExists('locality', $data ?? [], null); + $this->setIfExists('lata', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('friendly_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -337,6 +433,9 @@ public function getCapabilities() */ public function setCapabilities($capabilities) { + if (is_null($capabilities)) { + throw new \InvalidArgumentException('non-nullable capabilities cannot be null'); + } $this->container['capabilities'] = $capabilities; return $this; @@ -361,6 +460,9 @@ public function getBeta() */ public function setBeta($beta) { + if (is_null($beta)) { + throw new \InvalidArgumentException('non-nullable beta cannot be null'); + } $this->container['beta'] = $beta; return $this; @@ -385,6 +487,9 @@ public function getAddressRequirements() */ public function setAddressRequirements($address_requirements) { + if (is_null($address_requirements)) { + throw new \InvalidArgumentException('non-nullable address_requirements cannot be null'); + } $this->container['address_requirements'] = $address_requirements; return $this; @@ -409,6 +514,9 @@ public function getIsoCountry() */ public function setIsoCountry($iso_country) { + if (is_null($iso_country)) { + throw new \InvalidArgumentException('non-nullable iso_country cannot be null'); + } $this->container['iso_country'] = $iso_country; return $this; @@ -433,6 +541,9 @@ public function getPostalCode() */ public function setPostalCode($postal_code) { + if (is_null($postal_code)) { + throw new \InvalidArgumentException('non-nullable postal_code cannot be null'); + } $this->container['postal_code'] = $postal_code; return $this; @@ -457,6 +568,9 @@ public function getRegion() */ public function setRegion($region) { + if (is_null($region)) { + throw new \InvalidArgumentException('non-nullable region cannot be null'); + } $this->container['region'] = $region; return $this; @@ -465,7 +579,7 @@ public function setRegion($region) /** * Gets longitude * - * @return double + * @return float */ public function getLongitude() { @@ -475,12 +589,15 @@ public function getLongitude() /** * Sets longitude * - * @param double $longitude longitude + * @param float $longitude longitude * * @return self */ public function setLongitude($longitude) { + if (is_null($longitude)) { + throw new \InvalidArgumentException('non-nullable longitude cannot be null'); + } $this->container['longitude'] = $longitude; return $this; @@ -489,7 +606,7 @@ public function setLongitude($longitude) /** * Gets latitude * - * @return double + * @return float */ public function getLatitude() { @@ -499,12 +616,15 @@ public function getLatitude() /** * Sets latitude * - * @param double $latitude latitude + * @param float $latitude latitude * * @return self */ public function setLatitude($latitude) { + if (is_null($latitude)) { + throw new \InvalidArgumentException('non-nullable latitude cannot be null'); + } $this->container['latitude'] = $latitude; return $this; @@ -529,6 +649,9 @@ public function getRateCenter() */ public function setRateCenter($rate_center) { + if (is_null($rate_center)) { + throw new \InvalidArgumentException('non-nullable rate_center cannot be null'); + } $this->container['rate_center'] = $rate_center; return $this; @@ -553,6 +676,9 @@ public function getLocality() */ public function setLocality($locality) { + if (is_null($locality)) { + throw new \InvalidArgumentException('non-nullable locality cannot be null'); + } $this->container['locality'] = $locality; return $this; @@ -577,6 +703,9 @@ public function getLata() */ public function setLata($lata) { + if (is_null($lata)) { + throw new \InvalidArgumentException('non-nullable lata cannot be null'); + } $this->container['lata'] = $lata; return $this; @@ -601,6 +730,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -625,6 +757,9 @@ public function getFriendlyName() */ public function setFriendlyName($friendly_name) { + if (is_null($friendly_name)) { + throw new \InvalidArgumentException('non-nullable friendly_name cannot be null'); + } $this->container['friendly_name'] = $friendly_name; return $this; @@ -636,7 +771,7 @@ public function setFriendlyName($friendly_name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -648,6 +783,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -661,7 +797,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -677,7 +813,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -689,6 +825,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTLoungeCreateParams.php b/lib/Model/WTLoungeCreateParams.php index d66d8dc..78333ae 100644 --- a/lib/Model/WTLoungeCreateParams.php +++ b/lib/Model/WTLoungeCreateParams.php @@ -2,7 +2,7 @@ /** * WTLoungeCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTLoungeCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTLoungeCreateParams implements ModelInterface, ArrayAccess, \JsonSerializ 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTLoungeCreateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTLoungeCreateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTLoungeCreateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTLoungeUpdateParams.php b/lib/Model/WTLoungeUpdateParams.php index ffc29be..0ef3e17 100644 --- a/lib/Model/WTLoungeUpdateParams.php +++ b/lib/Model/WTLoungeUpdateParams.php @@ -2,7 +2,7 @@ /** * WTLoungeUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTLoungeUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTLoungeUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializ 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTLoungeUpdateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTLoungeUpdateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTLoungeUpdateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMember.php b/lib/Model/WTMember.php index f3a79b9..2e207ec 100644 --- a/lib/Model/WTMember.php +++ b/lib/Model/WTMember.php @@ -2,7 +2,7 @@ /** * WTMember * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMember implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,6 +67,8 @@ class WTMember implements ModelInterface, ArrayAccess, \JsonSerializable 'last_name' => 'string', 'membership_tier_id' => 'string', 'mobile_number' => 'string', + 'email' => 'string', + 'birthday' => 'string', 'points_accrued' => 'int', 'member_id' => 'string', 'membership_tier_redeemable_id' => 'string' @@ -91,11 +91,42 @@ class WTMember implements ModelInterface, ArrayAccess, \JsonSerializable 'last_name' => null, 'membership_tier_id' => null, 'mobile_number' => null, + 'email' => null, + 'birthday' => null, 'points_accrued' => 'int32', 'member_id' => null, 'membership_tier_redeemable_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'first_name' => false, + 'last_name' => false, + 'membership_tier_id' => false, + 'mobile_number' => false, + 'email' => false, + 'birthday' => false, + 'points_accrued' => false, + 'member_id' => false, + 'membership_tier_redeemable_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -116,6 +147,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -132,6 +215,8 @@ public static function openAPIFormats() 'last_name' => 'lastName', 'membership_tier_id' => 'membershipTierID', 'mobile_number' => 'mobileNumber', + 'email' => 'email', + 'birthday' => 'birthday', 'points_accrued' => 'pointsAccrued', 'member_id' => 'memberID', 'membership_tier_redeemable_id' => 'membershipTierRedeemableID' @@ -152,6 +237,8 @@ public static function openAPIFormats() 'last_name' => 'setLastName', 'membership_tier_id' => 'setMembershipTierId', 'mobile_number' => 'setMobileNumber', + 'email' => 'setEmail', + 'birthday' => 'setBirthday', 'points_accrued' => 'setPointsAccrued', 'member_id' => 'setMemberId', 'membership_tier_redeemable_id' => 'setMembershipTierRedeemableId' @@ -172,6 +259,8 @@ public static function openAPIFormats() 'last_name' => 'getLastName', 'membership_tier_id' => 'getMembershipTierId', 'mobile_number' => 'getMobileNumber', + 'email' => 'getEmail', + 'birthday' => 'getBirthday', 'points_accrued' => 'getPointsAccrued', 'member_id' => 'getMemberId', 'membership_tier_redeemable_id' => 'getMembershipTierRedeemableId' @@ -234,18 +323,38 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['membership_tier_id'] = $data['membership_tier_id'] ?? null; - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['points_accrued'] = $data['points_accrued'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['membership_tier_redeemable_id'] = $data['membership_tier_redeemable_id'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('membership_tier_id', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('birthday', $data ?? [], null); + $this->setIfExists('points_accrued', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('membership_tier_redeemable_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -314,6 +423,12 @@ public function listInvalidProperties() if ($this->container['mobile_number'] === null) { $invalidProperties[] = "'mobile_number' can't be null"; } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['birthday'] === null) { + $invalidProperties[] = "'birthday' can't be null"; + } if ($this->container['points_accrued'] === null) { $invalidProperties[] = "'points_accrued' can't be null"; } @@ -381,14 +496,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 12)) { throw new \InvalidArgumentException('invalid length for $id when calling WTMember., must be smaller than or equal to 12.'); } if ((mb_strlen($id) < 12)) { throw new \InvalidArgumentException('invalid length for $id when calling WTMember., must be bigger than or equal to 12.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling WTMember., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling WTMember., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -415,14 +533,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTMember., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTMember., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTMember., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTMember., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -449,6 +570,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -473,6 +597,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -497,6 +624,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -521,6 +651,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } $this->container['first_name'] = $first_name; return $this; @@ -545,6 +678,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } $this->container['last_name'] = $last_name; return $this; @@ -569,14 +705,17 @@ public function getMembershipTierId() */ public function setMembershipTierId($membership_tier_id) { + if (is_null($membership_tier_id)) { + throw new \InvalidArgumentException('non-nullable membership_tier_id cannot be null'); + } if ((mb_strlen($membership_tier_id) > 12)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling WTMember., must be smaller than or equal to 12.'); } if ((mb_strlen($membership_tier_id) < 12)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling WTMember., must be bigger than or equal to 12.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $membership_tier_id))) { - throw new \InvalidArgumentException("invalid value for $membership_tier_id when calling WTMember., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($membership_tier_id)))) { + throw new \InvalidArgumentException("invalid value for \$membership_tier_id when calling WTMember., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['membership_tier_id'] = $membership_tier_id; @@ -603,11 +742,68 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } $this->container['mobile_number'] = $mobile_number; return $this; } + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets birthday + * + * @return string + */ + public function getBirthday() + { + return $this->container['birthday']; + } + + /** + * Sets birthday + * + * @param string $birthday Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured + * + * @return self + */ + public function setBirthday($birthday) + { + if (is_null($birthday)) { + throw new \InvalidArgumentException('non-nullable birthday cannot be null'); + } + $this->container['birthday'] = $birthday; + + return $this; + } + /** * Gets points_accrued * @@ -627,6 +823,9 @@ public function getPointsAccrued() */ public function setPointsAccrued($points_accrued) { + if (is_null($points_accrued)) { + throw new \InvalidArgumentException('non-nullable points_accrued cannot be null'); + } if (($points_accrued < 0)) { throw new \InvalidArgumentException('invalid value for $points_accrued when calling WTMember., must be bigger than or equal to 0.'); @@ -656,12 +855,15 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } if ((mb_strlen($member_id) < 1)) { throw new \InvalidArgumentException('invalid length for $member_id when calling WTMember., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling WTMember., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling WTMember., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['member_id'] = $member_id; @@ -688,14 +890,17 @@ public function getMembershipTierRedeemableId() */ public function setMembershipTierRedeemableId($membership_tier_redeemable_id) { + if (is_null($membership_tier_redeemable_id)) { + throw new \InvalidArgumentException('non-nullable membership_tier_redeemable_id cannot be null'); + } if ((mb_strlen($membership_tier_redeemable_id) > 12)) { throw new \InvalidArgumentException('invalid length for $membership_tier_redeemable_id when calling WTMember., must be smaller than or equal to 12.'); } if ((mb_strlen($membership_tier_redeemable_id) < 12)) { throw new \InvalidArgumentException('invalid length for $membership_tier_redeemable_id when calling WTMember., must be bigger than or equal to 12.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $membership_tier_redeemable_id))) { - throw new \InvalidArgumentException("invalid value for $membership_tier_redeemable_id when calling WTMember., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($membership_tier_redeemable_id)))) { + throw new \InvalidArgumentException("invalid value for \$membership_tier_redeemable_id when calling WTMember., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['membership_tier_redeemable_id'] = $membership_tier_redeemable_id; @@ -709,7 +914,7 @@ public function setMembershipTierRedeemableId($membership_tier_redeemable_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -721,6 +926,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -734,7 +940,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -750,7 +956,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -762,6 +968,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMemberCreationParams.php b/lib/Model/WTMemberCreationParams.php index cbf8d8c..49233ba 100644 --- a/lib/Model/WTMemberCreationParams.php +++ b/lib/Model/WTMemberCreationParams.php @@ -2,7 +2,7 @@ /** * WTMemberCreationParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMemberCreationParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,6 +62,8 @@ class WTMemberCreationParams implements ModelInterface, ArrayAccess, \JsonSerial 'last_name' => 'string', 'membership_tier_id' => 'string', 'mobile_number' => 'string', + 'email' => 'string', + 'birthday' => 'string', 'points_accrued' => 'int', 'member_id' => 'string' ]; @@ -80,10 +80,35 @@ class WTMemberCreationParams implements ModelInterface, ArrayAccess, \JsonSerial 'last_name' => null, 'membership_tier_id' => null, 'mobile_number' => null, + 'email' => null, + 'birthday' => null, 'points_accrued' => 'int32', 'member_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'membership_tier_id' => false, + 'mobile_number' => false, + 'email' => false, + 'birthday' => false, + 'points_accrued' => false, + 'member_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -115,6 +192,8 @@ public static function openAPIFormats() 'last_name' => 'lastName', 'membership_tier_id' => 'membershipTierID', 'mobile_number' => 'mobileNumber', + 'email' => 'email', + 'birthday' => 'birthday', 'points_accrued' => 'pointsAccrued', 'member_id' => 'memberID' ]; @@ -129,6 +208,8 @@ public static function openAPIFormats() 'last_name' => 'setLastName', 'membership_tier_id' => 'setMembershipTierId', 'mobile_number' => 'setMobileNumber', + 'email' => 'setEmail', + 'birthday' => 'setBirthday', 'points_accrued' => 'setPointsAccrued', 'member_id' => 'setMemberId' ]; @@ -143,6 +224,8 @@ public static function openAPIFormats() 'last_name' => 'getLastName', 'membership_tier_id' => 'getMembershipTierId', 'mobile_number' => 'getMobileNumber', + 'email' => 'getEmail', + 'birthday' => 'getBirthday', 'points_accrued' => 'getPointsAccrued', 'member_id' => 'getMemberId' ]; @@ -204,12 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['membership_tier_id'] = $data['membership_tier_id'] ?? null; - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['points_accrued'] = $data['points_accrued'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('membership_tier_id', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('birthday', $data ?? [], null); + $this->setIfExists('points_accrued', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -239,6 +342,12 @@ public function listInvalidProperties() if ($this->container['mobile_number'] === null) { $invalidProperties[] = "'mobile_number' can't be null"; } + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } + if ($this->container['birthday'] === null) { + $invalidProperties[] = "'birthday' can't be null"; + } if ($this->container['points_accrued'] === null) { $invalidProperties[] = "'points_accrued' can't be null"; } @@ -291,6 +400,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } $this->container['first_name'] = $first_name; return $this; @@ -315,6 +427,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } $this->container['last_name'] = $last_name; return $this; @@ -339,14 +454,17 @@ public function getMembershipTierId() */ public function setMembershipTierId($membership_tier_id) { + if (is_null($membership_tier_id)) { + throw new \InvalidArgumentException('non-nullable membership_tier_id cannot be null'); + } if ((mb_strlen($membership_tier_id) > 12)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling WTMemberCreationParams., must be smaller than or equal to 12.'); } if ((mb_strlen($membership_tier_id) < 12)) { throw new \InvalidArgumentException('invalid length for $membership_tier_id when calling WTMemberCreationParams., must be bigger than or equal to 12.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $membership_tier_id))) { - throw new \InvalidArgumentException("invalid value for $membership_tier_id when calling WTMemberCreationParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($membership_tier_id)))) { + throw new \InvalidArgumentException("invalid value for \$membership_tier_id when calling WTMemberCreationParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['membership_tier_id'] = $membership_tier_id; @@ -373,11 +491,68 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } $this->container['mobile_number'] = $mobile_number; return $this; } + /** + * Gets email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets birthday + * + * @return string + */ + public function getBirthday() + { + return $this->container['birthday']; + } + + /** + * Sets birthday + * + * @param string $birthday Represents the date of birth of the member. Defaults to 0000-00-00, which represents that the date of birth has not been configured + * + * @return self + */ + public function setBirthday($birthday) + { + if (is_null($birthday)) { + throw new \InvalidArgumentException('non-nullable birthday cannot be null'); + } + $this->container['birthday'] = $birthday; + + return $this; + } + /** * Gets points_accrued * @@ -397,6 +572,9 @@ public function getPointsAccrued() */ public function setPointsAccrued($points_accrued) { + if (is_null($points_accrued)) { + throw new \InvalidArgumentException('non-nullable points_accrued cannot be null'); + } if (($points_accrued < 0)) { throw new \InvalidArgumentException('invalid value for $points_accrued when calling WTMemberCreationParams., must be bigger than or equal to 0.'); @@ -426,12 +604,15 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } if ((mb_strlen($member_id) < 1)) { throw new \InvalidArgumentException('invalid length for $member_id when calling WTMemberCreationParams., must be bigger than or equal to 1.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling WTMemberCreationParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling WTMemberCreationParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['member_id'] = $member_id; @@ -445,7 +626,7 @@ public function setMemberId($member_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -457,6 +638,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -470,7 +652,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -486,7 +668,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -498,6 +680,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMembershipTier.php b/lib/Model/WTMembershipTier.php index d6efbaf..c4af865 100644 --- a/lib/Model/WTMembershipTier.php +++ b/lib/Model/WTMembershipTier.php @@ -2,7 +2,7 @@ /** * WTMembershipTier * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMembershipTier implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -65,7 +63,7 @@ class WTMembershipTier implements ModelInterface, ArrayAccess, \JsonSerializable 'tier_discount' => 'float', 'tier_design_id' => 'string', 'points_design_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTMembershipTierId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -92,6 +90,31 @@ class WTMembershipTier implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tier_number' => false, + 'tier_name' => false, + 'tier_discount' => false, + 'tier_design_id' => false, + 'points_design_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['tier_number'] = $data['tier_number'] ?? null; - $this->container['tier_name'] = $data['tier_name'] ?? null; - $this->container['tier_discount'] = $data['tier_discount'] ?? null; - $this->container['tier_design_id'] = $data['tier_design_id'] ?? null; - $this->container['points_design_id'] = $data['points_design_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('tier_number', $data ?? [], null); + $this->setIfExists('tier_name', $data ?? [], null); + $this->setIfExists('tier_discount', $data ?? [], null); + $this->setIfExists('tier_design_id', $data ?? [], null); + $this->setIfExists('points_design_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -303,14 +396,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -369,6 +454,9 @@ public function getTierNumber() */ public function setTierNumber($tier_number) { + if (is_null($tier_number)) { + throw new \InvalidArgumentException('non-nullable tier_number cannot be null'); + } if ((mb_strlen($tier_number) < 1)) { throw new \InvalidArgumentException('invalid length for $tier_number when calling WTMembershipTier., must be bigger than or equal to 1.'); @@ -398,6 +486,9 @@ public function getTierName() */ public function setTierName($tier_name) { + if (is_null($tier_name)) { + throw new \InvalidArgumentException('non-nullable tier_name cannot be null'); + } if ((mb_strlen($tier_name) < 1)) { throw new \InvalidArgumentException('invalid length for $tier_name when calling WTMembershipTier., must be bigger than or equal to 1.'); @@ -427,6 +518,9 @@ public function getTierDiscount() */ public function setTierDiscount($tier_discount) { + if (is_null($tier_discount)) { + throw new \InvalidArgumentException('non-nullable tier_discount cannot be null'); + } if (($tier_discount > 100)) { throw new \InvalidArgumentException('invalid value for $tier_discount when calling WTMembershipTier., must be smaller than or equal to 100.'); @@ -459,14 +553,17 @@ public function getTierDesignId() */ public function setTierDesignId($tier_design_id) { + if (is_null($tier_design_id)) { + throw new \InvalidArgumentException('non-nullable tier_design_id cannot be null'); + } if ((mb_strlen($tier_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $tier_design_id when calling WTMembershipTier., must be smaller than or equal to 10.'); } if ((mb_strlen($tier_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $tier_design_id when calling WTMembershipTier., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $tier_design_id))) { - throw new \InvalidArgumentException("invalid value for $tier_design_id when calling WTMembershipTier., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($tier_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$tier_design_id when calling WTMembershipTier., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['tier_design_id'] = $tier_design_id; @@ -493,14 +590,17 @@ public function getPointsDesignId() */ public function setPointsDesignId($points_design_id) { + if (is_null($points_design_id)) { + throw new \InvalidArgumentException('non-nullable points_design_id cannot be null'); + } if ((mb_strlen($points_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $points_design_id when calling WTMembershipTier., must be smaller than or equal to 10.'); } if ((mb_strlen($points_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $points_design_id when calling WTMembershipTier., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $points_design_id))) { - throw new \InvalidArgumentException("invalid value for $points_design_id when calling WTMembershipTier., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($points_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$points_design_id when calling WTMembershipTier., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['points_design_id'] = $points_design_id; @@ -511,7 +611,7 @@ public function setPointsDesignId($points_design_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTMembershipTierId */ public function getId() { @@ -521,19 +621,15 @@ public function getId() /** * Sets id * - * @param string $id The id of the membership tier - autopopulated by the service + * @param \OpenAPI\Client\Model\WTMembershipTierId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTMembershipTier., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTMembershipTier., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -558,14 +654,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTMembershipTier., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTMembershipTier., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTMembershipTier., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTMembershipTier., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -592,6 +691,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -616,6 +718,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -640,6 +745,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -651,7 +759,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -663,6 +771,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -676,7 +785,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -692,7 +801,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -704,6 +813,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMembershipTierCreationParams.php b/lib/Model/WTMembershipTierCreationParams.php index 9fe0bff..632498d 100644 --- a/lib/Model/WTMembershipTierCreationParams.php +++ b/lib/Model/WTMembershipTierCreationParams.php @@ -2,7 +2,7 @@ /** * WTMembershipTierCreationParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMembershipTierCreationParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -82,6 +80,26 @@ class WTMembershipTierCreationParams implements ModelInterface, ArrayAccess, \Js 'points_design_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tier_number' => false, + 'tier_name' => false, + 'tier_discount' => false, + 'tier_design_id' => false, + 'points_design_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['tier_number'] = $data['tier_number'] ?? null; - $this->container['tier_name'] = $data['tier_name'] ?? null; - $this->container['tier_discount'] = $data['tier_discount'] ?? null; - $this->container['tier_design_id'] = $data['tier_design_id'] ?? null; - $this->container['points_design_id'] = $data['points_design_id'] ?? null; + $this->setIfExists('tier_number', $data ?? [], null); + $this->setIfExists('tier_name', $data ?? [], null); + $this->setIfExists('tier_discount', $data ?? [], null); + $this->setIfExists('tier_design_id', $data ?? [], null); + $this->setIfExists('points_design_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -304,6 +392,9 @@ public function getTierNumber() */ public function setTierNumber($tier_number) { + if (is_null($tier_number)) { + throw new \InvalidArgumentException('non-nullable tier_number cannot be null'); + } if ((mb_strlen($tier_number) < 1)) { throw new \InvalidArgumentException('invalid length for $tier_number when calling WTMembershipTierCreationParams., must be bigger than or equal to 1.'); @@ -333,6 +424,9 @@ public function getTierName() */ public function setTierName($tier_name) { + if (is_null($tier_name)) { + throw new \InvalidArgumentException('non-nullable tier_name cannot be null'); + } if ((mb_strlen($tier_name) < 1)) { throw new \InvalidArgumentException('invalid length for $tier_name when calling WTMembershipTierCreationParams., must be bigger than or equal to 1.'); @@ -362,6 +456,9 @@ public function getTierDiscount() */ public function setTierDiscount($tier_discount) { + if (is_null($tier_discount)) { + throw new \InvalidArgumentException('non-nullable tier_discount cannot be null'); + } if (($tier_discount > 100)) { throw new \InvalidArgumentException('invalid value for $tier_discount when calling WTMembershipTierCreationParams., must be smaller than or equal to 100.'); @@ -394,14 +491,17 @@ public function getTierDesignId() */ public function setTierDesignId($tier_design_id) { + if (is_null($tier_design_id)) { + throw new \InvalidArgumentException('non-nullable tier_design_id cannot be null'); + } if ((mb_strlen($tier_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $tier_design_id when calling WTMembershipTierCreationParams., must be smaller than or equal to 10.'); } if ((mb_strlen($tier_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $tier_design_id when calling WTMembershipTierCreationParams., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $tier_design_id))) { - throw new \InvalidArgumentException("invalid value for $tier_design_id when calling WTMembershipTierCreationParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($tier_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$tier_design_id when calling WTMembershipTierCreationParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['tier_design_id'] = $tier_design_id; @@ -428,14 +528,17 @@ public function getPointsDesignId() */ public function setPointsDesignId($points_design_id) { + if (is_null($points_design_id)) { + throw new \InvalidArgumentException('non-nullable points_design_id cannot be null'); + } if ((mb_strlen($points_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $points_design_id when calling WTMembershipTierCreationParams., must be smaller than or equal to 10.'); } if ((mb_strlen($points_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $points_design_id when calling WTMembershipTierCreationParams., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $points_design_id))) { - throw new \InvalidArgumentException("invalid value for $points_design_id when calling WTMembershipTierCreationParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($points_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$points_design_id when calling WTMembershipTierCreationParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['points_design_id'] = $points_design_id; @@ -449,7 +552,7 @@ public function setPointsDesignId($points_design_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -461,6 +564,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -474,7 +578,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -490,7 +594,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -502,6 +606,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMembershipTierId.php b/lib/Model/WTMembershipTierId.php new file mode 100644 index 0000000..59eabab --- /dev/null +++ b/lib/Model/WTMembershipTierId.php @@ -0,0 +1,383 @@ + + */ +class WTMembershipTierId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTMembershipTier_id'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTMembershipTierUpdateParams.php b/lib/Model/WTMembershipTierUpdateParams.php index 24aae6f..b0d15f2 100644 --- a/lib/Model/WTMembershipTierUpdateParams.php +++ b/lib/Model/WTMembershipTierUpdateParams.php @@ -2,7 +2,7 @@ /** * WTMembershipTierUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMembershipTierUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -82,6 +80,26 @@ class WTMembershipTierUpdateParams implements ModelInterface, ArrayAccess, \Json 'points_design_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tier_number' => false, + 'tier_name' => false, + 'tier_discount' => false, + 'tier_design_id' => false, + 'points_design_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['tier_number'] = $data['tier_number'] ?? null; - $this->container['tier_name'] = $data['tier_name'] ?? null; - $this->container['tier_discount'] = $data['tier_discount'] ?? null; - $this->container['tier_design_id'] = $data['tier_design_id'] ?? null; - $this->container['points_design_id'] = $data['points_design_id'] ?? null; + $this->setIfExists('tier_number', $data ?? [], null); + $this->setIfExists('tier_name', $data ?? [], null); + $this->setIfExists('tier_discount', $data ?? [], null); + $this->setIfExists('tier_design_id', $data ?? [], null); + $this->setIfExists('points_design_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -304,6 +392,9 @@ public function getTierNumber() */ public function setTierNumber($tier_number) { + if (is_null($tier_number)) { + throw new \InvalidArgumentException('non-nullable tier_number cannot be null'); + } if ((mb_strlen($tier_number) < 1)) { throw new \InvalidArgumentException('invalid length for $tier_number when calling WTMembershipTierUpdateParams., must be bigger than or equal to 1.'); @@ -333,6 +424,9 @@ public function getTierName() */ public function setTierName($tier_name) { + if (is_null($tier_name)) { + throw new \InvalidArgumentException('non-nullable tier_name cannot be null'); + } if ((mb_strlen($tier_name) < 1)) { throw new \InvalidArgumentException('invalid length for $tier_name when calling WTMembershipTierUpdateParams., must be bigger than or equal to 1.'); @@ -362,6 +456,9 @@ public function getTierDiscount() */ public function setTierDiscount($tier_discount) { + if (is_null($tier_discount)) { + throw new \InvalidArgumentException('non-nullable tier_discount cannot be null'); + } if (($tier_discount > 100)) { throw new \InvalidArgumentException('invalid value for $tier_discount when calling WTMembershipTierUpdateParams., must be smaller than or equal to 100.'); @@ -394,14 +491,17 @@ public function getTierDesignId() */ public function setTierDesignId($tier_design_id) { + if (is_null($tier_design_id)) { + throw new \InvalidArgumentException('non-nullable tier_design_id cannot be null'); + } if ((mb_strlen($tier_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $tier_design_id when calling WTMembershipTierUpdateParams., must be smaller than or equal to 10.'); } if ((mb_strlen($tier_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $tier_design_id when calling WTMembershipTierUpdateParams., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $tier_design_id))) { - throw new \InvalidArgumentException("invalid value for $tier_design_id when calling WTMembershipTierUpdateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($tier_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$tier_design_id when calling WTMembershipTierUpdateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['tier_design_id'] = $tier_design_id; @@ -428,14 +528,17 @@ public function getPointsDesignId() */ public function setPointsDesignId($points_design_id) { + if (is_null($points_design_id)) { + throw new \InvalidArgumentException('non-nullable points_design_id cannot be null'); + } if ((mb_strlen($points_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $points_design_id when calling WTMembershipTierUpdateParams., must be smaller than or equal to 10.'); } if ((mb_strlen($points_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $points_design_id when calling WTMembershipTierUpdateParams., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $points_design_id))) { - throw new \InvalidArgumentException("invalid value for $points_design_id when calling WTMembershipTierUpdateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($points_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$points_design_id when calling WTMembershipTierUpdateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['points_design_id'] = $points_design_id; @@ -449,7 +552,7 @@ public function setPointsDesignId($points_design_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -461,6 +564,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -474,7 +578,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -490,7 +594,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -502,6 +606,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMembershipTierWithMemberCount.php b/lib/Model/WTMembershipTierWithMemberCount.php index aaab6fe..4ced2d6 100644 --- a/lib/Model/WTMembershipTierWithMemberCount.php +++ b/lib/Model/WTMembershipTierWithMemberCount.php @@ -2,7 +2,7 @@ /** * WTMembershipTierWithMemberCount * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMembershipTierWithMemberCount implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -65,7 +63,7 @@ class WTMembershipTierWithMemberCount implements ModelInterface, ArrayAccess, \J 'tier_discount' => 'float', 'tier_design_id' => 'string', 'points_design_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTMembershipTierId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -94,6 +92,32 @@ class WTMembershipTierWithMemberCount implements ModelInterface, ArrayAccess, \J 'member_count' => 'int32' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'tier_number' => false, + 'tier_name' => false, + 'tier_discount' => false, + 'tier_design_id' => false, + 'points_design_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'member_count' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -114,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -229,17 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['tier_number'] = $data['tier_number'] ?? null; - $this->container['tier_name'] = $data['tier_name'] ?? null; - $this->container['tier_discount'] = $data['tier_discount'] ?? null; - $this->container['tier_design_id'] = $data['tier_design_id'] ?? null; - $this->container['points_design_id'] = $data['points_design_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['member_count'] = $data['member_count'] ?? null; + $this->setIfExists('tier_number', $data ?? [], null); + $this->setIfExists('tier_name', $data ?? [], null); + $this->setIfExists('tier_discount', $data ?? [], null); + $this->setIfExists('tier_design_id', $data ?? [], null); + $this->setIfExists('points_design_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('member_count', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -309,14 +403,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -378,6 +464,9 @@ public function getTierNumber() */ public function setTierNumber($tier_number) { + if (is_null($tier_number)) { + throw new \InvalidArgumentException('non-nullable tier_number cannot be null'); + } if ((mb_strlen($tier_number) < 1)) { throw new \InvalidArgumentException('invalid length for $tier_number when calling WTMembershipTierWithMemberCount., must be bigger than or equal to 1.'); @@ -407,6 +496,9 @@ public function getTierName() */ public function setTierName($tier_name) { + if (is_null($tier_name)) { + throw new \InvalidArgumentException('non-nullable tier_name cannot be null'); + } if ((mb_strlen($tier_name) < 1)) { throw new \InvalidArgumentException('invalid length for $tier_name when calling WTMembershipTierWithMemberCount., must be bigger than or equal to 1.'); @@ -436,6 +528,9 @@ public function getTierDiscount() */ public function setTierDiscount($tier_discount) { + if (is_null($tier_discount)) { + throw new \InvalidArgumentException('non-nullable tier_discount cannot be null'); + } if (($tier_discount > 100)) { throw new \InvalidArgumentException('invalid value for $tier_discount when calling WTMembershipTierWithMemberCount., must be smaller than or equal to 100.'); @@ -468,14 +563,17 @@ public function getTierDesignId() */ public function setTierDesignId($tier_design_id) { + if (is_null($tier_design_id)) { + throw new \InvalidArgumentException('non-nullable tier_design_id cannot be null'); + } if ((mb_strlen($tier_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $tier_design_id when calling WTMembershipTierWithMemberCount., must be smaller than or equal to 10.'); } if ((mb_strlen($tier_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $tier_design_id when calling WTMembershipTierWithMemberCount., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $tier_design_id))) { - throw new \InvalidArgumentException("invalid value for $tier_design_id when calling WTMembershipTierWithMemberCount., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($tier_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$tier_design_id when calling WTMembershipTierWithMemberCount., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['tier_design_id'] = $tier_design_id; @@ -502,14 +600,17 @@ public function getPointsDesignId() */ public function setPointsDesignId($points_design_id) { + if (is_null($points_design_id)) { + throw new \InvalidArgumentException('non-nullable points_design_id cannot be null'); + } if ((mb_strlen($points_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $points_design_id when calling WTMembershipTierWithMemberCount., must be smaller than or equal to 10.'); } if ((mb_strlen($points_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $points_design_id when calling WTMembershipTierWithMemberCount., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $points_design_id))) { - throw new \InvalidArgumentException("invalid value for $points_design_id when calling WTMembershipTierWithMemberCount., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($points_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$points_design_id when calling WTMembershipTierWithMemberCount., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['points_design_id'] = $points_design_id; @@ -520,7 +621,7 @@ public function setPointsDesignId($points_design_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTMembershipTierId */ public function getId() { @@ -530,19 +631,15 @@ public function getId() /** * Sets id * - * @param string $id The id of the membership tier - autopopulated by the service + * @param \OpenAPI\Client\Model\WTMembershipTierId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTMembershipTierWithMemberCount., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTMembershipTierWithMemberCount., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -567,14 +664,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTMembershipTierWithMemberCount., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTMembershipTierWithMemberCount., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTMembershipTierWithMemberCount., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTMembershipTierWithMemberCount., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -601,6 +701,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -625,6 +728,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -649,6 +755,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -673,6 +782,9 @@ public function getMemberCount() */ public function setMemberCount($member_count) { + if (is_null($member_count)) { + throw new \InvalidArgumentException('non-nullable member_count cannot be null'); + } $this->container['member_count'] = $member_count; return $this; @@ -684,7 +796,7 @@ public function setMemberCount($member_count) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -696,6 +808,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -709,7 +822,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -725,7 +838,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -737,6 +850,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMerchantCredit.php b/lib/Model/WTMerchantCredit.php index 8631cd8..78683d7 100644 --- a/lib/Model/WTMerchantCredit.php +++ b/lib/Model/WTMerchantCredit.php @@ -2,7 +2,7 @@ /** * WTMerchantCredit * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMerchantCredit implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -92,6 +90,31 @@ class WTMerchantCredit implements ModelInterface, ArrayAccess, \JsonSerializable 'credit_amount_string' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'mobile_number' => false, + 'credit_amount' => false, + 'member_id' => false, + 'credit_amount_decimal' => false, + 'credit_amount_string' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['credit_amount'] = $data['credit_amount'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['credit_amount_decimal'] = $data['credit_amount_decimal'] ?? null; - $this->container['credit_amount_string'] = $data['credit_amount_string'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('credit_amount', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('credit_amount_decimal', $data ?? [], null); + $this->setIfExists('credit_amount_string', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -346,14 +439,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 12)) { throw new \InvalidArgumentException('invalid length for $id when calling WTMerchantCredit., must be smaller than or equal to 12.'); } if ((mb_strlen($id) < 12)) { throw new \InvalidArgumentException('invalid length for $id when calling WTMerchantCredit., must be bigger than or equal to 12.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling WTMerchantCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling WTMerchantCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -380,14 +476,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTMerchantCredit., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTMerchantCredit., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTMerchantCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTMerchantCredit., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -414,6 +513,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -438,6 +540,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -462,6 +567,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -486,6 +594,9 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } if ((mb_strlen($mobile_number) < 1)) { throw new \InvalidArgumentException('invalid length for $mobile_number when calling WTMerchantCredit., must be bigger than or equal to 1.'); @@ -515,6 +626,9 @@ public function getCreditAmount() */ public function setCreditAmount($credit_amount) { + if (is_null($credit_amount)) { + throw new \InvalidArgumentException('non-nullable credit_amount cannot be null'); + } if (($credit_amount < 0)) { throw new \InvalidArgumentException('invalid value for $credit_amount when calling WTMerchantCredit., must be bigger than or equal to 0.'); @@ -544,12 +658,15 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (mb_strlen($member_id) < 0)) { + if ((mb_strlen($member_id) < 0)) { throw new \InvalidArgumentException('invalid length for $member_id when calling WTMerchantCredit., must be bigger than or equal to 0.'); } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling WTMerchantCredit., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling WTMerchantCredit., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -576,6 +693,9 @@ public function getCreditAmountDecimal() */ public function setCreditAmountDecimal($credit_amount_decimal) { + if (is_null($credit_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable credit_amount_decimal cannot be null'); + } $this->container['credit_amount_decimal'] = $credit_amount_decimal; return $this; @@ -600,6 +720,9 @@ public function getCreditAmountString() */ public function setCreditAmountString($credit_amount_string) { + if (is_null($credit_amount_string)) { + throw new \InvalidArgumentException('non-nullable credit_amount_string cannot be null'); + } $this->container['credit_amount_string'] = $credit_amount_string; return $this; @@ -611,7 +734,7 @@ public function setCreditAmountString($credit_amount_string) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -623,6 +746,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -636,7 +760,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -652,7 +776,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -664,6 +788,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMerchantCreditCreationParams.php b/lib/Model/WTMerchantCreditCreationParams.php index f0eb8af..6428bcf 100644 --- a/lib/Model/WTMerchantCreditCreationParams.php +++ b/lib/Model/WTMerchantCreditCreationParams.php @@ -2,7 +2,7 @@ /** * WTMerchantCreditCreationParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMerchantCreditCreationParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTMerchantCreditCreationParams implements ModelInterface, ArrayAccess, \Js 'member_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'mobile_number' => false, + 'credit_amount' => false, + 'member_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['mobile_number'] = $data['mobile_number'] ?? null; - $this->container['credit_amount'] = $data['credit_amount'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('credit_amount', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -259,6 +345,9 @@ public function getMobileNumber() */ public function setMobileNumber($mobile_number) { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } if ((mb_strlen($mobile_number) < 1)) { throw new \InvalidArgumentException('invalid length for $mobile_number when calling WTMerchantCreditCreationParams., must be bigger than or equal to 1.'); @@ -288,6 +377,9 @@ public function getCreditAmount() */ public function setCreditAmount($credit_amount) { + if (is_null($credit_amount)) { + throw new \InvalidArgumentException('non-nullable credit_amount cannot be null'); + } if (($credit_amount < 0)) { throw new \InvalidArgumentException('invalid value for $credit_amount when calling WTMerchantCreditCreationParams., must be bigger than or equal to 0.'); @@ -317,12 +409,15 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (mb_strlen($member_id) < 0)) { + if ((mb_strlen($member_id) < 0)) { throw new \InvalidArgumentException('invalid length for $member_id when calling WTMerchantCreditCreationParams., must be bigger than or equal to 0.'); } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling WTMerchantCreditCreationParams., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling WTMerchantCreditCreationParams., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -336,7 +431,7 @@ public function setMemberId($member_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -348,6 +443,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -361,7 +457,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -377,7 +473,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -389,6 +485,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMerchantURLCreate.php b/lib/Model/WTMerchantURLCreate.php index b9a0ce4..e508ee7 100644 --- a/lib/Model/WTMerchantURLCreate.php +++ b/lib/Model/WTMerchantURLCreate.php @@ -2,7 +2,7 @@ /** * WTMerchantURLCreate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMerchantURLCreate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTMerchantURLCreate implements ModelInterface, ArrayAccess, \JsonSerializa 'destination_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'nickname' => false, + 'destination_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['nickname'] = $data['nickname'] ?? null; - $this->container['destination_url'] = $data['destination_url'] ?? null; + $this->setIfExists('nickname', $data ?? [], null); + $this->setIfExists('destination_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -245,6 +330,9 @@ public function getNickname() */ public function setNickname($nickname) { + if (is_null($nickname)) { + throw new \InvalidArgumentException('non-nullable nickname cannot be null'); + } if ((mb_strlen($nickname) < 1)) { throw new \InvalidArgumentException('invalid length for $nickname when calling WTMerchantURLCreate., must be bigger than or equal to 1.'); @@ -274,6 +362,9 @@ public function getDestinationUrl() */ public function setDestinationUrl($destination_url) { + if (is_null($destination_url)) { + throw new \InvalidArgumentException('non-nullable destination_url cannot be null'); + } if ((mb_strlen($destination_url) < 1)) { throw new \InvalidArgumentException('invalid length for $destination_url when calling WTMerchantURLCreate., must be bigger than or equal to 1.'); @@ -290,7 +381,7 @@ public function setDestinationUrl($destination_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -302,6 +393,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -315,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -331,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -343,6 +435,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMerchantURLUpdate.php b/lib/Model/WTMerchantURLUpdate.php index 3b654a7..0dfb832 100644 --- a/lib/Model/WTMerchantURLUpdate.php +++ b/lib/Model/WTMerchantURLUpdate.php @@ -2,7 +2,7 @@ /** * WTMerchantURLUpdate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMerchantURLUpdate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTMerchantURLUpdate implements ModelInterface, ArrayAccess, \JsonSerializa 'destination_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'nickname' => false, + 'destination_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['nickname'] = $data['nickname'] ?? null; - $this->container['destination_url'] = $data['destination_url'] ?? null; + $this->setIfExists('nickname', $data ?? [], null); + $this->setIfExists('destination_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -245,6 +330,9 @@ public function getNickname() */ public function setNickname($nickname) { + if (is_null($nickname)) { + throw new \InvalidArgumentException('non-nullable nickname cannot be null'); + } if ((mb_strlen($nickname) < 1)) { throw new \InvalidArgumentException('invalid length for $nickname when calling WTMerchantURLUpdate., must be bigger than or equal to 1.'); @@ -274,6 +362,9 @@ public function getDestinationUrl() */ public function setDestinationUrl($destination_url) { + if (is_null($destination_url)) { + throw new \InvalidArgumentException('non-nullable destination_url cannot be null'); + } if ((mb_strlen($destination_url) < 1)) { throw new \InvalidArgumentException('invalid length for $destination_url when calling WTMerchantURLUpdate., must be bigger than or equal to 1.'); @@ -290,7 +381,7 @@ public function setDestinationUrl($destination_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -302,6 +393,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -315,7 +407,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -331,7 +423,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -343,6 +435,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMerchantUpdate.php b/lib/Model/WTMerchantUpdate.php index 94235fb..6682e49 100644 --- a/lib/Model/WTMerchantUpdate.php +++ b/lib/Model/WTMerchantUpdate.php @@ -2,7 +2,7 @@ /** * WTMerchantUpdate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMerchantUpdate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -90,6 +88,30 @@ class WTMerchantUpdate implements ModelInterface, ArrayAccess, \JsonSerializable 'currency_abbreviation' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'company_name' => false, + 'address1' => false, + 'address2' => false, + 'city' => false, + 'state' => false, + 'country' => false, + 'phone_number' => false, + 'zip' => false, + 'currency_abbreviation' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -110,6 +132,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -219,15 +293,33 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['company_name'] = $data['company_name'] ?? null; - $this->container['address1'] = $data['address1'] ?? null; - $this->container['address2'] = $data['address2'] ?? null; - $this->container['city'] = $data['city'] ?? null; - $this->container['state'] = $data['state'] ?? null; - $this->container['country'] = $data['country'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['zip'] = $data['zip'] ?? null; - $this->container['currency_abbreviation'] = $data['currency_abbreviation'] ?? null; + $this->setIfExists('company_name', $data ?? [], null); + $this->setIfExists('address1', $data ?? [], null); + $this->setIfExists('address2', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('state', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('zip', $data ?? [], null); + $this->setIfExists('currency_abbreviation', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -297,6 +389,9 @@ public function getCompanyName() */ public function setCompanyName($company_name) { + if (is_null($company_name)) { + throw new \InvalidArgumentException('non-nullable company_name cannot be null'); + } $this->container['company_name'] = $company_name; return $this; @@ -321,6 +416,9 @@ public function getAddress1() */ public function setAddress1($address1) { + if (is_null($address1)) { + throw new \InvalidArgumentException('non-nullable address1 cannot be null'); + } $this->container['address1'] = $address1; return $this; @@ -345,6 +443,9 @@ public function getAddress2() */ public function setAddress2($address2) { + if (is_null($address2)) { + throw new \InvalidArgumentException('non-nullable address2 cannot be null'); + } $this->container['address2'] = $address2; return $this; @@ -369,6 +470,9 @@ public function getCity() */ public function setCity($city) { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } $this->container['city'] = $city; return $this; @@ -393,6 +497,9 @@ public function getState() */ public function setState($state) { + if (is_null($state)) { + throw new \InvalidArgumentException('non-nullable state cannot be null'); + } $this->container['state'] = $state; return $this; @@ -417,6 +524,9 @@ public function getCountry() */ public function setCountry($country) { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } $this->container['country'] = $country; return $this; @@ -441,6 +551,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -465,6 +578,9 @@ public function getZip() */ public function setZip($zip) { + if (is_null($zip)) { + throw new \InvalidArgumentException('non-nullable zip cannot be null'); + } $this->container['zip'] = $zip; return $this; @@ -489,6 +605,9 @@ public function getCurrencyAbbreviation() */ public function setCurrencyAbbreviation($currency_abbreviation) { + if (is_null($currency_abbreviation)) { + throw new \InvalidArgumentException('non-nullable currency_abbreviation cannot be null'); + } $this->container['currency_abbreviation'] = $currency_abbreviation; return $this; @@ -500,7 +619,7 @@ public function setCurrencyAbbreviation($currency_abbreviation) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -512,6 +631,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -525,7 +645,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -541,7 +661,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -553,6 +673,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMerchantUpdatePOSIntegration.php b/lib/Model/WTMerchantUpdatePOSIntegration.php index e14aaa9..07fdf94 100644 --- a/lib/Model/WTMerchantUpdatePOSIntegration.php +++ b/lib/Model/WTMerchantUpdatePOSIntegration.php @@ -2,7 +2,7 @@ /** * WTMerchantUpdatePOSIntegration * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMerchantUpdatePOSIntegration implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTMerchantUpdatePOSIntegration implements ModelInterface, ArrayAccess, \Js 'info_genesis_property_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'info_genesis_property_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['info_genesis_property_id'] = $data['info_genesis_property_id'] ?? null; + $this->setIfExists('info_genesis_property_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -228,6 +312,9 @@ public function getInfoGenesisPropertyId() */ public function setInfoGenesisPropertyId($info_genesis_property_id) { + if (is_null($info_genesis_property_id)) { + throw new \InvalidArgumentException('non-nullable info_genesis_property_id cannot be null'); + } $this->container['info_genesis_property_id'] = $info_genesis_property_id; return $this; @@ -239,7 +326,7 @@ public function setInfoGenesisPropertyId($info_genesis_property_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -251,6 +338,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -264,7 +352,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -280,7 +368,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -292,6 +380,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMerchantUpdatePointsOfContact.php b/lib/Model/WTMerchantUpdatePointsOfContact.php index ac1cafd..f1a8a91 100644 --- a/lib/Model/WTMerchantUpdatePointsOfContact.php +++ b/lib/Model/WTMerchantUpdatePointsOfContact.php @@ -2,7 +2,7 @@ /** * WTMerchantUpdatePointsOfContact * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMerchantUpdatePointsOfContact implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -80,6 +78,25 @@ class WTMerchantUpdatePointsOfContact implements ModelInterface, ArrayAccess, \J 'customer_service_employee_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'billing_employee_id' => false, + 'marketing_employee_id' => false, + 'technical_employee_id' => false, + 'customer_service_employee_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +117,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -194,10 +263,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['billing_employee_id'] = $data['billing_employee_id'] ?? null; - $this->container['marketing_employee_id'] = $data['marketing_employee_id'] ?? null; - $this->container['technical_employee_id'] = $data['technical_employee_id'] ?? null; - $this->container['customer_service_employee_id'] = $data['customer_service_employee_id'] ?? null; + $this->setIfExists('billing_employee_id', $data ?? [], null); + $this->setIfExists('marketing_employee_id', $data ?? [], null); + $this->setIfExists('technical_employee_id', $data ?? [], null); + $this->setIfExists('customer_service_employee_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -294,14 +381,17 @@ public function getBillingEmployeeId() */ public function setBillingEmployeeId($billing_employee_id) { + if (is_null($billing_employee_id)) { + throw new \InvalidArgumentException('non-nullable billing_employee_id cannot be null'); + } if ((mb_strlen($billing_employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $billing_employee_id when calling WTMerchantUpdatePointsOfContact., must be smaller than or equal to 10.'); } if ((mb_strlen($billing_employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $billing_employee_id when calling WTMerchantUpdatePointsOfContact., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $billing_employee_id))) { - throw new \InvalidArgumentException("invalid value for $billing_employee_id when calling WTMerchantUpdatePointsOfContact., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($billing_employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$billing_employee_id when calling WTMerchantUpdatePointsOfContact., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['billing_employee_id'] = $billing_employee_id; @@ -328,14 +418,17 @@ public function getMarketingEmployeeId() */ public function setMarketingEmployeeId($marketing_employee_id) { - if (!is_null($marketing_employee_id) && (mb_strlen($marketing_employee_id) > 10)) { + if (is_null($marketing_employee_id)) { + throw new \InvalidArgumentException('non-nullable marketing_employee_id cannot be null'); + } + if ((mb_strlen($marketing_employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $marketing_employee_id when calling WTMerchantUpdatePointsOfContact., must be smaller than or equal to 10.'); } - if (!is_null($marketing_employee_id) && (mb_strlen($marketing_employee_id) < 10)) { + if ((mb_strlen($marketing_employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $marketing_employee_id when calling WTMerchantUpdatePointsOfContact., must be bigger than or equal to 10.'); } - if (!is_null($marketing_employee_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $marketing_employee_id))) { - throw new \InvalidArgumentException("invalid value for $marketing_employee_id when calling WTMerchantUpdatePointsOfContact., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($marketing_employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$marketing_employee_id when calling WTMerchantUpdatePointsOfContact., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['marketing_employee_id'] = $marketing_employee_id; @@ -362,14 +455,17 @@ public function getTechnicalEmployeeId() */ public function setTechnicalEmployeeId($technical_employee_id) { - if (!is_null($technical_employee_id) && (mb_strlen($technical_employee_id) > 10)) { + if (is_null($technical_employee_id)) { + throw new \InvalidArgumentException('non-nullable technical_employee_id cannot be null'); + } + if ((mb_strlen($technical_employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $technical_employee_id when calling WTMerchantUpdatePointsOfContact., must be smaller than or equal to 10.'); } - if (!is_null($technical_employee_id) && (mb_strlen($technical_employee_id) < 10)) { + if ((mb_strlen($technical_employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $technical_employee_id when calling WTMerchantUpdatePointsOfContact., must be bigger than or equal to 10.'); } - if (!is_null($technical_employee_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $technical_employee_id))) { - throw new \InvalidArgumentException("invalid value for $technical_employee_id when calling WTMerchantUpdatePointsOfContact., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($technical_employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$technical_employee_id when calling WTMerchantUpdatePointsOfContact., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['technical_employee_id'] = $technical_employee_id; @@ -396,14 +492,17 @@ public function getCustomerServiceEmployeeId() */ public function setCustomerServiceEmployeeId($customer_service_employee_id) { - if (!is_null($customer_service_employee_id) && (mb_strlen($customer_service_employee_id) > 10)) { + if (is_null($customer_service_employee_id)) { + throw new \InvalidArgumentException('non-nullable customer_service_employee_id cannot be null'); + } + if ((mb_strlen($customer_service_employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $customer_service_employee_id when calling WTMerchantUpdatePointsOfContact., must be smaller than or equal to 10.'); } - if (!is_null($customer_service_employee_id) && (mb_strlen($customer_service_employee_id) < 10)) { + if ((mb_strlen($customer_service_employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $customer_service_employee_id when calling WTMerchantUpdatePointsOfContact., must be bigger than or equal to 10.'); } - if (!is_null($customer_service_employee_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $customer_service_employee_id))) { - throw new \InvalidArgumentException("invalid value for $customer_service_employee_id when calling WTMerchantUpdatePointsOfContact., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($customer_service_employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$customer_service_employee_id when calling WTMerchantUpdatePointsOfContact., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['customer_service_employee_id'] = $customer_service_employee_id; @@ -417,7 +516,7 @@ public function setCustomerServiceEmployeeId($customer_service_employee_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -429,6 +528,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -442,7 +542,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -458,7 +558,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -470,6 +570,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTMessageInstance.php b/lib/Model/WTMessageInstance.php index b648075..c6056b2 100644 --- a/lib/Model/WTMessageInstance.php +++ b/lib/Model/WTMessageInstance.php @@ -2,7 +2,7 @@ /** * WTMessageInstance * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -40,9 +40,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTMessageInstance implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class WTMessageInstance implements ModelInterface, ArrayAccess, \JsonSerializabl 'subresource_uris' => 'object', 'api_version' => 'string', 'price_unit' => 'string', - 'error_code' => 'double', + 'error_code' => 'float', 'date_created' => '\DateTime', 'date_sent' => '\DateTime', 'sid' => 'string', @@ -113,6 +111,41 @@ class WTMessageInstance implements ModelInterface, ArrayAccess, \JsonSerializabl 'body' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'subresource_uris' => false, + 'api_version' => false, + 'price_unit' => false, + 'error_code' => false, + 'date_created' => false, + 'date_sent' => false, + 'sid' => false, + 'messaging_service_sid' => false, + 'status' => false, + 'num_media' => false, + 'account_sid' => false, + 'uri' => false, + 'error_message' => false, + 'price' => false, + 'date_updated' => false, + 'to' => false, + 'from' => false, + 'direction' => false, + 'num_segments' => false, + 'body' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -133,6 +166,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -275,26 +360,44 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['subresource_uris'] = $data['subresource_uris'] ?? null; - $this->container['api_version'] = $data['api_version'] ?? null; - $this->container['price_unit'] = $data['price_unit'] ?? null; - $this->container['error_code'] = $data['error_code'] ?? null; - $this->container['date_created'] = $data['date_created'] ?? null; - $this->container['date_sent'] = $data['date_sent'] ?? null; - $this->container['sid'] = $data['sid'] ?? null; - $this->container['messaging_service_sid'] = $data['messaging_service_sid'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['num_media'] = $data['num_media'] ?? null; - $this->container['account_sid'] = $data['account_sid'] ?? null; - $this->container['uri'] = $data['uri'] ?? null; - $this->container['error_message'] = $data['error_message'] ?? null; - $this->container['price'] = $data['price'] ?? null; - $this->container['date_updated'] = $data['date_updated'] ?? null; - $this->container['to'] = $data['to'] ?? null; - $this->container['from'] = $data['from'] ?? null; - $this->container['direction'] = $data['direction'] ?? null; - $this->container['num_segments'] = $data['num_segments'] ?? null; - $this->container['body'] = $data['body'] ?? null; + $this->setIfExists('subresource_uris', $data ?? [], null); + $this->setIfExists('api_version', $data ?? [], null); + $this->setIfExists('price_unit', $data ?? [], null); + $this->setIfExists('error_code', $data ?? [], null); + $this->setIfExists('date_created', $data ?? [], null); + $this->setIfExists('date_sent', $data ?? [], null); + $this->setIfExists('sid', $data ?? [], null); + $this->setIfExists('messaging_service_sid', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('num_media', $data ?? [], null); + $this->setIfExists('account_sid', $data ?? [], null); + $this->setIfExists('uri', $data ?? [], null); + $this->setIfExists('error_message', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('date_updated', $data ?? [], null); + $this->setIfExists('to', $data ?? [], null); + $this->setIfExists('from', $data ?? [], null); + $this->setIfExists('direction', $data ?? [], null); + $this->setIfExists('num_segments', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -400,6 +503,9 @@ public function getSubresourceUris() */ public function setSubresourceUris($subresource_uris) { + if (is_null($subresource_uris)) { + throw new \InvalidArgumentException('non-nullable subresource_uris cannot be null'); + } $this->container['subresource_uris'] = $subresource_uris; return $this; @@ -424,6 +530,9 @@ public function getApiVersion() */ public function setApiVersion($api_version) { + if (is_null($api_version)) { + throw new \InvalidArgumentException('non-nullable api_version cannot be null'); + } $this->container['api_version'] = $api_version; return $this; @@ -448,6 +557,9 @@ public function getPriceUnit() */ public function setPriceUnit($price_unit) { + if (is_null($price_unit)) { + throw new \InvalidArgumentException('non-nullable price_unit cannot be null'); + } $this->container['price_unit'] = $price_unit; return $this; @@ -456,7 +568,7 @@ public function setPriceUnit($price_unit) /** * Gets error_code * - * @return double + * @return float */ public function getErrorCode() { @@ -466,12 +578,15 @@ public function getErrorCode() /** * Sets error_code * - * @param double $error_code error_code + * @param float $error_code error_code * * @return self */ public function setErrorCode($error_code) { + if (is_null($error_code)) { + throw new \InvalidArgumentException('non-nullable error_code cannot be null'); + } $this->container['error_code'] = $error_code; return $this; @@ -496,6 +611,9 @@ public function getDateCreated() */ public function setDateCreated($date_created) { + if (is_null($date_created)) { + throw new \InvalidArgumentException('non-nullable date_created cannot be null'); + } $this->container['date_created'] = $date_created; return $this; @@ -520,6 +638,9 @@ public function getDateSent() */ public function setDateSent($date_sent) { + if (is_null($date_sent)) { + throw new \InvalidArgumentException('non-nullable date_sent cannot be null'); + } $this->container['date_sent'] = $date_sent; return $this; @@ -544,6 +665,9 @@ public function getSid() */ public function setSid($sid) { + if (is_null($sid)) { + throw new \InvalidArgumentException('non-nullable sid cannot be null'); + } $this->container['sid'] = $sid; return $this; @@ -568,6 +692,9 @@ public function getMessagingServiceSid() */ public function setMessagingServiceSid($messaging_service_sid) { + if (is_null($messaging_service_sid)) { + throw new \InvalidArgumentException('non-nullable messaging_service_sid cannot be null'); + } $this->container['messaging_service_sid'] = $messaging_service_sid; return $this; @@ -592,6 +719,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -616,6 +746,9 @@ public function getNumMedia() */ public function setNumMedia($num_media) { + if (is_null($num_media)) { + throw new \InvalidArgumentException('non-nullable num_media cannot be null'); + } $this->container['num_media'] = $num_media; return $this; @@ -640,6 +773,9 @@ public function getAccountSid() */ public function setAccountSid($account_sid) { + if (is_null($account_sid)) { + throw new \InvalidArgumentException('non-nullable account_sid cannot be null'); + } $this->container['account_sid'] = $account_sid; return $this; @@ -664,6 +800,9 @@ public function getUri() */ public function setUri($uri) { + if (is_null($uri)) { + throw new \InvalidArgumentException('non-nullable uri cannot be null'); + } $this->container['uri'] = $uri; return $this; @@ -688,6 +827,9 @@ public function getErrorMessage() */ public function setErrorMessage($error_message) { + if (is_null($error_message)) { + throw new \InvalidArgumentException('non-nullable error_message cannot be null'); + } $this->container['error_message'] = $error_message; return $this; @@ -712,6 +854,9 @@ public function getPrice() */ public function setPrice($price) { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } $this->container['price'] = $price; return $this; @@ -736,6 +881,9 @@ public function getDateUpdated() */ public function setDateUpdated($date_updated) { + if (is_null($date_updated)) { + throw new \InvalidArgumentException('non-nullable date_updated cannot be null'); + } $this->container['date_updated'] = $date_updated; return $this; @@ -760,6 +908,9 @@ public function getTo() */ public function setTo($to) { + if (is_null($to)) { + throw new \InvalidArgumentException('non-nullable to cannot be null'); + } $this->container['to'] = $to; return $this; @@ -784,6 +935,9 @@ public function getFrom() */ public function setFrom($from) { + if (is_null($from)) { + throw new \InvalidArgumentException('non-nullable from cannot be null'); + } $this->container['from'] = $from; return $this; @@ -808,6 +962,9 @@ public function getDirection() */ public function setDirection($direction) { + if (is_null($direction)) { + throw new \InvalidArgumentException('non-nullable direction cannot be null'); + } $this->container['direction'] = $direction; return $this; @@ -832,6 +989,9 @@ public function getNumSegments() */ public function setNumSegments($num_segments) { + if (is_null($num_segments)) { + throw new \InvalidArgumentException('non-nullable num_segments cannot be null'); + } $this->container['num_segments'] = $num_segments; return $this; @@ -856,6 +1016,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } $this->container['body'] = $body; return $this; @@ -867,7 +1030,7 @@ public function setBody($body) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -879,6 +1042,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -892,7 +1056,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -908,7 +1072,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -920,6 +1084,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTNewsArticleCreateParams.php b/lib/Model/WTNewsArticleCreateParams.php index 3564f17..c2318b5 100644 --- a/lib/Model/WTNewsArticleCreateParams.php +++ b/lib/Model/WTNewsArticleCreateParams.php @@ -2,7 +2,7 @@ /** * WTNewsArticleCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTNewsArticleCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTNewsArticleCreateParams implements ModelInterface, ArrayAccess, \JsonSer 'published_date' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'order_number' => false, + 'body' => false, + 'url' => false, + 'media_url' => false, + 'published_date' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['body'] = $data['body'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['published_date'] = $data['published_date'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('published_date', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -279,6 +368,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTNewsArticleCreateParams., must be bigger than or equal to 1.'); @@ -308,6 +400,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTNewsArticleCreateParams., must be bigger than or equal to 1.'); @@ -337,6 +432,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } if ((mb_strlen($body) < 1)) { throw new \InvalidArgumentException('invalid length for $body when calling WTNewsArticleCreateParams., must be bigger than or equal to 1.'); @@ -366,6 +464,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } $this->container['url'] = $url; return $this; @@ -390,6 +491,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -414,6 +518,9 @@ public function getPublishedDate() */ public function setPublishedDate($published_date) { + if (is_null($published_date)) { + throw new \InvalidArgumentException('non-nullable published_date cannot be null'); + } $this->container['published_date'] = $published_date; return $this; @@ -425,7 +532,7 @@ public function setPublishedDate($published_date) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -437,6 +544,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -450,7 +558,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -466,7 +574,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -478,6 +586,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTNewsArticleUpdateParams.php b/lib/Model/WTNewsArticleUpdateParams.php index d3928b9..f9cc355 100644 --- a/lib/Model/WTNewsArticleUpdateParams.php +++ b/lib/Model/WTNewsArticleUpdateParams.php @@ -2,7 +2,7 @@ /** * WTNewsArticleUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTNewsArticleUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTNewsArticleUpdateParams implements ModelInterface, ArrayAccess, \JsonSer 'published_date' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'body' => false, + 'url' => false, + 'order_number' => false, + 'media_url' => false, + 'published_date' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['body'] = $data['body'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['published_date'] = $data['published_date'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('published_date', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -279,6 +368,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTNewsArticleUpdateParams., must be bigger than or equal to 1.'); @@ -308,6 +400,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } if ((mb_strlen($body) < 1)) { throw new \InvalidArgumentException('invalid length for $body when calling WTNewsArticleUpdateParams., must be bigger than or equal to 1.'); @@ -337,6 +432,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } $this->container['url'] = $url; return $this; @@ -361,6 +459,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTNewsArticleUpdateParams., must be bigger than or equal to 1.'); @@ -390,6 +491,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -414,6 +518,9 @@ public function getPublishedDate() */ public function setPublishedDate($published_date) { + if (is_null($published_date)) { + throw new \InvalidArgumentException('non-nullable published_date cannot be null'); + } $this->container['published_date'] = $published_date; return $this; @@ -425,7 +532,7 @@ public function setPublishedDate($published_date) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -437,6 +544,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -450,7 +558,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -466,7 +574,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -478,6 +586,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTOptInList.php b/lib/Model/WTOptInList.php index 3506cb1..c2ecdd1 100644 --- a/lib/Model/WTOptInList.php +++ b/lib/Model/WTOptInList.php @@ -2,7 +2,7 @@ /** * WTOptInList * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTOptInList implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,7 +72,7 @@ class WTOptInList implements ModelInterface, ArrayAccess, \JsonSerializable 'opt_in_confirmed_media_urls' => 'string[]', 'opt_out_confirmed_media_urls' => 'string[]', 'is_over21_required' => 'bool', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime' @@ -108,6 +106,39 @@ class WTOptInList implements ModelInterface, ArrayAccess, \JsonSerializable 'updated_at' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false, + 'is_active' => false, + 'list_name' => false, + 'phone_number_id' => false, + 'estimated_messages_per_month' => false, + 'opt_in_keyword' => false, + 'opt_out_keyword' => false, + 'opt_in_confirmed_response' => false, + 'opt_out_confirmed_response' => false, + 'opt_in_confirmed_customer_receives' => false, + 'opt_out_confirmed_customer_receives' => false, + 'opt_in_confirmed_media_urls' => false, + 'opt_out_confirmed_media_urls' => false, + 'is_over21_required' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -128,6 +159,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -264,24 +347,42 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['list_name'] = $data['list_name'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['estimated_messages_per_month'] = $data['estimated_messages_per_month'] ?? null; - $this->container['opt_in_keyword'] = $data['opt_in_keyword'] ?? null; - $this->container['opt_out_keyword'] = $data['opt_out_keyword'] ?? null; - $this->container['opt_in_confirmed_response'] = $data['opt_in_confirmed_response'] ?? null; - $this->container['opt_out_confirmed_response'] = $data['opt_out_confirmed_response'] ?? null; - $this->container['opt_in_confirmed_customer_receives'] = $data['opt_in_confirmed_customer_receives'] ?? null; - $this->container['opt_out_confirmed_customer_receives'] = $data['opt_out_confirmed_customer_receives'] ?? null; - $this->container['opt_in_confirmed_media_urls'] = $data['opt_in_confirmed_media_urls'] ?? null; - $this->container['opt_out_confirmed_media_urls'] = $data['opt_out_confirmed_media_urls'] ?? null; - $this->container['is_over21_required'] = $data['is_over21_required'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('list_name', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('estimated_messages_per_month', $data ?? [], null); + $this->setIfExists('opt_in_keyword', $data ?? [], null); + $this->setIfExists('opt_out_keyword', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_response', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_response', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_customer_receives', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_customer_receives', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_media_urls', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_media_urls', $data ?? [], null); + $this->setIfExists('is_over21_required', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -386,14 +487,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -449,14 +542,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTOptInList., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTOptInList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling WTOptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling WTOptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -483,6 +579,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -507,6 +606,9 @@ public function getListName() */ public function setListName($list_name) { + if (is_null($list_name)) { + throw new \InvalidArgumentException('non-nullable list_name cannot be null'); + } if ((mb_strlen($list_name) < 1)) { throw new \InvalidArgumentException('invalid length for $list_name when calling WTOptInList., must be bigger than or equal to 1.'); @@ -536,14 +638,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTOptInList., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTOptInList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling WTOptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling WTOptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -570,6 +675,9 @@ public function getEstimatedMessagesPerMonth() */ public function setEstimatedMessagesPerMonth($estimated_messages_per_month) { + if (is_null($estimated_messages_per_month)) { + throw new \InvalidArgumentException('non-nullable estimated_messages_per_month cannot be null'); + } if (($estimated_messages_per_month < 0)) { throw new \InvalidArgumentException('invalid value for $estimated_messages_per_month when calling WTOptInList., must be bigger than or equal to 0.'); @@ -599,6 +707,9 @@ public function getOptInKeyword() */ public function setOptInKeyword($opt_in_keyword) { + if (is_null($opt_in_keyword)) { + throw new \InvalidArgumentException('non-nullable opt_in_keyword cannot be null'); + } if ((mb_strlen($opt_in_keyword) > 30)) { throw new \InvalidArgumentException('invalid length for $opt_in_keyword when calling WTOptInList., must be smaller than or equal to 30.'); } @@ -630,6 +741,9 @@ public function getOptOutKeyword() */ public function setOptOutKeyword($opt_out_keyword) { + if (is_null($opt_out_keyword)) { + throw new \InvalidArgumentException('non-nullable opt_out_keyword cannot be null'); + } if ((mb_strlen($opt_out_keyword) > 34)) { throw new \InvalidArgumentException('invalid length for $opt_out_keyword when calling WTOptInList., must be smaller than or equal to 34.'); } @@ -661,6 +775,9 @@ public function getOptInConfirmedResponse() */ public function setOptInConfirmedResponse($opt_in_confirmed_response) { + if (is_null($opt_in_confirmed_response)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_response cannot be null'); + } $this->container['opt_in_confirmed_response'] = $opt_in_confirmed_response; return $this; @@ -685,6 +802,9 @@ public function getOptOutConfirmedResponse() */ public function setOptOutConfirmedResponse($opt_out_confirmed_response) { + if (is_null($opt_out_confirmed_response)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_response cannot be null'); + } $this->container['opt_out_confirmed_response'] = $opt_out_confirmed_response; return $this; @@ -709,6 +829,9 @@ public function getOptInConfirmedCustomerReceives() */ public function setOptInConfirmedCustomerReceives($opt_in_confirmed_customer_receives) { + if (is_null($opt_in_confirmed_customer_receives)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_customer_receives cannot be null'); + } $this->container['opt_in_confirmed_customer_receives'] = $opt_in_confirmed_customer_receives; return $this; @@ -733,6 +856,9 @@ public function getOptOutConfirmedCustomerReceives() */ public function setOptOutConfirmedCustomerReceives($opt_out_confirmed_customer_receives) { + if (is_null($opt_out_confirmed_customer_receives)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_customer_receives cannot be null'); + } $this->container['opt_out_confirmed_customer_receives'] = $opt_out_confirmed_customer_receives; return $this; @@ -757,6 +883,9 @@ public function getOptInConfirmedMediaUrls() */ public function setOptInConfirmedMediaUrls($opt_in_confirmed_media_urls) { + if (is_null($opt_in_confirmed_media_urls)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_media_urls cannot be null'); + } $this->container['opt_in_confirmed_media_urls'] = $opt_in_confirmed_media_urls; return $this; @@ -781,6 +910,9 @@ public function getOptOutConfirmedMediaUrls() */ public function setOptOutConfirmedMediaUrls($opt_out_confirmed_media_urls) { + if (is_null($opt_out_confirmed_media_urls)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_media_urls cannot be null'); + } $this->container['opt_out_confirmed_media_urls'] = $opt_out_confirmed_media_urls; return $this; @@ -805,6 +937,9 @@ public function getIsOver21Required() */ public function setIsOver21Required($is_over21_required) { + if (is_null($is_over21_required)) { + throw new \InvalidArgumentException('non-nullable is_over21_required cannot be null'); + } $this->container['is_over21_required'] = $is_over21_required; return $this; @@ -813,7 +948,7 @@ public function setIsOver21Required($is_over21_required) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -823,19 +958,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTOptInList., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTOptInList., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -860,14 +991,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTOptInList., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTOptInList., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTOptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTOptInList., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -894,6 +1028,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -918,6 +1055,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -929,7 +1069,7 @@ public function setUpdatedAt($updated_at) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -941,6 +1081,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -954,7 +1095,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -970,7 +1111,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -982,6 +1123,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTOptInListCreationParams.php b/lib/Model/WTOptInListCreationParams.php index 0bd950b..5791289 100644 --- a/lib/Model/WTOptInListCreationParams.php +++ b/lib/Model/WTOptInListCreationParams.php @@ -2,7 +2,7 @@ /** * WTOptInListCreationParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTOptInListCreationParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -98,6 +96,34 @@ class WTOptInListCreationParams implements ModelInterface, ArrayAccess, \JsonSer 'opt_out_confirmed_media_urls' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'is_active' => false, + 'list_name' => false, + 'phone_number_id' => false, + 'estimated_messages_per_month' => false, + 'opt_in_keyword' => false, + 'opt_out_keyword' => false, + 'opt_in_confirmed_response' => false, + 'opt_out_confirmed_response' => false, + 'opt_in_confirmed_customer_receives' => false, + 'opt_out_confirmed_customer_receives' => false, + 'is_over21_required' => false, + 'opt_in_confirmed_media_urls' => false, + 'opt_out_confirmed_media_urls' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -118,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -239,19 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['list_name'] = $data['list_name'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['estimated_messages_per_month'] = $data['estimated_messages_per_month'] ?? null; - $this->container['opt_in_keyword'] = $data['opt_in_keyword'] ?? null; - $this->container['opt_out_keyword'] = $data['opt_out_keyword'] ?? null; - $this->container['opt_in_confirmed_response'] = $data['opt_in_confirmed_response'] ?? null; - $this->container['opt_out_confirmed_response'] = $data['opt_out_confirmed_response'] ?? null; - $this->container['opt_in_confirmed_customer_receives'] = $data['opt_in_confirmed_customer_receives'] ?? null; - $this->container['opt_out_confirmed_customer_receives'] = $data['opt_out_confirmed_customer_receives'] ?? null; - $this->container['is_over21_required'] = $data['is_over21_required'] ?? null; - $this->container['opt_in_confirmed_media_urls'] = $data['opt_in_confirmed_media_urls'] ?? null; - $this->container['opt_out_confirmed_media_urls'] = $data['opt_out_confirmed_media_urls'] ?? null; + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('list_name', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('estimated_messages_per_month', $data ?? [], null); + $this->setIfExists('opt_in_keyword', $data ?? [], null); + $this->setIfExists('opt_out_keyword', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_response', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_response', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_customer_receives', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_customer_receives', $data ?? [], null); + $this->setIfExists('is_over21_required', $data ?? [], null); + $this->setIfExists('opt_in_confirmed_media_urls', $data ?? [], null); + $this->setIfExists('opt_out_confirmed_media_urls', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -366,6 +462,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -390,6 +489,9 @@ public function getListName() */ public function setListName($list_name) { + if (is_null($list_name)) { + throw new \InvalidArgumentException('non-nullable list_name cannot be null'); + } if ((mb_strlen($list_name) < 1)) { throw new \InvalidArgumentException('invalid length for $list_name when calling WTOptInListCreationParams., must be bigger than or equal to 1.'); @@ -419,14 +521,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTOptInListCreationParams., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTOptInListCreationParams., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling WTOptInListCreationParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling WTOptInListCreationParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -453,6 +558,9 @@ public function getEstimatedMessagesPerMonth() */ public function setEstimatedMessagesPerMonth($estimated_messages_per_month) { + if (is_null($estimated_messages_per_month)) { + throw new \InvalidArgumentException('non-nullable estimated_messages_per_month cannot be null'); + } if (($estimated_messages_per_month < 0)) { throw new \InvalidArgumentException('invalid value for $estimated_messages_per_month when calling WTOptInListCreationParams., must be bigger than or equal to 0.'); @@ -482,6 +590,9 @@ public function getOptInKeyword() */ public function setOptInKeyword($opt_in_keyword) { + if (is_null($opt_in_keyword)) { + throw new \InvalidArgumentException('non-nullable opt_in_keyword cannot be null'); + } if ((mb_strlen($opt_in_keyword) > 30)) { throw new \InvalidArgumentException('invalid length for $opt_in_keyword when calling WTOptInListCreationParams., must be smaller than or equal to 30.'); } @@ -513,6 +624,9 @@ public function getOptOutKeyword() */ public function setOptOutKeyword($opt_out_keyword) { + if (is_null($opt_out_keyword)) { + throw new \InvalidArgumentException('non-nullable opt_out_keyword cannot be null'); + } if ((mb_strlen($opt_out_keyword) > 34)) { throw new \InvalidArgumentException('invalid length for $opt_out_keyword when calling WTOptInListCreationParams., must be smaller than or equal to 34.'); } @@ -544,6 +658,9 @@ public function getOptInConfirmedResponse() */ public function setOptInConfirmedResponse($opt_in_confirmed_response) { + if (is_null($opt_in_confirmed_response)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_response cannot be null'); + } $this->container['opt_in_confirmed_response'] = $opt_in_confirmed_response; return $this; @@ -568,6 +685,9 @@ public function getOptOutConfirmedResponse() */ public function setOptOutConfirmedResponse($opt_out_confirmed_response) { + if (is_null($opt_out_confirmed_response)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_response cannot be null'); + } $this->container['opt_out_confirmed_response'] = $opt_out_confirmed_response; return $this; @@ -592,6 +712,9 @@ public function getOptInConfirmedCustomerReceives() */ public function setOptInConfirmedCustomerReceives($opt_in_confirmed_customer_receives) { + if (is_null($opt_in_confirmed_customer_receives)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_customer_receives cannot be null'); + } $this->container['opt_in_confirmed_customer_receives'] = $opt_in_confirmed_customer_receives; return $this; @@ -616,6 +739,9 @@ public function getOptOutConfirmedCustomerReceives() */ public function setOptOutConfirmedCustomerReceives($opt_out_confirmed_customer_receives) { + if (is_null($opt_out_confirmed_customer_receives)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_customer_receives cannot be null'); + } $this->container['opt_out_confirmed_customer_receives'] = $opt_out_confirmed_customer_receives; return $this; @@ -640,6 +766,9 @@ public function getIsOver21Required() */ public function setIsOver21Required($is_over21_required) { + if (is_null($is_over21_required)) { + throw new \InvalidArgumentException('non-nullable is_over21_required cannot be null'); + } $this->container['is_over21_required'] = $is_over21_required; return $this; @@ -664,6 +793,9 @@ public function getOptInConfirmedMediaUrls() */ public function setOptInConfirmedMediaUrls($opt_in_confirmed_media_urls) { + if (is_null($opt_in_confirmed_media_urls)) { + throw new \InvalidArgumentException('non-nullable opt_in_confirmed_media_urls cannot be null'); + } $this->container['opt_in_confirmed_media_urls'] = $opt_in_confirmed_media_urls; return $this; @@ -688,6 +820,9 @@ public function getOptOutConfirmedMediaUrls() */ public function setOptOutConfirmedMediaUrls($opt_out_confirmed_media_urls) { + if (is_null($opt_out_confirmed_media_urls)) { + throw new \InvalidArgumentException('non-nullable opt_out_confirmed_media_urls cannot be null'); + } $this->container['opt_out_confirmed_media_urls'] = $opt_out_confirmed_media_urls; return $this; @@ -699,7 +834,7 @@ public function setOptOutConfirmedMediaUrls($opt_out_confirmed_media_urls) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -711,6 +846,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -724,7 +860,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -740,7 +876,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -752,6 +888,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTPaymentDesign.php b/lib/Model/WTPaymentDesign.php index 46a9569..f61db8c 100644 --- a/lib/Model/WTPaymentDesign.php +++ b/lib/Model/WTPaymentDesign.php @@ -2,7 +2,7 @@ /** * WTPaymentDesign * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTPaymentDesign implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,7 +59,7 @@ class WTPaymentDesign implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'border_color' => 'string', - 'border_style_type' => 'string', + 'border_style_type' => '\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType', 'border_size' => 'string', 'border_radius' => 'int', 'font_color' => 'string', @@ -74,7 +72,7 @@ class WTPaymentDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'background_image_url' => 'string', 'company_logo_url' => 'string', 'employee_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'merchant_id' => 'string', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', @@ -110,6 +108,40 @@ class WTPaymentDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'border_color' => false, + 'border_style_type' => false, + 'border_size' => false, + 'border_radius' => false, + 'font_color' => false, + 'font_type' => false, + 'abbreviation' => false, + 'acronym' => false, + 'icon' => false, + 'design_name' => false, + 'display_name' => false, + 'background_image_url' => false, + 'company_logo_url' => false, + 'employee_id' => false, + 'id' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -130,6 +162,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -269,25 +353,43 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['border_color'] = $data['border_color'] ?? null; - $this->container['border_style_type'] = $data['border_style_type'] ?? null; - $this->container['border_size'] = $data['border_size'] ?? null; - $this->container['border_radius'] = $data['border_radius'] ?? null; - $this->container['font_color'] = $data['font_color'] ?? null; - $this->container['font_type'] = $data['font_type'] ?? null; - $this->container['abbreviation'] = $data['abbreviation'] ?? null; - $this->container['acronym'] = $data['acronym'] ?? null; - $this->container['icon'] = $data['icon'] ?? null; - $this->container['design_name'] = $data['design_name'] ?? null; - $this->container['display_name'] = $data['display_name'] ?? null; - $this->container['background_image_url'] = $data['background_image_url'] ?? null; - $this->container['company_logo_url'] = $data['company_logo_url'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('border_color', $data ?? [], null); + $this->setIfExists('border_style_type', $data ?? [], null); + $this->setIfExists('border_size', $data ?? [], null); + $this->setIfExists('border_radius', $data ?? [], null); + $this->setIfExists('font_color', $data ?? [], null); + $this->setIfExists('font_type', $data ?? [], null); + $this->setIfExists('abbreviation', $data ?? [], null); + $this->setIfExists('acronym', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('design_name', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('background_image_url', $data ?? [], null); + $this->setIfExists('company_logo_url', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -394,14 +496,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['merchant_id'] === null) { $invalidProperties[] = "'merchant_id' can't be null"; } @@ -460,9 +554,12 @@ public function getBorderColor() */ public function setBorderColor($border_color) { + if (is_null($border_color)) { + throw new \InvalidArgumentException('non-nullable border_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $border_color))) { - throw new \InvalidArgumentException("invalid value for $border_color when calling WTPaymentDesign., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($border_color)))) { + throw new \InvalidArgumentException("invalid value for \$border_color when calling WTPaymentDesign., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['border_color'] = $border_color; @@ -473,7 +570,7 @@ public function setBorderColor($border_color) /** * Gets border_style_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType */ public function getBorderStyleType() { @@ -483,12 +580,15 @@ public function getBorderStyleType() /** * Sets border_style_type * - * @param string $border_style_type border_style_type + * @param \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType $border_style_type border_style_type * * @return self */ public function setBorderStyleType($border_style_type) { + if (is_null($border_style_type)) { + throw new \InvalidArgumentException('non-nullable border_style_type cannot be null'); + } $this->container['border_style_type'] = $border_style_type; return $this; @@ -513,6 +613,9 @@ public function getBorderSize() */ public function setBorderSize($border_size) { + if (is_null($border_size)) { + throw new \InvalidArgumentException('non-nullable border_size cannot be null'); + } if ((mb_strlen($border_size) < 1)) { throw new \InvalidArgumentException('invalid length for $border_size when calling WTPaymentDesign., must be bigger than or equal to 1.'); @@ -542,6 +645,9 @@ public function getBorderRadius() */ public function setBorderRadius($border_radius) { + if (is_null($border_radius)) { + throw new \InvalidArgumentException('non-nullable border_radius cannot be null'); + } if (($border_radius > 20)) { throw new \InvalidArgumentException('invalid value for $border_radius when calling WTPaymentDesign., must be smaller than or equal to 20.'); @@ -574,9 +680,12 @@ public function getFontColor() */ public function setFontColor($font_color) { + if (is_null($font_color)) { + throw new \InvalidArgumentException('non-nullable font_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $font_color))) { - throw new \InvalidArgumentException("invalid value for $font_color when calling WTPaymentDesign., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($font_color)))) { + throw new \InvalidArgumentException("invalid value for \$font_color when calling WTPaymentDesign., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['font_color'] = $font_color; @@ -603,6 +712,9 @@ public function getFontType() */ public function setFontType($font_type) { + if (is_null($font_type)) { + throw new \InvalidArgumentException('non-nullable font_type cannot be null'); + } if ((mb_strlen($font_type) < 1)) { throw new \InvalidArgumentException('invalid length for $font_type when calling WTPaymentDesign., must be bigger than or equal to 1.'); @@ -632,6 +744,9 @@ public function getAbbreviation() */ public function setAbbreviation($abbreviation) { + if (is_null($abbreviation)) { + throw new \InvalidArgumentException('non-nullable abbreviation cannot be null'); + } if ((mb_strlen($abbreviation) < 1)) { throw new \InvalidArgumentException('invalid length for $abbreviation when calling WTPaymentDesign., must be bigger than or equal to 1.'); @@ -661,6 +776,9 @@ public function getAcronym() */ public function setAcronym($acronym) { + if (is_null($acronym)) { + throw new \InvalidArgumentException('non-nullable acronym cannot be null'); + } if ((mb_strlen($acronym) < 1)) { throw new \InvalidArgumentException('invalid length for $acronym when calling WTPaymentDesign., must be bigger than or equal to 1.'); @@ -690,6 +808,9 @@ public function getIcon() */ public function setIcon($icon) { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } if ((mb_strlen($icon) < 1)) { throw new \InvalidArgumentException('invalid length for $icon when calling WTPaymentDesign., must be bigger than or equal to 1.'); @@ -719,6 +840,9 @@ public function getDesignName() */ public function setDesignName($design_name) { + if (is_null($design_name)) { + throw new \InvalidArgumentException('non-nullable design_name cannot be null'); + } if ((mb_strlen($design_name) < 1)) { throw new \InvalidArgumentException('invalid length for $design_name when calling WTPaymentDesign., must be bigger than or equal to 1.'); @@ -748,6 +872,9 @@ public function getDisplayName() */ public function setDisplayName($display_name) { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } if ((mb_strlen($display_name) < 1)) { throw new \InvalidArgumentException('invalid length for $display_name when calling WTPaymentDesign., must be bigger than or equal to 1.'); @@ -777,6 +904,9 @@ public function getBackgroundImageUrl() */ public function setBackgroundImageUrl($background_image_url) { + if (is_null($background_image_url)) { + throw new \InvalidArgumentException('non-nullable background_image_url cannot be null'); + } $this->container['background_image_url'] = $background_image_url; return $this; @@ -801,6 +931,9 @@ public function getCompanyLogoUrl() */ public function setCompanyLogoUrl($company_logo_url) { + if (is_null($company_logo_url)) { + throw new \InvalidArgumentException('non-nullable company_logo_url cannot be null'); + } $this->container['company_logo_url'] = $company_logo_url; return $this; @@ -825,14 +958,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTPaymentDesign., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTPaymentDesign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling WTPaymentDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling WTPaymentDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -843,7 +979,7 @@ public function setEmployeeId($employee_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -853,19 +989,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTPaymentDesign., must be smaller than or equal to 12.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTPaymentDesign., must be bigger than or equal to 10.'); - } - $this->container['id'] = $id; return $this; @@ -890,14 +1022,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTPaymentDesign., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTPaymentDesign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTPaymentDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTPaymentDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -924,6 +1059,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -948,6 +1086,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -972,6 +1113,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -983,7 +1127,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -995,6 +1139,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1008,7 +1153,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1024,7 +1169,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1036,6 +1181,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTPaymentDesignCreateParams.php b/lib/Model/WTPaymentDesignCreateParams.php index de7cfaa..1c03649 100644 --- a/lib/Model/WTPaymentDesignCreateParams.php +++ b/lib/Model/WTPaymentDesignCreateParams.php @@ -2,7 +2,7 @@ /** * WTPaymentDesignCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTPaymentDesignCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,7 +59,7 @@ class WTPaymentDesignCreateParams implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPITypes = [ 'border_color' => 'string', - 'border_style_type' => 'string', + 'border_style_type' => '\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType', 'border_size' => 'string', 'border_radius' => 'int', 'font_color' => 'string', @@ -98,6 +96,34 @@ class WTPaymentDesignCreateParams implements ModelInterface, ArrayAccess, \JsonS 'company_logo_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'border_color' => false, + 'border_style_type' => false, + 'border_size' => false, + 'border_radius' => false, + 'font_color' => false, + 'font_type' => false, + 'abbreviation' => false, + 'acronym' => false, + 'icon' => false, + 'design_name' => false, + 'display_name' => false, + 'background_image_url' => false, + 'company_logo_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -118,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -239,19 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['border_color'] = $data['border_color'] ?? null; - $this->container['border_style_type'] = $data['border_style_type'] ?? null; - $this->container['border_size'] = $data['border_size'] ?? null; - $this->container['border_radius'] = $data['border_radius'] ?? null; - $this->container['font_color'] = $data['font_color'] ?? null; - $this->container['font_type'] = $data['font_type'] ?? null; - $this->container['abbreviation'] = $data['abbreviation'] ?? null; - $this->container['acronym'] = $data['acronym'] ?? null; - $this->container['icon'] = $data['icon'] ?? null; - $this->container['design_name'] = $data['design_name'] ?? null; - $this->container['display_name'] = $data['display_name'] ?? null; - $this->container['background_image_url'] = $data['background_image_url'] ?? null; - $this->container['company_logo_url'] = $data['company_logo_url'] ?? null; + $this->setIfExists('border_color', $data ?? [], null); + $this->setIfExists('border_style_type', $data ?? [], null); + $this->setIfExists('border_size', $data ?? [], null); + $this->setIfExists('border_radius', $data ?? [], null); + $this->setIfExists('font_color', $data ?? [], null); + $this->setIfExists('font_type', $data ?? [], null); + $this->setIfExists('abbreviation', $data ?? [], null); + $this->setIfExists('acronym', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('design_name', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('background_image_url', $data ?? [], null); + $this->setIfExists('company_logo_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -374,9 +470,12 @@ public function getBorderColor() */ public function setBorderColor($border_color) { + if (is_null($border_color)) { + throw new \InvalidArgumentException('non-nullable border_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $border_color))) { - throw new \InvalidArgumentException("invalid value for $border_color when calling WTPaymentDesignCreateParams., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($border_color)))) { + throw new \InvalidArgumentException("invalid value for \$border_color when calling WTPaymentDesignCreateParams., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['border_color'] = $border_color; @@ -387,7 +486,7 @@ public function setBorderColor($border_color) /** * Gets border_style_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType */ public function getBorderStyleType() { @@ -397,12 +496,15 @@ public function getBorderStyleType() /** * Sets border_style_type * - * @param string $border_style_type border_style_type + * @param \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType $border_style_type border_style_type * * @return self */ public function setBorderStyleType($border_style_type) { + if (is_null($border_style_type)) { + throw new \InvalidArgumentException('non-nullable border_style_type cannot be null'); + } $this->container['border_style_type'] = $border_style_type; return $this; @@ -427,6 +529,9 @@ public function getBorderSize() */ public function setBorderSize($border_size) { + if (is_null($border_size)) { + throw new \InvalidArgumentException('non-nullable border_size cannot be null'); + } if ((mb_strlen($border_size) < 1)) { throw new \InvalidArgumentException('invalid length for $border_size when calling WTPaymentDesignCreateParams., must be bigger than or equal to 1.'); @@ -456,6 +561,9 @@ public function getBorderRadius() */ public function setBorderRadius($border_radius) { + if (is_null($border_radius)) { + throw new \InvalidArgumentException('non-nullable border_radius cannot be null'); + } if (($border_radius > 20)) { throw new \InvalidArgumentException('invalid value for $border_radius when calling WTPaymentDesignCreateParams., must be smaller than or equal to 20.'); @@ -488,9 +596,12 @@ public function getFontColor() */ public function setFontColor($font_color) { + if (is_null($font_color)) { + throw new \InvalidArgumentException('non-nullable font_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $font_color))) { - throw new \InvalidArgumentException("invalid value for $font_color when calling WTPaymentDesignCreateParams., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($font_color)))) { + throw new \InvalidArgumentException("invalid value for \$font_color when calling WTPaymentDesignCreateParams., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['font_color'] = $font_color; @@ -517,6 +628,9 @@ public function getFontType() */ public function setFontType($font_type) { + if (is_null($font_type)) { + throw new \InvalidArgumentException('non-nullable font_type cannot be null'); + } if ((mb_strlen($font_type) < 1)) { throw new \InvalidArgumentException('invalid length for $font_type when calling WTPaymentDesignCreateParams., must be bigger than or equal to 1.'); @@ -546,6 +660,9 @@ public function getAbbreviation() */ public function setAbbreviation($abbreviation) { + if (is_null($abbreviation)) { + throw new \InvalidArgumentException('non-nullable abbreviation cannot be null'); + } if ((mb_strlen($abbreviation) < 1)) { throw new \InvalidArgumentException('invalid length for $abbreviation when calling WTPaymentDesignCreateParams., must be bigger than or equal to 1.'); @@ -575,6 +692,9 @@ public function getAcronym() */ public function setAcronym($acronym) { + if (is_null($acronym)) { + throw new \InvalidArgumentException('non-nullable acronym cannot be null'); + } if ((mb_strlen($acronym) < 1)) { throw new \InvalidArgumentException('invalid length for $acronym when calling WTPaymentDesignCreateParams., must be bigger than or equal to 1.'); @@ -604,6 +724,9 @@ public function getIcon() */ public function setIcon($icon) { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } if ((mb_strlen($icon) < 1)) { throw new \InvalidArgumentException('invalid length for $icon when calling WTPaymentDesignCreateParams., must be bigger than or equal to 1.'); @@ -633,6 +756,9 @@ public function getDesignName() */ public function setDesignName($design_name) { + if (is_null($design_name)) { + throw new \InvalidArgumentException('non-nullable design_name cannot be null'); + } if ((mb_strlen($design_name) < 1)) { throw new \InvalidArgumentException('invalid length for $design_name when calling WTPaymentDesignCreateParams., must be bigger than or equal to 1.'); @@ -662,6 +788,9 @@ public function getDisplayName() */ public function setDisplayName($display_name) { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } if ((mb_strlen($display_name) < 1)) { throw new \InvalidArgumentException('invalid length for $display_name when calling WTPaymentDesignCreateParams., must be bigger than or equal to 1.'); @@ -691,6 +820,9 @@ public function getBackgroundImageUrl() */ public function setBackgroundImageUrl($background_image_url) { + if (is_null($background_image_url)) { + throw new \InvalidArgumentException('non-nullable background_image_url cannot be null'); + } $this->container['background_image_url'] = $background_image_url; return $this; @@ -715,6 +847,9 @@ public function getCompanyLogoUrl() */ public function setCompanyLogoUrl($company_logo_url) { + if (is_null($company_logo_url)) { + throw new \InvalidArgumentException('non-nullable company_logo_url cannot be null'); + } $this->container['company_logo_url'] = $company_logo_url; return $this; @@ -726,7 +861,7 @@ public function setCompanyLogoUrl($company_logo_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -738,6 +873,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -751,7 +887,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -767,7 +903,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -779,6 +915,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTPaymentDesignUpdateParams.php b/lib/Model/WTPaymentDesignUpdateParams.php index 0ee59c2..7c9167f 100644 --- a/lib/Model/WTPaymentDesignUpdateParams.php +++ b/lib/Model/WTPaymentDesignUpdateParams.php @@ -2,7 +2,7 @@ /** * WTPaymentDesignUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTPaymentDesignUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,7 +59,7 @@ class WTPaymentDesignUpdateParams implements ModelInterface, ArrayAccess, \JsonS */ protected static $openAPITypes = [ 'border_color' => 'string', - 'border_style_type' => 'string', + 'border_style_type' => '\OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType', 'border_size' => 'string', 'border_radius' => 'int', 'font_color' => 'string', @@ -98,6 +96,34 @@ class WTPaymentDesignUpdateParams implements ModelInterface, ArrayAccess, \JsonS 'company_logo_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'border_color' => false, + 'border_style_type' => false, + 'border_size' => false, + 'border_radius' => false, + 'font_color' => false, + 'font_type' => false, + 'abbreviation' => false, + 'acronym' => false, + 'icon' => false, + 'design_name' => false, + 'display_name' => false, + 'background_image_url' => false, + 'company_logo_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -118,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -239,19 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['border_color'] = $data['border_color'] ?? null; - $this->container['border_style_type'] = $data['border_style_type'] ?? null; - $this->container['border_size'] = $data['border_size'] ?? null; - $this->container['border_radius'] = $data['border_radius'] ?? null; - $this->container['font_color'] = $data['font_color'] ?? null; - $this->container['font_type'] = $data['font_type'] ?? null; - $this->container['abbreviation'] = $data['abbreviation'] ?? null; - $this->container['acronym'] = $data['acronym'] ?? null; - $this->container['icon'] = $data['icon'] ?? null; - $this->container['design_name'] = $data['design_name'] ?? null; - $this->container['display_name'] = $data['display_name'] ?? null; - $this->container['background_image_url'] = $data['background_image_url'] ?? null; - $this->container['company_logo_url'] = $data['company_logo_url'] ?? null; + $this->setIfExists('border_color', $data ?? [], null); + $this->setIfExists('border_style_type', $data ?? [], null); + $this->setIfExists('border_size', $data ?? [], null); + $this->setIfExists('border_radius', $data ?? [], null); + $this->setIfExists('font_color', $data ?? [], null); + $this->setIfExists('font_type', $data ?? [], null); + $this->setIfExists('abbreviation', $data ?? [], null); + $this->setIfExists('acronym', $data ?? [], null); + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('design_name', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('background_image_url', $data ?? [], null); + $this->setIfExists('company_logo_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -374,9 +470,12 @@ public function getBorderColor() */ public function setBorderColor($border_color) { + if (is_null($border_color)) { + throw new \InvalidArgumentException('non-nullable border_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $border_color))) { - throw new \InvalidArgumentException("invalid value for $border_color when calling WTPaymentDesignUpdateParams., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($border_color)))) { + throw new \InvalidArgumentException("invalid value for \$border_color when calling WTPaymentDesignUpdateParams., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['border_color'] = $border_color; @@ -387,7 +486,7 @@ public function setBorderColor($border_color) /** * Gets border_style_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType */ public function getBorderStyleType() { @@ -397,12 +496,15 @@ public function getBorderStyleType() /** * Sets border_style_type * - * @param string $border_style_type border_style_type + * @param \OpenAPI\Client\Model\PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleType $border_style_type border_style_type * * @return self */ public function setBorderStyleType($border_style_type) { + if (is_null($border_style_type)) { + throw new \InvalidArgumentException('non-nullable border_style_type cannot be null'); + } $this->container['border_style_type'] = $border_style_type; return $this; @@ -427,6 +529,9 @@ public function getBorderSize() */ public function setBorderSize($border_size) { + if (is_null($border_size)) { + throw new \InvalidArgumentException('non-nullable border_size cannot be null'); + } if ((mb_strlen($border_size) < 1)) { throw new \InvalidArgumentException('invalid length for $border_size when calling WTPaymentDesignUpdateParams., must be bigger than or equal to 1.'); @@ -456,6 +561,9 @@ public function getBorderRadius() */ public function setBorderRadius($border_radius) { + if (is_null($border_radius)) { + throw new \InvalidArgumentException('non-nullable border_radius cannot be null'); + } if (($border_radius > 20)) { throw new \InvalidArgumentException('invalid value for $border_radius when calling WTPaymentDesignUpdateParams., must be smaller than or equal to 20.'); @@ -488,9 +596,12 @@ public function getFontColor() */ public function setFontColor($font_color) { + if (is_null($font_color)) { + throw new \InvalidArgumentException('non-nullable font_color cannot be null'); + } - if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", $font_color))) { - throw new \InvalidArgumentException("invalid value for $font_color when calling WTPaymentDesignUpdateParams., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); + if ((!preg_match("/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/", ObjectSerializer::toString($font_color)))) { + throw new \InvalidArgumentException("invalid value for \$font_color when calling WTPaymentDesignUpdateParams., must conform to the pattern /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/."); } $this->container['font_color'] = $font_color; @@ -517,6 +628,9 @@ public function getFontType() */ public function setFontType($font_type) { + if (is_null($font_type)) { + throw new \InvalidArgumentException('non-nullable font_type cannot be null'); + } if ((mb_strlen($font_type) < 1)) { throw new \InvalidArgumentException('invalid length for $font_type when calling WTPaymentDesignUpdateParams., must be bigger than or equal to 1.'); @@ -546,6 +660,9 @@ public function getAbbreviation() */ public function setAbbreviation($abbreviation) { + if (is_null($abbreviation)) { + throw new \InvalidArgumentException('non-nullable abbreviation cannot be null'); + } if ((mb_strlen($abbreviation) < 1)) { throw new \InvalidArgumentException('invalid length for $abbreviation when calling WTPaymentDesignUpdateParams., must be bigger than or equal to 1.'); @@ -575,6 +692,9 @@ public function getAcronym() */ public function setAcronym($acronym) { + if (is_null($acronym)) { + throw new \InvalidArgumentException('non-nullable acronym cannot be null'); + } if ((mb_strlen($acronym) < 1)) { throw new \InvalidArgumentException('invalid length for $acronym when calling WTPaymentDesignUpdateParams., must be bigger than or equal to 1.'); @@ -604,6 +724,9 @@ public function getIcon() */ public function setIcon($icon) { + if (is_null($icon)) { + throw new \InvalidArgumentException('non-nullable icon cannot be null'); + } if ((mb_strlen($icon) < 1)) { throw new \InvalidArgumentException('invalid length for $icon when calling WTPaymentDesignUpdateParams., must be bigger than or equal to 1.'); @@ -633,6 +756,9 @@ public function getDesignName() */ public function setDesignName($design_name) { + if (is_null($design_name)) { + throw new \InvalidArgumentException('non-nullable design_name cannot be null'); + } if ((mb_strlen($design_name) < 1)) { throw new \InvalidArgumentException('invalid length for $design_name when calling WTPaymentDesignUpdateParams., must be bigger than or equal to 1.'); @@ -662,6 +788,9 @@ public function getDisplayName() */ public function setDisplayName($display_name) { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } if ((mb_strlen($display_name) < 1)) { throw new \InvalidArgumentException('invalid length for $display_name when calling WTPaymentDesignUpdateParams., must be bigger than or equal to 1.'); @@ -691,6 +820,9 @@ public function getBackgroundImageUrl() */ public function setBackgroundImageUrl($background_image_url) { + if (is_null($background_image_url)) { + throw new \InvalidArgumentException('non-nullable background_image_url cannot be null'); + } $this->container['background_image_url'] = $background_image_url; return $this; @@ -715,6 +847,9 @@ public function getCompanyLogoUrl() */ public function setCompanyLogoUrl($company_logo_url) { + if (is_null($company_logo_url)) { + throw new \InvalidArgumentException('non-nullable company_logo_url cannot be null'); + } $this->container['company_logo_url'] = $company_logo_url; return $this; @@ -726,7 +861,7 @@ public function setCompanyLogoUrl($company_logo_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -738,6 +873,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -751,7 +887,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -767,7 +903,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -779,6 +915,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTPerformanceCreateParams.php b/lib/Model/WTPerformanceCreateParams.php index a5aa6f9..a649a83 100644 --- a/lib/Model/WTPerformanceCreateParams.php +++ b/lib/Model/WTPerformanceCreateParams.php @@ -2,7 +2,7 @@ /** * WTPerformanceCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTPerformanceCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,7 +67,7 @@ class WTPerformanceCreateParams implements ModelInterface, ArrayAccess, \JsonSer 'is_sold_out' => 'bool', 'media_url' => 'string', 'payment_design_id' => 'string', - 'max_comp_tickets' => 'double', + 'max_comp_tickets' => 'float', 'ticket_expiration_date_time' => '\DateTime', 'redemption_instructions' => 'string' ]; @@ -96,6 +94,33 @@ class WTPerformanceCreateParams implements ModelInterface, ArrayAccess, \JsonSer 'redemption_instructions' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'body' => false, + 'start_date_time' => false, + 'price' => false, + 'url' => false, + 'order_number' => false, + 'is_sold_out' => false, + 'media_url' => false, + 'payment_design_id' => false, + 'max_comp_tickets' => false, + 'ticket_expiration_date_time' => false, + 'redemption_instructions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -116,6 +141,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -234,18 +311,36 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['body'] = $data['body'] ?? null; - $this->container['start_date_time'] = $data['start_date_time'] ?? null; - $this->container['price'] = $data['price'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['is_sold_out'] = $data['is_sold_out'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['max_comp_tickets'] = $data['max_comp_tickets'] ?? null; - $this->container['ticket_expiration_date_time'] = $data['ticket_expiration_date_time'] ?? null; - $this->container['redemption_instructions'] = $data['redemption_instructions'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('start_date_time', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('is_sold_out', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('max_comp_tickets', $data ?? [], null); + $this->setIfExists('ticket_expiration_date_time', $data ?? [], null); + $this->setIfExists('redemption_instructions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -336,6 +431,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTPerformanceCreateParams., must be bigger than or equal to 1.'); @@ -365,6 +463,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } if ((mb_strlen($body) < 1)) { throw new \InvalidArgumentException('invalid length for $body when calling WTPerformanceCreateParams., must be bigger than or equal to 1.'); @@ -394,6 +495,9 @@ public function getStartDateTime() */ public function setStartDateTime($start_date_time) { + if (is_null($start_date_time)) { + throw new \InvalidArgumentException('non-nullable start_date_time cannot be null'); + } $this->container['start_date_time'] = $start_date_time; return $this; @@ -418,6 +522,9 @@ public function getPrice() */ public function setPrice($price) { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } $this->container['price'] = $price; @@ -444,6 +551,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } $this->container['url'] = $url; return $this; @@ -468,6 +578,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTPerformanceCreateParams., must be bigger than or equal to 1.'); @@ -497,6 +610,9 @@ public function getIsSoldOut() */ public function setIsSoldOut($is_sold_out) { + if (is_null($is_sold_out)) { + throw new \InvalidArgumentException('non-nullable is_sold_out cannot be null'); + } $this->container['is_sold_out'] = $is_sold_out; return $this; @@ -521,6 +637,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -545,14 +664,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { - if (!is_null($payment_design_id) && (mb_strlen($payment_design_id) > 10)) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } + if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTPerformanceCreateParams., must be smaller than or equal to 10.'); } - if (!is_null($payment_design_id) && (mb_strlen($payment_design_id) < 10)) { + if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTPerformanceCreateParams., must be bigger than or equal to 10.'); } - if (!is_null($payment_design_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling WTPerformanceCreateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling WTPerformanceCreateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -563,7 +685,7 @@ public function setPaymentDesignId($payment_design_id) /** * Gets max_comp_tickets * - * @return double|null + * @return float|null */ public function getMaxCompTickets() { @@ -573,12 +695,15 @@ public function getMaxCompTickets() /** * Sets max_comp_tickets * - * @param double|null $max_comp_tickets max_comp_tickets + * @param float|null $max_comp_tickets max_comp_tickets * * @return self */ public function setMaxCompTickets($max_comp_tickets) { + if (is_null($max_comp_tickets)) { + throw new \InvalidArgumentException('non-nullable max_comp_tickets cannot be null'); + } $this->container['max_comp_tickets'] = $max_comp_tickets; return $this; @@ -603,6 +728,9 @@ public function getTicketExpirationDateTime() */ public function setTicketExpirationDateTime($ticket_expiration_date_time) { + if (is_null($ticket_expiration_date_time)) { + throw new \InvalidArgumentException('non-nullable ticket_expiration_date_time cannot be null'); + } $this->container['ticket_expiration_date_time'] = $ticket_expiration_date_time; return $this; @@ -627,6 +755,9 @@ public function getRedemptionInstructions() */ public function setRedemptionInstructions($redemption_instructions) { + if (is_null($redemption_instructions)) { + throw new \InvalidArgumentException('non-nullable redemption_instructions cannot be null'); + } $this->container['redemption_instructions'] = $redemption_instructions; return $this; @@ -638,7 +769,7 @@ public function setRedemptionInstructions($redemption_instructions) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -650,6 +781,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -663,7 +795,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -679,7 +811,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -691,6 +823,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTPerformanceUpdateParams.php b/lib/Model/WTPerformanceUpdateParams.php index 6d670e8..9c6acb6 100644 --- a/lib/Model/WTPerformanceUpdateParams.php +++ b/lib/Model/WTPerformanceUpdateParams.php @@ -2,7 +2,7 @@ /** * WTPerformanceUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTPerformanceUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -69,7 +67,7 @@ class WTPerformanceUpdateParams implements ModelInterface, ArrayAccess, \JsonSer 'is_sold_out' => 'bool', 'media_url' => 'string', 'payment_design_id' => 'string', - 'max_comp_tickets' => 'double', + 'max_comp_tickets' => 'float', 'ticket_expiration_date_time' => '\DateTime', 'redemption_instructions' => 'string' ]; @@ -96,6 +94,33 @@ class WTPerformanceUpdateParams implements ModelInterface, ArrayAccess, \JsonSer 'redemption_instructions' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'body' => false, + 'start_date_time' => false, + 'price' => false, + 'url' => false, + 'order_number' => false, + 'is_sold_out' => false, + 'media_url' => false, + 'payment_design_id' => false, + 'max_comp_tickets' => false, + 'ticket_expiration_date_time' => false, + 'redemption_instructions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -116,6 +141,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -234,18 +311,36 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['body'] = $data['body'] ?? null; - $this->container['start_date_time'] = $data['start_date_time'] ?? null; - $this->container['price'] = $data['price'] ?? null; - $this->container['url'] = $data['url'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['is_sold_out'] = $data['is_sold_out'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['max_comp_tickets'] = $data['max_comp_tickets'] ?? null; - $this->container['ticket_expiration_date_time'] = $data['ticket_expiration_date_time'] ?? null; - $this->container['redemption_instructions'] = $data['redemption_instructions'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('start_date_time', $data ?? [], null); + $this->setIfExists('price', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('is_sold_out', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('max_comp_tickets', $data ?? [], null); + $this->setIfExists('ticket_expiration_date_time', $data ?? [], null); + $this->setIfExists('redemption_instructions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -336,6 +431,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTPerformanceUpdateParams., must be bigger than or equal to 1.'); @@ -365,6 +463,9 @@ public function getBody() */ public function setBody($body) { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } if ((mb_strlen($body) < 1)) { throw new \InvalidArgumentException('invalid length for $body when calling WTPerformanceUpdateParams., must be bigger than or equal to 1.'); @@ -394,6 +495,9 @@ public function getStartDateTime() */ public function setStartDateTime($start_date_time) { + if (is_null($start_date_time)) { + throw new \InvalidArgumentException('non-nullable start_date_time cannot be null'); + } $this->container['start_date_time'] = $start_date_time; return $this; @@ -418,6 +522,9 @@ public function getPrice() */ public function setPrice($price) { + if (is_null($price)) { + throw new \InvalidArgumentException('non-nullable price cannot be null'); + } $this->container['price'] = $price; @@ -444,6 +551,9 @@ public function getUrl() */ public function setUrl($url) { + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); + } $this->container['url'] = $url; return $this; @@ -468,6 +578,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTPerformanceUpdateParams., must be bigger than or equal to 1.'); @@ -497,6 +610,9 @@ public function getIsSoldOut() */ public function setIsSoldOut($is_sold_out) { + if (is_null($is_sold_out)) { + throw new \InvalidArgumentException('non-nullable is_sold_out cannot be null'); + } $this->container['is_sold_out'] = $is_sold_out; return $this; @@ -521,6 +637,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -545,14 +664,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { - if (!is_null($payment_design_id) && (mb_strlen($payment_design_id) > 10)) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } + if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTPerformanceUpdateParams., must be smaller than or equal to 10.'); } - if (!is_null($payment_design_id) && (mb_strlen($payment_design_id) < 10)) { + if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTPerformanceUpdateParams., must be bigger than or equal to 10.'); } - if (!is_null($payment_design_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling WTPerformanceUpdateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling WTPerformanceUpdateParams., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -563,7 +685,7 @@ public function setPaymentDesignId($payment_design_id) /** * Gets max_comp_tickets * - * @return double|null + * @return float|null */ public function getMaxCompTickets() { @@ -573,12 +695,15 @@ public function getMaxCompTickets() /** * Sets max_comp_tickets * - * @param double|null $max_comp_tickets max_comp_tickets + * @param float|null $max_comp_tickets max_comp_tickets * * @return self */ public function setMaxCompTickets($max_comp_tickets) { + if (is_null($max_comp_tickets)) { + throw new \InvalidArgumentException('non-nullable max_comp_tickets cannot be null'); + } $this->container['max_comp_tickets'] = $max_comp_tickets; return $this; @@ -603,6 +728,9 @@ public function getTicketExpirationDateTime() */ public function setTicketExpirationDateTime($ticket_expiration_date_time) { + if (is_null($ticket_expiration_date_time)) { + throw new \InvalidArgumentException('non-nullable ticket_expiration_date_time cannot be null'); + } $this->container['ticket_expiration_date_time'] = $ticket_expiration_date_time; return $this; @@ -627,6 +755,9 @@ public function getRedemptionInstructions() */ public function setRedemptionInstructions($redemption_instructions) { + if (is_null($redemption_instructions)) { + throw new \InvalidArgumentException('non-nullable redemption_instructions cannot be null'); + } $this->container['redemption_instructions'] = $redemption_instructions; return $this; @@ -638,7 +769,7 @@ public function setRedemptionInstructions($redemption_instructions) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -650,6 +781,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -663,7 +795,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -679,7 +811,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -691,6 +823,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTPosMachine.php b/lib/Model/WTPosMachine.php index dc41fad..9f77295 100644 --- a/lib/Model/WTPosMachine.php +++ b/lib/Model/WTPosMachine.php @@ -2,7 +2,7 @@ /** * WTPosMachine * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTPosMachine implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -92,6 +90,31 @@ class WTPosMachine implements ModelInterface, ArrayAccess, \JsonSerializable 'is_active' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'register_id' => false, + 'register_name' => false, + 'outlet_name' => false, + 'outlet_number' => false, + 'profit_center' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'merchant_id' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['register_name'] = $data['register_name'] ?? null; - $this->container['outlet_name'] = $data['outlet_name'] ?? null; - $this->container['outlet_number'] = $data['outlet_number'] ?? null; - $this->container['profit_center'] = $data['profit_center'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('register_name', $data ?? [], null); + $this->setIfExists('outlet_name', $data ?? [], null); + $this->setIfExists('outlet_number', $data ?? [], null); + $this->setIfExists('profit_center', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -349,6 +442,9 @@ public function getRegisterId() */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } if ((mb_strlen($register_id) < 1)) { throw new \InvalidArgumentException('invalid length for $register_id when calling WTPosMachine., must be bigger than or equal to 1.'); @@ -378,6 +474,9 @@ public function getRegisterName() */ public function setRegisterName($register_name) { + if (is_null($register_name)) { + throw new \InvalidArgumentException('non-nullable register_name cannot be null'); + } if ((mb_strlen($register_name) < 1)) { throw new \InvalidArgumentException('invalid length for $register_name when calling WTPosMachine., must be bigger than or equal to 1.'); @@ -407,6 +506,9 @@ public function getOutletName() */ public function setOutletName($outlet_name) { + if (is_null($outlet_name)) { + throw new \InvalidArgumentException('non-nullable outlet_name cannot be null'); + } if ((mb_strlen($outlet_name) < 1)) { throw new \InvalidArgumentException('invalid length for $outlet_name when calling WTPosMachine., must be bigger than or equal to 1.'); @@ -436,6 +538,9 @@ public function getOutletNumber() */ public function setOutletNumber($outlet_number) { + if (is_null($outlet_number)) { + throw new \InvalidArgumentException('non-nullable outlet_number cannot be null'); + } $this->container['outlet_number'] = $outlet_number; return $this; @@ -460,6 +565,9 @@ public function getProfitCenter() */ public function setProfitCenter($profit_center) { + if (is_null($profit_center)) { + throw new \InvalidArgumentException('non-nullable profit_center cannot be null'); + } if ((mb_strlen($profit_center) < 1)) { throw new \InvalidArgumentException('invalid length for $profit_center when calling WTPosMachine., must be bigger than or equal to 1.'); @@ -489,14 +597,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling WTPosMachine., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling WTPosMachine., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling WTPosMachine., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling WTPosMachine., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -523,6 +634,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -547,6 +661,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -571,14 +688,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTPosMachine., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTPosMachine., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTPosMachine., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTPosMachine., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -605,6 +725,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -616,7 +739,7 @@ public function setIsActive($is_active) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -628,6 +751,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -641,7 +765,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -657,7 +781,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -669,6 +793,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTPosMachineCreateParams.php b/lib/Model/WTPosMachineCreateParams.php index a2a6056..965d25c 100644 --- a/lib/Model/WTPosMachineCreateParams.php +++ b/lib/Model/WTPosMachineCreateParams.php @@ -2,7 +2,7 @@ /** * WTPosMachineCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTPosMachineCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -82,6 +80,26 @@ class WTPosMachineCreateParams implements ModelInterface, ArrayAccess, \JsonSeri 'profit_center' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'register_id' => false, + 'register_name' => false, + 'outlet_name' => false, + 'outlet_number' => false, + 'profit_center' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['register_name'] = $data['register_name'] ?? null; - $this->container['outlet_name'] = $data['outlet_name'] ?? null; - $this->container['outlet_number'] = $data['outlet_number'] ?? null; - $this->container['profit_center'] = $data['profit_center'] ?? null; + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('register_name', $data ?? [], null); + $this->setIfExists('outlet_name', $data ?? [], null); + $this->setIfExists('outlet_number', $data ?? [], null); + $this->setIfExists('profit_center', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -280,6 +368,9 @@ public function getRegisterId() */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } if ((mb_strlen($register_id) < 1)) { throw new \InvalidArgumentException('invalid length for $register_id when calling WTPosMachineCreateParams., must be bigger than or equal to 1.'); @@ -309,6 +400,9 @@ public function getRegisterName() */ public function setRegisterName($register_name) { + if (is_null($register_name)) { + throw new \InvalidArgumentException('non-nullable register_name cannot be null'); + } if ((mb_strlen($register_name) < 1)) { throw new \InvalidArgumentException('invalid length for $register_name when calling WTPosMachineCreateParams., must be bigger than or equal to 1.'); @@ -338,6 +432,9 @@ public function getOutletName() */ public function setOutletName($outlet_name) { + if (is_null($outlet_name)) { + throw new \InvalidArgumentException('non-nullable outlet_name cannot be null'); + } if ((mb_strlen($outlet_name) < 1)) { throw new \InvalidArgumentException('invalid length for $outlet_name when calling WTPosMachineCreateParams., must be bigger than or equal to 1.'); @@ -367,6 +464,9 @@ public function getOutletNumber() */ public function setOutletNumber($outlet_number) { + if (is_null($outlet_number)) { + throw new \InvalidArgumentException('non-nullable outlet_number cannot be null'); + } $this->container['outlet_number'] = $outlet_number; return $this; @@ -391,6 +491,9 @@ public function getProfitCenter() */ public function setProfitCenter($profit_center) { + if (is_null($profit_center)) { + throw new \InvalidArgumentException('non-nullable profit_center cannot be null'); + } if ((mb_strlen($profit_center) < 1)) { throw new \InvalidArgumentException('invalid length for $profit_center when calling WTPosMachineCreateParams., must be bigger than or equal to 1.'); @@ -407,7 +510,7 @@ public function setProfitCenter($profit_center) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -419,6 +522,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -432,7 +536,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -448,7 +552,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -460,6 +564,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTPosMachineUpdateParams.php b/lib/Model/WTPosMachineUpdateParams.php index d1715e8..4d48549 100644 --- a/lib/Model/WTPosMachineUpdateParams.php +++ b/lib/Model/WTPosMachineUpdateParams.php @@ -2,7 +2,7 @@ /** * WTPosMachineUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTPosMachineUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -82,6 +80,26 @@ class WTPosMachineUpdateParams implements ModelInterface, ArrayAccess, \JsonSeri 'profit_center' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'register_id' => false, + 'register_name' => false, + 'outlet_name' => false, + 'outlet_number' => false, + 'profit_center' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['register_name'] = $data['register_name'] ?? null; - $this->container['outlet_name'] = $data['outlet_name'] ?? null; - $this->container['outlet_number'] = $data['outlet_number'] ?? null; - $this->container['profit_center'] = $data['profit_center'] ?? null; + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('register_name', $data ?? [], null); + $this->setIfExists('outlet_name', $data ?? [], null); + $this->setIfExists('outlet_number', $data ?? [], null); + $this->setIfExists('profit_center', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -280,6 +368,9 @@ public function getRegisterId() */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } if ((mb_strlen($register_id) < 1)) { throw new \InvalidArgumentException('invalid length for $register_id when calling WTPosMachineUpdateParams., must be bigger than or equal to 1.'); @@ -309,6 +400,9 @@ public function getRegisterName() */ public function setRegisterName($register_name) { + if (is_null($register_name)) { + throw new \InvalidArgumentException('non-nullable register_name cannot be null'); + } if ((mb_strlen($register_name) < 1)) { throw new \InvalidArgumentException('invalid length for $register_name when calling WTPosMachineUpdateParams., must be bigger than or equal to 1.'); @@ -338,6 +432,9 @@ public function getOutletName() */ public function setOutletName($outlet_name) { + if (is_null($outlet_name)) { + throw new \InvalidArgumentException('non-nullable outlet_name cannot be null'); + } if ((mb_strlen($outlet_name) < 1)) { throw new \InvalidArgumentException('invalid length for $outlet_name when calling WTPosMachineUpdateParams., must be bigger than or equal to 1.'); @@ -367,6 +464,9 @@ public function getOutletNumber() */ public function setOutletNumber($outlet_number) { + if (is_null($outlet_number)) { + throw new \InvalidArgumentException('non-nullable outlet_number cannot be null'); + } $this->container['outlet_number'] = $outlet_number; return $this; @@ -391,6 +491,9 @@ public function getProfitCenter() */ public function setProfitCenter($profit_center) { + if (is_null($profit_center)) { + throw new \InvalidArgumentException('non-nullable profit_center cannot be null'); + } if ((mb_strlen($profit_center) < 1)) { throw new \InvalidArgumentException('invalid length for $profit_center when calling WTPosMachineUpdateParams., must be bigger than or equal to 1.'); @@ -407,7 +510,7 @@ public function setProfitCenter($profit_center) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -419,6 +522,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -432,7 +536,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -448,7 +552,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -460,6 +564,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTProductCreateParams.php b/lib/Model/WTProductCreateParams.php index 3478b05..e22bf61 100644 --- a/lib/Model/WTProductCreateParams.php +++ b/lib/Model/WTProductCreateParams.php @@ -2,7 +2,7 @@ /** * WTProductCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTProductCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTProductCreateParams implements ModelInterface, ArrayAccess, \JsonSeriali 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTProductCreateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTProductCreateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTProductCreateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTProductUpdateParams.php b/lib/Model/WTProductUpdateParams.php index 57d0b0a..8a2f95f 100644 --- a/lib/Model/WTProductUpdateParams.php +++ b/lib/Model/WTProductUpdateParams.php @@ -2,7 +2,7 @@ /** * WTProductUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTProductUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTProductUpdateParams implements ModelInterface, ArrayAccess, \JsonSeriali 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTProductUpdateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTProductUpdateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTProductUpdateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTPromoCodeCreateParams.php b/lib/Model/WTPromoCodeCreateParams.php index e9e05f8..0102314 100644 --- a/lib/Model/WTPromoCodeCreateParams.php +++ b/lib/Model/WTPromoCodeCreateParams.php @@ -2,7 +2,7 @@ /** * WTPromoCodeCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTPromoCodeCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -88,6 +86,29 @@ class WTPromoCodeCreateParams implements ModelInterface, ArrayAccess, \JsonSeria 'expiration_date' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'promo_code' => false, + 'display_value' => false, + 'order_number' => false, + 'media_url' => false, + 'start_date' => false, + 'expiration_date' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -214,14 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['promo_code'] = $data['promo_code'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['start_date'] = $data['start_date'] ?? null; - $this->container['expiration_date'] = $data['expiration_date'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('promo_code', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -308,6 +399,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTPromoCodeCreateParams., must be bigger than or equal to 1.'); @@ -337,6 +431,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTPromoCodeCreateParams., must be bigger than or equal to 1.'); @@ -366,6 +463,9 @@ public function getPromoCode() */ public function setPromoCode($promo_code) { + if (is_null($promo_code)) { + throw new \InvalidArgumentException('non-nullable promo_code cannot be null'); + } if ((mb_strlen($promo_code) < 1)) { throw new \InvalidArgumentException('invalid length for $promo_code when calling WTPromoCodeCreateParams., must be bigger than or equal to 1.'); @@ -395,6 +495,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } if ((mb_strlen($display_value) < 1)) { throw new \InvalidArgumentException('invalid length for $display_value when calling WTPromoCodeCreateParams., must be bigger than or equal to 1.'); @@ -424,6 +527,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTPromoCodeCreateParams., must be bigger than or equal to 1.'); @@ -453,6 +559,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -477,6 +586,9 @@ public function getStartDate() */ public function setStartDate($start_date) { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } $this->container['start_date'] = $start_date; return $this; @@ -501,6 +613,9 @@ public function getExpirationDate() */ public function setExpirationDate($expiration_date) { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } $this->container['expiration_date'] = $expiration_date; return $this; @@ -512,7 +627,7 @@ public function setExpirationDate($expiration_date) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -524,6 +639,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -537,7 +653,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -553,7 +669,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -565,6 +681,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTPromoCodeUpdateParams.php b/lib/Model/WTPromoCodeUpdateParams.php index d7b6b03..2e3c0ab 100644 --- a/lib/Model/WTPromoCodeUpdateParams.php +++ b/lib/Model/WTPromoCodeUpdateParams.php @@ -2,7 +2,7 @@ /** * WTPromoCodeUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTPromoCodeUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -88,6 +86,29 @@ class WTPromoCodeUpdateParams implements ModelInterface, ArrayAccess, \JsonSeria 'expiration_date' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'promo_code' => false, + 'display_value' => false, + 'order_number' => false, + 'media_url' => false, + 'start_date' => false, + 'expiration_date' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -108,6 +129,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -214,14 +287,32 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['promo_code'] = $data['promo_code'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['start_date'] = $data['start_date'] ?? null; - $this->container['expiration_date'] = $data['expiration_date'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('promo_code', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -308,6 +399,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTPromoCodeUpdateParams., must be bigger than or equal to 1.'); @@ -337,6 +431,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTPromoCodeUpdateParams., must be bigger than or equal to 1.'); @@ -366,6 +463,9 @@ public function getPromoCode() */ public function setPromoCode($promo_code) { + if (is_null($promo_code)) { + throw new \InvalidArgumentException('non-nullable promo_code cannot be null'); + } if ((mb_strlen($promo_code) < 1)) { throw new \InvalidArgumentException('invalid length for $promo_code when calling WTPromoCodeUpdateParams., must be bigger than or equal to 1.'); @@ -395,6 +495,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } if ((mb_strlen($display_value) < 1)) { throw new \InvalidArgumentException('invalid length for $display_value when calling WTPromoCodeUpdateParams., must be bigger than or equal to 1.'); @@ -424,6 +527,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTPromoCodeUpdateParams., must be bigger than or equal to 1.'); @@ -453,6 +559,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -477,6 +586,9 @@ public function getStartDate() */ public function setStartDate($start_date) { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } $this->container['start_date'] = $start_date; return $this; @@ -501,6 +613,9 @@ public function getExpirationDate() */ public function setExpirationDate($expiration_date) { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } $this->container['expiration_date'] = $expiration_date; return $this; @@ -512,7 +627,7 @@ public function setExpirationDate($expiration_date) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -524,6 +639,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -537,7 +653,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -553,7 +669,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -565,6 +681,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTQRCodeDesign.php b/lib/Model/WTQRCodeDesign.php index 1a39e59..7f8ed34 100644 --- a/lib/Model/WTQRCodeDesign.php +++ b/lib/Model/WTQRCodeDesign.php @@ -2,7 +2,7 @@ /** * WTQRCodeDesign * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTQRCodeDesign implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,6 +61,7 @@ class WTQRCodeDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => 'string', 'size' => 'int', 'margin' => 'int', + 'is_margin_white' => 'bool', 'corner_radius' => 'int', 'color_dark_hex' => 'string', 'color_light_hex' => 'string', @@ -70,7 +69,7 @@ class WTQRCodeDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'logo_image_url' => 'string', 'background_image_url' => 'string', 'animated_gif_background_url' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -88,6 +87,7 @@ class WTQRCodeDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => null, 'size' => 'int32', 'margin' => 'int32', + 'is_margin_white' => null, 'corner_radius' => 'int32', 'color_dark_hex' => null, 'color_light_hex' => null, @@ -102,6 +102,37 @@ class WTQRCodeDesign implements ModelInterface, ArrayAccess, \JsonSerializable 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'size' => false, + 'margin' => false, + 'is_margin_white' => false, + 'corner_radius' => false, + 'color_dark_hex' => false, + 'color_light_hex' => false, + 'background_dimming_hex' => false, + 'logo_image_url' => false, + 'background_image_url' => false, + 'animated_gif_background_url' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -122,6 +153,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -132,6 +215,7 @@ public static function openAPIFormats() 'name' => 'name', 'size' => 'size', 'margin' => 'margin', + 'is_margin_white' => 'isMarginWhite', 'corner_radius' => 'cornerRadius', 'color_dark_hex' => 'colorDarkHex', 'color_light_hex' => 'colorLightHex', @@ -155,6 +239,7 @@ public static function openAPIFormats() 'name' => 'setName', 'size' => 'setSize', 'margin' => 'setMargin', + 'is_margin_white' => 'setIsMarginWhite', 'corner_radius' => 'setCornerRadius', 'color_dark_hex' => 'setColorDarkHex', 'color_light_hex' => 'setColorLightHex', @@ -178,6 +263,7 @@ public static function openAPIFormats() 'name' => 'getName', 'size' => 'getSize', 'margin' => 'getMargin', + 'is_margin_white' => 'getIsMarginWhite', 'corner_radius' => 'getCornerRadius', 'color_dark_hex' => 'getColorDarkHex', 'color_light_hex' => 'getColorLightHex', @@ -249,21 +335,40 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['size'] = $data['size'] ?? null; - $this->container['margin'] = $data['margin'] ?? null; - $this->container['corner_radius'] = $data['corner_radius'] ?? null; - $this->container['color_dark_hex'] = $data['color_dark_hex'] ?? null; - $this->container['color_light_hex'] = $data['color_light_hex'] ?? null; - $this->container['background_dimming_hex'] = $data['background_dimming_hex'] ?? null; - $this->container['logo_image_url'] = $data['logo_image_url'] ?? null; - $this->container['background_image_url'] = $data['background_image_url'] ?? null; - $this->container['animated_gif_background_url'] = $data['animated_gif_background_url'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('margin', $data ?? [], null); + $this->setIfExists('is_margin_white', $data ?? [], null); + $this->setIfExists('corner_radius', $data ?? [], null); + $this->setIfExists('color_dark_hex', $data ?? [], null); + $this->setIfExists('color_light_hex', $data ?? [], null); + $this->setIfExists('background_dimming_hex', $data ?? [], null); + $this->setIfExists('logo_image_url', $data ?? [], null); + $this->setIfExists('background_image_url', $data ?? [], null); + $this->setIfExists('animated_gif_background_url', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -296,18 +401,21 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'margin', must be bigger than or equal to 1."; } + if ($this->container['is_margin_white'] === null) { + $invalidProperties[] = "'is_margin_white' can't be null"; + } if ($this->container['corner_radius'] === null) { $invalidProperties[] = "'corner_radius' can't be null"; } - if (($this->container['corner_radius'] < 1)) { - $invalidProperties[] = "invalid value for 'corner_radius', must be bigger than or equal to 1."; + if (($this->container['corner_radius'] < 0)) { + $invalidProperties[] = "invalid value for 'corner_radius', must be bigger than or equal to 0."; } if ($this->container['color_dark_hex'] === null) { $invalidProperties[] = "'color_dark_hex' can't be null"; } - if ((mb_strlen($this->container['color_dark_hex']) < 1)) { - $invalidProperties[] = "invalid value for 'color_dark_hex', the character length must be bigger than or equal to 1."; + if ((mb_strlen($this->container['color_dark_hex']) < 0)) { + $invalidProperties[] = "invalid value for 'color_dark_hex', the character length must be bigger than or equal to 0."; } if ($this->container['color_light_hex'] === null) { @@ -324,27 +432,6 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'background_dimming_hex', the character length must be bigger than or equal to 1."; } - if ($this->container['logo_image_url'] === null) { - $invalidProperties[] = "'logo_image_url' can't be null"; - } - if ((mb_strlen($this->container['logo_image_url']) < 1)) { - $invalidProperties[] = "invalid value for 'logo_image_url', the character length must be bigger than or equal to 1."; - } - - if ($this->container['background_image_url'] === null) { - $invalidProperties[] = "'background_image_url' can't be null"; - } - if ((mb_strlen($this->container['background_image_url']) < 1)) { - $invalidProperties[] = "invalid value for 'background_image_url', the character length must be bigger than or equal to 1."; - } - - if ($this->container['animated_gif_background_url'] === null) { - $invalidProperties[] = "'animated_gif_background_url' can't be null"; - } - if ((mb_strlen($this->container['animated_gif_background_url']) < 1)) { - $invalidProperties[] = "invalid value for 'animated_gif_background_url', the character length must be bigger than or equal to 1."; - } - if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } @@ -406,6 +493,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } if ((mb_strlen($name) < 1)) { throw new \InvalidArgumentException('invalid length for $name when calling WTQRCodeDesign., must be bigger than or equal to 1.'); @@ -435,6 +525,9 @@ public function getSize() */ public function setSize($size) { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } if (($size < 1)) { throw new \InvalidArgumentException('invalid value for $size when calling WTQRCodeDesign., must be bigger than or equal to 1.'); @@ -464,6 +557,9 @@ public function getMargin() */ public function setMargin($margin) { + if (is_null($margin)) { + throw new \InvalidArgumentException('non-nullable margin cannot be null'); + } if (($margin < 1)) { throw new \InvalidArgumentException('invalid value for $margin when calling WTQRCodeDesign., must be bigger than or equal to 1.'); @@ -474,6 +570,33 @@ public function setMargin($margin) return $this; } + /** + * Gets is_margin_white + * + * @return bool + */ + public function getIsMarginWhite() + { + return $this->container['is_margin_white']; + } + + /** + * Sets is_margin_white + * + * @param bool $is_margin_white is_margin_white + * + * @return self + */ + public function setIsMarginWhite($is_margin_white) + { + if (is_null($is_margin_white)) { + throw new \InvalidArgumentException('non-nullable is_margin_white cannot be null'); + } + $this->container['is_margin_white'] = $is_margin_white; + + return $this; + } + /** * Gets corner_radius * @@ -493,9 +616,12 @@ public function getCornerRadius() */ public function setCornerRadius($corner_radius) { + if (is_null($corner_radius)) { + throw new \InvalidArgumentException('non-nullable corner_radius cannot be null'); + } - if (($corner_radius < 1)) { - throw new \InvalidArgumentException('invalid value for $corner_radius when calling WTQRCodeDesign., must be bigger than or equal to 1.'); + if (($corner_radius < 0)) { + throw new \InvalidArgumentException('invalid value for $corner_radius when calling WTQRCodeDesign., must be bigger than or equal to 0.'); } $this->container['corner_radius'] = $corner_radius; @@ -522,9 +648,12 @@ public function getColorDarkHex() */ public function setColorDarkHex($color_dark_hex) { + if (is_null($color_dark_hex)) { + throw new \InvalidArgumentException('non-nullable color_dark_hex cannot be null'); + } - if ((mb_strlen($color_dark_hex) < 1)) { - throw new \InvalidArgumentException('invalid length for $color_dark_hex when calling WTQRCodeDesign., must be bigger than or equal to 1.'); + if ((mb_strlen($color_dark_hex) < 0)) { + throw new \InvalidArgumentException('invalid length for $color_dark_hex when calling WTQRCodeDesign., must be bigger than or equal to 0.'); } $this->container['color_dark_hex'] = $color_dark_hex; @@ -551,6 +680,9 @@ public function getColorLightHex() */ public function setColorLightHex($color_light_hex) { + if (is_null($color_light_hex)) { + throw new \InvalidArgumentException('non-nullable color_light_hex cannot be null'); + } if ((mb_strlen($color_light_hex) < 1)) { throw new \InvalidArgumentException('invalid length for $color_light_hex when calling WTQRCodeDesign., must be bigger than or equal to 1.'); @@ -580,6 +712,9 @@ public function getBackgroundDimmingHex() */ public function setBackgroundDimmingHex($background_dimming_hex) { + if (is_null($background_dimming_hex)) { + throw new \InvalidArgumentException('non-nullable background_dimming_hex cannot be null'); + } if ((mb_strlen($background_dimming_hex) < 1)) { throw new \InvalidArgumentException('invalid length for $background_dimming_hex when calling WTQRCodeDesign., must be bigger than or equal to 1.'); @@ -593,7 +728,7 @@ public function setBackgroundDimmingHex($background_dimming_hex) /** * Gets logo_image_url * - * @return string + * @return string|null */ public function getLogoImageUrl() { @@ -603,17 +738,15 @@ public function getLogoImageUrl() /** * Sets logo_image_url * - * @param string $logo_image_url logo_image_url + * @param string|null $logo_image_url logo_image_url * * @return self */ public function setLogoImageUrl($logo_image_url) { - - if ((mb_strlen($logo_image_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $logo_image_url when calling WTQRCodeDesign., must be bigger than or equal to 1.'); + if (is_null($logo_image_url)) { + throw new \InvalidArgumentException('non-nullable logo_image_url cannot be null'); } - $this->container['logo_image_url'] = $logo_image_url; return $this; @@ -622,7 +755,7 @@ public function setLogoImageUrl($logo_image_url) /** * Gets background_image_url * - * @return string + * @return string|null */ public function getBackgroundImageUrl() { @@ -632,17 +765,15 @@ public function getBackgroundImageUrl() /** * Sets background_image_url * - * @param string $background_image_url background_image_url + * @param string|null $background_image_url background_image_url * * @return self */ public function setBackgroundImageUrl($background_image_url) { - - if ((mb_strlen($background_image_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $background_image_url when calling WTQRCodeDesign., must be bigger than or equal to 1.'); + if (is_null($background_image_url)) { + throw new \InvalidArgumentException('non-nullable background_image_url cannot be null'); } - $this->container['background_image_url'] = $background_image_url; return $this; @@ -651,7 +782,7 @@ public function setBackgroundImageUrl($background_image_url) /** * Gets animated_gif_background_url * - * @return string + * @return string|null */ public function getAnimatedGifBackgroundUrl() { @@ -661,17 +792,15 @@ public function getAnimatedGifBackgroundUrl() /** * Sets animated_gif_background_url * - * @param string $animated_gif_background_url animated_gif_background_url + * @param string|null $animated_gif_background_url animated_gif_background_url * * @return self */ public function setAnimatedGifBackgroundUrl($animated_gif_background_url) { - - if ((mb_strlen($animated_gif_background_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $animated_gif_background_url when calling WTQRCodeDesign., must be bigger than or equal to 1.'); + if (is_null($animated_gif_background_url)) { + throw new \InvalidArgumentException('non-nullable animated_gif_background_url cannot be null'); } - $this->container['animated_gif_background_url'] = $animated_gif_background_url; return $this; @@ -680,7 +809,7 @@ public function setAnimatedGifBackgroundUrl($animated_gif_background_url) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -690,12 +819,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -720,6 +852,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -744,6 +879,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -768,6 +906,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -792,14 +933,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTQRCodeDesign., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTQRCodeDesign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTQRCodeDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTQRCodeDesign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -813,7 +957,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -825,6 +969,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -838,7 +983,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -854,7 +999,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -866,6 +1011,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTQRCodeDesignCreateParams.php b/lib/Model/WTQRCodeDesignCreateParams.php index e602eff..6114bb5 100644 --- a/lib/Model/WTQRCodeDesignCreateParams.php +++ b/lib/Model/WTQRCodeDesignCreateParams.php @@ -2,7 +2,7 @@ /** * WTQRCodeDesignCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTQRCodeDesignCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,6 +61,7 @@ class WTQRCodeDesignCreateParams implements ModelInterface, ArrayAccess, \JsonSe 'name' => 'string', 'size' => 'int', 'margin' => 'int', + 'is_margin_white' => 'bool', 'corner_radius' => 'int', 'color_dark_hex' => 'string', 'color_light_hex' => 'string', @@ -83,6 +82,7 @@ class WTQRCodeDesignCreateParams implements ModelInterface, ArrayAccess, \JsonSe 'name' => null, 'size' => 'int32', 'margin' => 'int32', + 'is_margin_white' => null, 'corner_radius' => 'int32', 'color_dark_hex' => null, 'color_light_hex' => null, @@ -92,6 +92,32 @@ class WTQRCodeDesignCreateParams implements ModelInterface, ArrayAccess, \JsonSe 'animated_gif_background_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'size' => false, + 'margin' => false, + 'is_margin_white' => false, + 'corner_radius' => false, + 'color_dark_hex' => false, + 'color_light_hex' => false, + 'background_dimming_hex' => false, + 'logo_image_url' => false, + 'background_image_url' => false, + 'animated_gif_background_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -122,6 +200,7 @@ public static function openAPIFormats() 'name' => 'name', 'size' => 'size', 'margin' => 'margin', + 'is_margin_white' => 'isMarginWhite', 'corner_radius' => 'cornerRadius', 'color_dark_hex' => 'colorDarkHex', 'color_light_hex' => 'colorLightHex', @@ -140,6 +219,7 @@ public static function openAPIFormats() 'name' => 'setName', 'size' => 'setSize', 'margin' => 'setMargin', + 'is_margin_white' => 'setIsMarginWhite', 'corner_radius' => 'setCornerRadius', 'color_dark_hex' => 'setColorDarkHex', 'color_light_hex' => 'setColorLightHex', @@ -158,6 +238,7 @@ public static function openAPIFormats() 'name' => 'getName', 'size' => 'getSize', 'margin' => 'getMargin', + 'is_margin_white' => 'getIsMarginWhite', 'corner_radius' => 'getCornerRadius', 'color_dark_hex' => 'getColorDarkHex', 'color_light_hex' => 'getColorLightHex', @@ -224,16 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['size'] = $data['size'] ?? null; - $this->container['margin'] = $data['margin'] ?? null; - $this->container['corner_radius'] = $data['corner_radius'] ?? null; - $this->container['color_dark_hex'] = $data['color_dark_hex'] ?? null; - $this->container['color_light_hex'] = $data['color_light_hex'] ?? null; - $this->container['background_dimming_hex'] = $data['background_dimming_hex'] ?? null; - $this->container['logo_image_url'] = $data['logo_image_url'] ?? null; - $this->container['background_image_url'] = $data['background_image_url'] ?? null; - $this->container['animated_gif_background_url'] = $data['animated_gif_background_url'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('margin', $data ?? [], null); + $this->setIfExists('is_margin_white', $data ?? [], null); + $this->setIfExists('corner_radius', $data ?? [], null); + $this->setIfExists('color_dark_hex', $data ?? [], null); + $this->setIfExists('color_light_hex', $data ?? [], null); + $this->setIfExists('background_dimming_hex', $data ?? [], null); + $this->setIfExists('logo_image_url', $data ?? [], null); + $this->setIfExists('background_image_url', $data ?? [], null); + $this->setIfExists('animated_gif_background_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -266,18 +366,21 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'margin', must be bigger than or equal to 1."; } + if ($this->container['is_margin_white'] === null) { + $invalidProperties[] = "'is_margin_white' can't be null"; + } if ($this->container['corner_radius'] === null) { $invalidProperties[] = "'corner_radius' can't be null"; } - if (($this->container['corner_radius'] < 1)) { - $invalidProperties[] = "invalid value for 'corner_radius', must be bigger than or equal to 1."; + if (($this->container['corner_radius'] < 0)) { + $invalidProperties[] = "invalid value for 'corner_radius', must be bigger than or equal to 0."; } if ($this->container['color_dark_hex'] === null) { $invalidProperties[] = "'color_dark_hex' can't be null"; } - if ((mb_strlen($this->container['color_dark_hex']) < 1)) { - $invalidProperties[] = "invalid value for 'color_dark_hex', the character length must be bigger than or equal to 1."; + if ((mb_strlen($this->container['color_dark_hex']) < 0)) { + $invalidProperties[] = "invalid value for 'color_dark_hex', the character length must be bigger than or equal to 0."; } if ($this->container['color_light_hex'] === null) { @@ -294,27 +397,6 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'background_dimming_hex', the character length must be bigger than or equal to 1."; } - if ($this->container['logo_image_url'] === null) { - $invalidProperties[] = "'logo_image_url' can't be null"; - } - if ((mb_strlen($this->container['logo_image_url']) < 1)) { - $invalidProperties[] = "invalid value for 'logo_image_url', the character length must be bigger than or equal to 1."; - } - - if ($this->container['background_image_url'] === null) { - $invalidProperties[] = "'background_image_url' can't be null"; - } - if ((mb_strlen($this->container['background_image_url']) < 1)) { - $invalidProperties[] = "invalid value for 'background_image_url', the character length must be bigger than or equal to 1."; - } - - if ($this->container['animated_gif_background_url'] === null) { - $invalidProperties[] = "'animated_gif_background_url' can't be null"; - } - if ((mb_strlen($this->container['animated_gif_background_url']) < 1)) { - $invalidProperties[] = "invalid value for 'animated_gif_background_url', the character length must be bigger than or equal to 1."; - } - return $invalidProperties; } @@ -349,6 +431,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } if ((mb_strlen($name) < 1)) { throw new \InvalidArgumentException('invalid length for $name when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 1.'); @@ -378,6 +463,9 @@ public function getSize() */ public function setSize($size) { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } if (($size < 1)) { throw new \InvalidArgumentException('invalid value for $size when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 1.'); @@ -407,6 +495,9 @@ public function getMargin() */ public function setMargin($margin) { + if (is_null($margin)) { + throw new \InvalidArgumentException('non-nullable margin cannot be null'); + } if (($margin < 1)) { throw new \InvalidArgumentException('invalid value for $margin when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 1.'); @@ -417,6 +508,33 @@ public function setMargin($margin) return $this; } + /** + * Gets is_margin_white + * + * @return bool + */ + public function getIsMarginWhite() + { + return $this->container['is_margin_white']; + } + + /** + * Sets is_margin_white + * + * @param bool $is_margin_white is_margin_white + * + * @return self + */ + public function setIsMarginWhite($is_margin_white) + { + if (is_null($is_margin_white)) { + throw new \InvalidArgumentException('non-nullable is_margin_white cannot be null'); + } + $this->container['is_margin_white'] = $is_margin_white; + + return $this; + } + /** * Gets corner_radius * @@ -436,9 +554,12 @@ public function getCornerRadius() */ public function setCornerRadius($corner_radius) { + if (is_null($corner_radius)) { + throw new \InvalidArgumentException('non-nullable corner_radius cannot be null'); + } - if (($corner_radius < 1)) { - throw new \InvalidArgumentException('invalid value for $corner_radius when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 1.'); + if (($corner_radius < 0)) { + throw new \InvalidArgumentException('invalid value for $corner_radius when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 0.'); } $this->container['corner_radius'] = $corner_radius; @@ -465,9 +586,12 @@ public function getColorDarkHex() */ public function setColorDarkHex($color_dark_hex) { + if (is_null($color_dark_hex)) { + throw new \InvalidArgumentException('non-nullable color_dark_hex cannot be null'); + } - if ((mb_strlen($color_dark_hex) < 1)) { - throw new \InvalidArgumentException('invalid length for $color_dark_hex when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 1.'); + if ((mb_strlen($color_dark_hex) < 0)) { + throw new \InvalidArgumentException('invalid length for $color_dark_hex when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 0.'); } $this->container['color_dark_hex'] = $color_dark_hex; @@ -494,6 +618,9 @@ public function getColorLightHex() */ public function setColorLightHex($color_light_hex) { + if (is_null($color_light_hex)) { + throw new \InvalidArgumentException('non-nullable color_light_hex cannot be null'); + } if ((mb_strlen($color_light_hex) < 1)) { throw new \InvalidArgumentException('invalid length for $color_light_hex when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 1.'); @@ -523,6 +650,9 @@ public function getBackgroundDimmingHex() */ public function setBackgroundDimmingHex($background_dimming_hex) { + if (is_null($background_dimming_hex)) { + throw new \InvalidArgumentException('non-nullable background_dimming_hex cannot be null'); + } if ((mb_strlen($background_dimming_hex) < 1)) { throw new \InvalidArgumentException('invalid length for $background_dimming_hex when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 1.'); @@ -536,7 +666,7 @@ public function setBackgroundDimmingHex($background_dimming_hex) /** * Gets logo_image_url * - * @return string + * @return string|null */ public function getLogoImageUrl() { @@ -546,17 +676,15 @@ public function getLogoImageUrl() /** * Sets logo_image_url * - * @param string $logo_image_url logo_image_url + * @param string|null $logo_image_url logo_image_url * * @return self */ public function setLogoImageUrl($logo_image_url) { - - if ((mb_strlen($logo_image_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $logo_image_url when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 1.'); + if (is_null($logo_image_url)) { + throw new \InvalidArgumentException('non-nullable logo_image_url cannot be null'); } - $this->container['logo_image_url'] = $logo_image_url; return $this; @@ -565,7 +693,7 @@ public function setLogoImageUrl($logo_image_url) /** * Gets background_image_url * - * @return string + * @return string|null */ public function getBackgroundImageUrl() { @@ -575,17 +703,15 @@ public function getBackgroundImageUrl() /** * Sets background_image_url * - * @param string $background_image_url background_image_url + * @param string|null $background_image_url background_image_url * * @return self */ public function setBackgroundImageUrl($background_image_url) { - - if ((mb_strlen($background_image_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $background_image_url when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 1.'); + if (is_null($background_image_url)) { + throw new \InvalidArgumentException('non-nullable background_image_url cannot be null'); } - $this->container['background_image_url'] = $background_image_url; return $this; @@ -594,7 +720,7 @@ public function setBackgroundImageUrl($background_image_url) /** * Gets animated_gif_background_url * - * @return string + * @return string|null */ public function getAnimatedGifBackgroundUrl() { @@ -604,17 +730,15 @@ public function getAnimatedGifBackgroundUrl() /** * Sets animated_gif_background_url * - * @param string $animated_gif_background_url animated_gif_background_url + * @param string|null $animated_gif_background_url animated_gif_background_url * * @return self */ public function setAnimatedGifBackgroundUrl($animated_gif_background_url) { - - if ((mb_strlen($animated_gif_background_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $animated_gif_background_url when calling WTQRCodeDesignCreateParams., must be bigger than or equal to 1.'); + if (is_null($animated_gif_background_url)) { + throw new \InvalidArgumentException('non-nullable animated_gif_background_url cannot be null'); } - $this->container['animated_gif_background_url'] = $animated_gif_background_url; return $this; @@ -626,7 +750,7 @@ public function setAnimatedGifBackgroundUrl($animated_gif_background_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -638,6 +762,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -651,7 +776,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -667,7 +792,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -679,6 +804,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTQRCodeDesignUpdateParams.php b/lib/Model/WTQRCodeDesignUpdateParams.php index 653e515..7c5384d 100644 --- a/lib/Model/WTQRCodeDesignUpdateParams.php +++ b/lib/Model/WTQRCodeDesignUpdateParams.php @@ -2,7 +2,7 @@ /** * WTQRCodeDesignUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTQRCodeDesignUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,6 +61,7 @@ class WTQRCodeDesignUpdateParams implements ModelInterface, ArrayAccess, \JsonSe 'name' => 'string', 'size' => 'int', 'margin' => 'int', + 'is_margin_white' => 'bool', 'corner_radius' => 'int', 'color_dark_hex' => 'string', 'color_light_hex' => 'string', @@ -83,6 +82,7 @@ class WTQRCodeDesignUpdateParams implements ModelInterface, ArrayAccess, \JsonSe 'name' => null, 'size' => 'int32', 'margin' => 'int32', + 'is_margin_white' => null, 'corner_radius' => 'int32', 'color_dark_hex' => null, 'color_light_hex' => null, @@ -92,6 +92,32 @@ class WTQRCodeDesignUpdateParams implements ModelInterface, ArrayAccess, \JsonSe 'animated_gif_background_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'size' => false, + 'margin' => false, + 'is_margin_white' => false, + 'corner_radius' => false, + 'color_dark_hex' => false, + 'color_light_hex' => false, + 'background_dimming_hex' => false, + 'logo_image_url' => false, + 'background_image_url' => false, + 'animated_gif_background_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +138,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -122,6 +200,7 @@ public static function openAPIFormats() 'name' => 'name', 'size' => 'size', 'margin' => 'margin', + 'is_margin_white' => 'isMarginWhite', 'corner_radius' => 'cornerRadius', 'color_dark_hex' => 'colorDarkHex', 'color_light_hex' => 'colorLightHex', @@ -140,6 +219,7 @@ public static function openAPIFormats() 'name' => 'setName', 'size' => 'setSize', 'margin' => 'setMargin', + 'is_margin_white' => 'setIsMarginWhite', 'corner_radius' => 'setCornerRadius', 'color_dark_hex' => 'setColorDarkHex', 'color_light_hex' => 'setColorLightHex', @@ -158,6 +238,7 @@ public static function openAPIFormats() 'name' => 'getName', 'size' => 'getSize', 'margin' => 'getMargin', + 'is_margin_white' => 'getIsMarginWhite', 'corner_radius' => 'getCornerRadius', 'color_dark_hex' => 'getColorDarkHex', 'color_light_hex' => 'getColorLightHex', @@ -224,16 +305,35 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['name'] = $data['name'] ?? null; - $this->container['size'] = $data['size'] ?? null; - $this->container['margin'] = $data['margin'] ?? null; - $this->container['corner_radius'] = $data['corner_radius'] ?? null; - $this->container['color_dark_hex'] = $data['color_dark_hex'] ?? null; - $this->container['color_light_hex'] = $data['color_light_hex'] ?? null; - $this->container['background_dimming_hex'] = $data['background_dimming_hex'] ?? null; - $this->container['logo_image_url'] = $data['logo_image_url'] ?? null; - $this->container['background_image_url'] = $data['background_image_url'] ?? null; - $this->container['animated_gif_background_url'] = $data['animated_gif_background_url'] ?? null; + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('margin', $data ?? [], null); + $this->setIfExists('is_margin_white', $data ?? [], null); + $this->setIfExists('corner_radius', $data ?? [], null); + $this->setIfExists('color_dark_hex', $data ?? [], null); + $this->setIfExists('color_light_hex', $data ?? [], null); + $this->setIfExists('background_dimming_hex', $data ?? [], null); + $this->setIfExists('logo_image_url', $data ?? [], null); + $this->setIfExists('background_image_url', $data ?? [], null); + $this->setIfExists('animated_gif_background_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -266,18 +366,21 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'margin', must be bigger than or equal to 1."; } + if ($this->container['is_margin_white'] === null) { + $invalidProperties[] = "'is_margin_white' can't be null"; + } if ($this->container['corner_radius'] === null) { $invalidProperties[] = "'corner_radius' can't be null"; } - if (($this->container['corner_radius'] < 1)) { - $invalidProperties[] = "invalid value for 'corner_radius', must be bigger than or equal to 1."; + if (($this->container['corner_radius'] < 0)) { + $invalidProperties[] = "invalid value for 'corner_radius', must be bigger than or equal to 0."; } if ($this->container['color_dark_hex'] === null) { $invalidProperties[] = "'color_dark_hex' can't be null"; } - if ((mb_strlen($this->container['color_dark_hex']) < 1)) { - $invalidProperties[] = "invalid value for 'color_dark_hex', the character length must be bigger than or equal to 1."; + if ((mb_strlen($this->container['color_dark_hex']) < 0)) { + $invalidProperties[] = "invalid value for 'color_dark_hex', the character length must be bigger than or equal to 0."; } if ($this->container['color_light_hex'] === null) { @@ -294,27 +397,6 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'background_dimming_hex', the character length must be bigger than or equal to 1."; } - if ($this->container['logo_image_url'] === null) { - $invalidProperties[] = "'logo_image_url' can't be null"; - } - if ((mb_strlen($this->container['logo_image_url']) < 1)) { - $invalidProperties[] = "invalid value for 'logo_image_url', the character length must be bigger than or equal to 1."; - } - - if ($this->container['background_image_url'] === null) { - $invalidProperties[] = "'background_image_url' can't be null"; - } - if ((mb_strlen($this->container['background_image_url']) < 1)) { - $invalidProperties[] = "invalid value for 'background_image_url', the character length must be bigger than or equal to 1."; - } - - if ($this->container['animated_gif_background_url'] === null) { - $invalidProperties[] = "'animated_gif_background_url' can't be null"; - } - if ((mb_strlen($this->container['animated_gif_background_url']) < 1)) { - $invalidProperties[] = "invalid value for 'animated_gif_background_url', the character length must be bigger than or equal to 1."; - } - return $invalidProperties; } @@ -349,6 +431,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } if ((mb_strlen($name) < 1)) { throw new \InvalidArgumentException('invalid length for $name when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 1.'); @@ -378,6 +463,9 @@ public function getSize() */ public function setSize($size) { + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); + } if (($size < 1)) { throw new \InvalidArgumentException('invalid value for $size when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 1.'); @@ -407,6 +495,9 @@ public function getMargin() */ public function setMargin($margin) { + if (is_null($margin)) { + throw new \InvalidArgumentException('non-nullable margin cannot be null'); + } if (($margin < 1)) { throw new \InvalidArgumentException('invalid value for $margin when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 1.'); @@ -417,6 +508,33 @@ public function setMargin($margin) return $this; } + /** + * Gets is_margin_white + * + * @return bool + */ + public function getIsMarginWhite() + { + return $this->container['is_margin_white']; + } + + /** + * Sets is_margin_white + * + * @param bool $is_margin_white is_margin_white + * + * @return self + */ + public function setIsMarginWhite($is_margin_white) + { + if (is_null($is_margin_white)) { + throw new \InvalidArgumentException('non-nullable is_margin_white cannot be null'); + } + $this->container['is_margin_white'] = $is_margin_white; + + return $this; + } + /** * Gets corner_radius * @@ -436,9 +554,12 @@ public function getCornerRadius() */ public function setCornerRadius($corner_radius) { + if (is_null($corner_radius)) { + throw new \InvalidArgumentException('non-nullable corner_radius cannot be null'); + } - if (($corner_radius < 1)) { - throw new \InvalidArgumentException('invalid value for $corner_radius when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 1.'); + if (($corner_radius < 0)) { + throw new \InvalidArgumentException('invalid value for $corner_radius when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 0.'); } $this->container['corner_radius'] = $corner_radius; @@ -465,9 +586,12 @@ public function getColorDarkHex() */ public function setColorDarkHex($color_dark_hex) { + if (is_null($color_dark_hex)) { + throw new \InvalidArgumentException('non-nullable color_dark_hex cannot be null'); + } - if ((mb_strlen($color_dark_hex) < 1)) { - throw new \InvalidArgumentException('invalid length for $color_dark_hex when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 1.'); + if ((mb_strlen($color_dark_hex) < 0)) { + throw new \InvalidArgumentException('invalid length for $color_dark_hex when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 0.'); } $this->container['color_dark_hex'] = $color_dark_hex; @@ -494,6 +618,9 @@ public function getColorLightHex() */ public function setColorLightHex($color_light_hex) { + if (is_null($color_light_hex)) { + throw new \InvalidArgumentException('non-nullable color_light_hex cannot be null'); + } if ((mb_strlen($color_light_hex) < 1)) { throw new \InvalidArgumentException('invalid length for $color_light_hex when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 1.'); @@ -523,6 +650,9 @@ public function getBackgroundDimmingHex() */ public function setBackgroundDimmingHex($background_dimming_hex) { + if (is_null($background_dimming_hex)) { + throw new \InvalidArgumentException('non-nullable background_dimming_hex cannot be null'); + } if ((mb_strlen($background_dimming_hex) < 1)) { throw new \InvalidArgumentException('invalid length for $background_dimming_hex when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 1.'); @@ -536,7 +666,7 @@ public function setBackgroundDimmingHex($background_dimming_hex) /** * Gets logo_image_url * - * @return string + * @return string|null */ public function getLogoImageUrl() { @@ -546,17 +676,15 @@ public function getLogoImageUrl() /** * Sets logo_image_url * - * @param string $logo_image_url logo_image_url + * @param string|null $logo_image_url logo_image_url * * @return self */ public function setLogoImageUrl($logo_image_url) { - - if ((mb_strlen($logo_image_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $logo_image_url when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 1.'); + if (is_null($logo_image_url)) { + throw new \InvalidArgumentException('non-nullable logo_image_url cannot be null'); } - $this->container['logo_image_url'] = $logo_image_url; return $this; @@ -565,7 +693,7 @@ public function setLogoImageUrl($logo_image_url) /** * Gets background_image_url * - * @return string + * @return string|null */ public function getBackgroundImageUrl() { @@ -575,17 +703,15 @@ public function getBackgroundImageUrl() /** * Sets background_image_url * - * @param string $background_image_url background_image_url + * @param string|null $background_image_url background_image_url * * @return self */ public function setBackgroundImageUrl($background_image_url) { - - if ((mb_strlen($background_image_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $background_image_url when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 1.'); + if (is_null($background_image_url)) { + throw new \InvalidArgumentException('non-nullable background_image_url cannot be null'); } - $this->container['background_image_url'] = $background_image_url; return $this; @@ -594,7 +720,7 @@ public function setBackgroundImageUrl($background_image_url) /** * Gets animated_gif_background_url * - * @return string + * @return string|null */ public function getAnimatedGifBackgroundUrl() { @@ -604,17 +730,15 @@ public function getAnimatedGifBackgroundUrl() /** * Sets animated_gif_background_url * - * @param string $animated_gif_background_url animated_gif_background_url + * @param string|null $animated_gif_background_url animated_gif_background_url * * @return self */ public function setAnimatedGifBackgroundUrl($animated_gif_background_url) { - - if ((mb_strlen($animated_gif_background_url) < 1)) { - throw new \InvalidArgumentException('invalid length for $animated_gif_background_url when calling WTQRCodeDesignUpdateParams., must be bigger than or equal to 1.'); + if (is_null($animated_gif_background_url)) { + throw new \InvalidArgumentException('non-nullable animated_gif_background_url cannot be null'); } - $this->container['animated_gif_background_url'] = $animated_gif_background_url; return $this; @@ -626,7 +750,7 @@ public function setAnimatedGifBackgroundUrl($animated_gif_background_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -638,6 +762,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -651,7 +776,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -667,7 +792,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -679,6 +804,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTRole.php b/lib/Model/WTRole.php index 0ae7ee7..d68b3dd 100644 --- a/lib/Model/WTRole.php +++ b/lib/Model/WTRole.php @@ -2,7 +2,7 @@ /** * WTRole * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTRole implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -70,7 +68,7 @@ class WTRole implements ModelInterface, ArrayAccess, \JsonSerializable 'name' => 'string', 'display_name' => 'string', 'is_public' => 'bool', - 'order_number' => 'double', + 'order_number' => 'float', 'is_system' => 'bool', 'icons' => 'string[]', 'category' => 'string', @@ -102,6 +100,36 @@ class WTRole implements ModelInterface, ArrayAccess, \JsonSerializable 'admin_page' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'employees' => false, + 'roles' => false, + 'employee_id' => false, + 'merchant_id' => false, + 'name' => false, + 'display_name' => false, + 'is_public' => false, + 'order_number' => false, + 'is_system' => false, + 'icons' => false, + 'category' => false, + 'admin_page' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -122,6 +150,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -249,21 +329,39 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['employees'] = $data['employees'] ?? null; - $this->container['roles'] = $data['roles'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['name'] = $data['name'] ?? null; - $this->container['display_name'] = $data['display_name'] ?? null; - $this->container['is_public'] = $data['is_public'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['is_system'] = $data['is_system'] ?? null; - $this->container['icons'] = $data['icons'] ?? null; - $this->container['category'] = $data['category'] ?? null; - $this->container['admin_page'] = $data['admin_page'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('employees', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('is_public', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('is_system', $data ?? [], null); + $this->setIfExists('icons', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('admin_page', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -390,14 +488,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling WTRole., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling WTRole., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling WTRole., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling WTRole., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -424,6 +525,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -448,6 +552,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -472,6 +579,9 @@ public function getEmployees() */ public function setEmployees($employees) { + if (is_null($employees)) { + throw new \InvalidArgumentException('non-nullable employees cannot be null'); + } $this->container['employees'] = $employees; return $this; @@ -496,6 +606,9 @@ public function getRoles() */ public function setRoles($roles) { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } $this->container['roles'] = $roles; return $this; @@ -520,14 +633,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTRole., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTRole., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling WTRole., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling WTRole., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -554,14 +670,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTRole., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTRole., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTRole., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTRole., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -588,6 +707,9 @@ public function getName() */ public function setName($name) { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } $this->container['name'] = $name; return $this; @@ -612,6 +734,9 @@ public function getDisplayName() */ public function setDisplayName($display_name) { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } $this->container['display_name'] = $display_name; return $this; @@ -636,6 +761,9 @@ public function getIsPublic() */ public function setIsPublic($is_public) { + if (is_null($is_public)) { + throw new \InvalidArgumentException('non-nullable is_public cannot be null'); + } $this->container['is_public'] = $is_public; return $this; @@ -644,7 +772,7 @@ public function setIsPublic($is_public) /** * Gets order_number * - * @return double + * @return float */ public function getOrderNumber() { @@ -654,12 +782,15 @@ public function getOrderNumber() /** * Sets order_number * - * @param double $order_number order_number + * @param float $order_number order_number * * @return self */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } $this->container['order_number'] = $order_number; return $this; @@ -684,6 +815,9 @@ public function getIsSystem() */ public function setIsSystem($is_system) { + if (is_null($is_system)) { + throw new \InvalidArgumentException('non-nullable is_system cannot be null'); + } $this->container['is_system'] = $is_system; return $this; @@ -708,6 +842,9 @@ public function getIcons() */ public function setIcons($icons) { + if (is_null($icons)) { + throw new \InvalidArgumentException('non-nullable icons cannot be null'); + } $this->container['icons'] = $icons; return $this; @@ -732,6 +869,9 @@ public function getCategory() */ public function setCategory($category) { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } $this->container['category'] = $category; return $this; @@ -756,6 +896,9 @@ public function getAdminPage() */ public function setAdminPage($admin_page) { + if (is_null($admin_page)) { + throw new \InvalidArgumentException('non-nullable admin_page cannot be null'); + } $this->container['admin_page'] = $admin_page; return $this; @@ -767,7 +910,7 @@ public function setAdminPage($admin_page) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -779,6 +922,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -792,7 +936,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -808,7 +952,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -820,6 +964,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTRoomRateCreateParams.php b/lib/Model/WTRoomRateCreateParams.php index b32bc7a..8894fc0 100644 --- a/lib/Model/WTRoomRateCreateParams.php +++ b/lib/Model/WTRoomRateCreateParams.php @@ -2,7 +2,7 @@ /** * WTRoomRateCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTRoomRateCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTRoomRateCreateParams implements ModelInterface, ArrayAccess, \JsonSerial 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTRoomRateCreateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTRoomRateCreateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTRoomRateCreateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTRoomRateUpdateParams.php b/lib/Model/WTRoomRateUpdateParams.php index 2b480f6..4493523 100644 --- a/lib/Model/WTRoomRateUpdateParams.php +++ b/lib/Model/WTRoomRateUpdateParams.php @@ -2,7 +2,7 @@ /** * WTRoomRateUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTRoomRateUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTRoomRateUpdateParams implements ModelInterface, ArrayAccess, \JsonSerial 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTRoomRateUpdateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTRoomRateUpdateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTRoomRateUpdateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTSMSAcquirePhoneNumber.php b/lib/Model/WTSMSAcquirePhoneNumber.php index cf19e25..4341650 100644 --- a/lib/Model/WTSMSAcquirePhoneNumber.php +++ b/lib/Model/WTSMSAcquirePhoneNumber.php @@ -2,7 +2,7 @@ /** * WTSMSAcquirePhoneNumber * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTSMSAcquirePhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTSMSAcquirePhoneNumber implements ModelInterface, ArrayAccess, \JsonSeria 'phone_number' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phone_number'] = $data['phone_number'] ?? null; + $this->setIfExists('phone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -232,6 +316,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } if ((mb_strlen($phone_number) < 1)) { throw new \InvalidArgumentException('invalid length for $phone_number when calling WTSMSAcquirePhoneNumber., must be bigger than or equal to 1.'); @@ -248,7 +335,7 @@ public function setPhoneNumber($phone_number) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,6 +347,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -273,7 +361,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -289,7 +377,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -301,6 +389,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTSMSImportOptInListSubscribers.php b/lib/Model/WTSMSImportOptInListSubscribers.php index 5ed82dd..a0027e3 100644 --- a/lib/Model/WTSMSImportOptInListSubscribers.php +++ b/lib/Model/WTSMSImportOptInListSubscribers.php @@ -2,7 +2,7 @@ /** * WTSMSImportOptInListSubscribers * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTSMSImportOptInListSubscribers implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTSMSImportOptInListSubscribers implements ModelInterface, ArrayAccess, \J 'opt_in_source_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'file_name' => false, + 'bucket' => false, + 'opt_in_source_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['file_name'] = $data['file_name'] ?? null; - $this->container['bucket'] = $data['bucket'] ?? null; - $this->container['opt_in_source_id'] = $data['opt_in_source_id'] ?? null; + $this->setIfExists('file_name', $data ?? [], null); + $this->setIfExists('bucket', $data ?? [], null); + $this->setIfExists('opt_in_source_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -266,6 +352,9 @@ public function getFileName() */ public function setFileName($file_name) { + if (is_null($file_name)) { + throw new \InvalidArgumentException('non-nullable file_name cannot be null'); + } if ((mb_strlen($file_name) < 1)) { throw new \InvalidArgumentException('invalid length for $file_name when calling WTSMSImportOptInListSubscribers., must be bigger than or equal to 1.'); @@ -295,6 +384,9 @@ public function getBucket() */ public function setBucket($bucket) { + if (is_null($bucket)) { + throw new \InvalidArgumentException('non-nullable bucket cannot be null'); + } if ((mb_strlen($bucket) < 1)) { throw new \InvalidArgumentException('invalid length for $bucket when calling WTSMSImportOptInListSubscribers., must be bigger than or equal to 1.'); @@ -324,14 +416,17 @@ public function getOptInSourceId() */ public function setOptInSourceId($opt_in_source_id) { + if (is_null($opt_in_source_id)) { + throw new \InvalidArgumentException('non-nullable opt_in_source_id cannot be null'); + } if ((mb_strlen($opt_in_source_id) > 10)) { throw new \InvalidArgumentException('invalid length for $opt_in_source_id when calling WTSMSImportOptInListSubscribers., must be smaller than or equal to 10.'); } if ((mb_strlen($opt_in_source_id) < 10)) { throw new \InvalidArgumentException('invalid length for $opt_in_source_id when calling WTSMSImportOptInListSubscribers., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $opt_in_source_id))) { - throw new \InvalidArgumentException("invalid value for $opt_in_source_id when calling WTSMSImportOptInListSubscribers., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($opt_in_source_id)))) { + throw new \InvalidArgumentException("invalid value for \$opt_in_source_id when calling WTSMSImportOptInListSubscribers., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['opt_in_source_id'] = $opt_in_source_id; @@ -345,7 +440,7 @@ public function setOptInSourceId($opt_in_source_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -357,6 +452,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -370,7 +466,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -386,7 +482,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -398,6 +494,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTSMSImportedListCreate.php b/lib/Model/WTSMSImportedListCreate.php index c1b0068..eaef1af 100644 --- a/lib/Model/WTSMSImportedListCreate.php +++ b/lib/Model/WTSMSImportedListCreate.php @@ -2,7 +2,7 @@ /** * WTSMSImportedListCreate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTSMSImportedListCreate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTSMSImportedListCreate implements ModelInterface, ArrayAccess, \JsonSeria 'list_name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'phone_number_id' => false, + 'is_active' => false, + 'list_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['list_name'] = $data['list_name'] ?? null; + $this->setIfExists('phone_number_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('list_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -262,14 +348,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTSMSImportedListCreate., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTSMSImportedListCreate., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling WTSMSImportedListCreate., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling WTSMSImportedListCreate., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -296,6 +385,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -320,6 +412,9 @@ public function getListName() */ public function setListName($list_name) { + if (is_null($list_name)) { + throw new \InvalidArgumentException('non-nullable list_name cannot be null'); + } if ((mb_strlen($list_name) < 1)) { throw new \InvalidArgumentException('invalid length for $list_name when calling WTSMSImportedListCreate., must be bigger than or equal to 1.'); @@ -336,7 +431,7 @@ public function setListName($list_name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -348,6 +443,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -361,7 +457,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -377,7 +473,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -389,6 +485,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTSMSOptInListSourceCreate.php b/lib/Model/WTSMSOptInListSourceCreate.php index c3e1d42..ca7d5d8 100644 --- a/lib/Model/WTSMSOptInListSourceCreate.php +++ b/lib/Model/WTSMSOptInListSourceCreate.php @@ -2,7 +2,7 @@ /** * WTSMSOptInListSourceCreate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTSMSOptInListSourceCreate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTSMSOptInListSourceCreate implements ModelInterface, ArrayAccess, \JsonSe 'source_name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'list_id' => false, + 'source_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['list_id'] = $data['list_id'] ?? null; - $this->container['source_name'] = $data['source_name'] ?? null; + $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('source_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -253,14 +338,17 @@ public function getListId() */ public function setListId($list_id) { + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + } if ((mb_strlen($list_id) > 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling WTSMSOptInListSourceCreate., must be smaller than or equal to 10.'); } if ((mb_strlen($list_id) < 10)) { throw new \InvalidArgumentException('invalid length for $list_id when calling WTSMSOptInListSourceCreate., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $list_id))) { - throw new \InvalidArgumentException("invalid value for $list_id when calling WTSMSOptInListSourceCreate., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($list_id)))) { + throw new \InvalidArgumentException("invalid value for \$list_id when calling WTSMSOptInListSourceCreate., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['list_id'] = $list_id; @@ -287,6 +375,9 @@ public function getSourceName() */ public function setSourceName($source_name) { + if (is_null($source_name)) { + throw new \InvalidArgumentException('non-nullable source_name cannot be null'); + } if ((mb_strlen($source_name) < 1)) { throw new \InvalidArgumentException('invalid length for $source_name when calling WTSMSOptInListSourceCreate., must be bigger than or equal to 1.'); @@ -303,7 +394,7 @@ public function setSourceName($source_name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -315,6 +406,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -328,7 +420,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -344,7 +436,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -356,6 +448,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTSMSUpdatePhoneNumberConfig.php b/lib/Model/WTSMSUpdatePhoneNumberConfig.php index 389bbd7..a7f9ddf 100644 --- a/lib/Model/WTSMSUpdatePhoneNumberConfig.php +++ b/lib/Model/WTSMSUpdatePhoneNumberConfig.php @@ -2,7 +2,7 @@ /** * WTSMSUpdatePhoneNumberConfig * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTSMSUpdatePhoneNumberConfig implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -96,6 +94,33 @@ class WTSMSUpdatePhoneNumberConfig implements ModelInterface, ArrayAccess, \Json 'watson_conversation_workplace_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'company_name' => false, + 'privacy_policy_url' => false, + 'terms_of_service_url' => false, + 'message_footer' => false, + 'stop_response' => false, + 'help_response' => false, + 'help_desk_keyword' => false, + 'help_desk_queue_response' => false, + 'is_connected_to_watson' => false, + 'watson_username' => false, + 'watson_password' => false, + 'watson_conversation_workplace_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -116,6 +141,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -234,18 +311,36 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['company_name'] = $data['company_name'] ?? null; - $this->container['privacy_policy_url'] = $data['privacy_policy_url'] ?? null; - $this->container['terms_of_service_url'] = $data['terms_of_service_url'] ?? null; - $this->container['message_footer'] = $data['message_footer'] ?? null; - $this->container['stop_response'] = $data['stop_response'] ?? null; - $this->container['help_response'] = $data['help_response'] ?? null; - $this->container['help_desk_keyword'] = $data['help_desk_keyword'] ?? null; - $this->container['help_desk_queue_response'] = $data['help_desk_queue_response'] ?? null; - $this->container['is_connected_to_watson'] = $data['is_connected_to_watson'] ?? null; - $this->container['watson_username'] = $data['watson_username'] ?? null; - $this->container['watson_password'] = $data['watson_password'] ?? null; - $this->container['watson_conversation_workplace_id'] = $data['watson_conversation_workplace_id'] ?? null; + $this->setIfExists('company_name', $data ?? [], null); + $this->setIfExists('privacy_policy_url', $data ?? [], null); + $this->setIfExists('terms_of_service_url', $data ?? [], null); + $this->setIfExists('message_footer', $data ?? [], null); + $this->setIfExists('stop_response', $data ?? [], null); + $this->setIfExists('help_response', $data ?? [], null); + $this->setIfExists('help_desk_keyword', $data ?? [], null); + $this->setIfExists('help_desk_queue_response', $data ?? [], null); + $this->setIfExists('is_connected_to_watson', $data ?? [], null); + $this->setIfExists('watson_username', $data ?? [], null); + $this->setIfExists('watson_password', $data ?? [], null); + $this->setIfExists('watson_conversation_workplace_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -309,6 +404,9 @@ public function getCompanyName() */ public function setCompanyName($company_name) { + if (is_null($company_name)) { + throw new \InvalidArgumentException('non-nullable company_name cannot be null'); + } $this->container['company_name'] = $company_name; return $this; @@ -333,6 +431,9 @@ public function getPrivacyPolicyUrl() */ public function setPrivacyPolicyUrl($privacy_policy_url) { + if (is_null($privacy_policy_url)) { + throw new \InvalidArgumentException('non-nullable privacy_policy_url cannot be null'); + } $this->container['privacy_policy_url'] = $privacy_policy_url; return $this; @@ -357,6 +458,9 @@ public function getTermsOfServiceUrl() */ public function setTermsOfServiceUrl($terms_of_service_url) { + if (is_null($terms_of_service_url)) { + throw new \InvalidArgumentException('non-nullable terms_of_service_url cannot be null'); + } $this->container['terms_of_service_url'] = $terms_of_service_url; return $this; @@ -381,6 +485,9 @@ public function getMessageFooter() */ public function setMessageFooter($message_footer) { + if (is_null($message_footer)) { + throw new \InvalidArgumentException('non-nullable message_footer cannot be null'); + } $this->container['message_footer'] = $message_footer; return $this; @@ -405,6 +512,9 @@ public function getStopResponse() */ public function setStopResponse($stop_response) { + if (is_null($stop_response)) { + throw new \InvalidArgumentException('non-nullable stop_response cannot be null'); + } $this->container['stop_response'] = $stop_response; return $this; @@ -429,6 +539,9 @@ public function getHelpResponse() */ public function setHelpResponse($help_response) { + if (is_null($help_response)) { + throw new \InvalidArgumentException('non-nullable help_response cannot be null'); + } $this->container['help_response'] = $help_response; return $this; @@ -453,6 +566,9 @@ public function getHelpDeskKeyword() */ public function setHelpDeskKeyword($help_desk_keyword) { + if (is_null($help_desk_keyword)) { + throw new \InvalidArgumentException('non-nullable help_desk_keyword cannot be null'); + } $this->container['help_desk_keyword'] = $help_desk_keyword; return $this; @@ -477,6 +593,9 @@ public function getHelpDeskQueueResponse() */ public function setHelpDeskQueueResponse($help_desk_queue_response) { + if (is_null($help_desk_queue_response)) { + throw new \InvalidArgumentException('non-nullable help_desk_queue_response cannot be null'); + } $this->container['help_desk_queue_response'] = $help_desk_queue_response; return $this; @@ -501,6 +620,9 @@ public function getIsConnectedToWatson() */ public function setIsConnectedToWatson($is_connected_to_watson) { + if (is_null($is_connected_to_watson)) { + throw new \InvalidArgumentException('non-nullable is_connected_to_watson cannot be null'); + } $this->container['is_connected_to_watson'] = $is_connected_to_watson; return $this; @@ -525,6 +647,9 @@ public function getWatsonUsername() */ public function setWatsonUsername($watson_username) { + if (is_null($watson_username)) { + throw new \InvalidArgumentException('non-nullable watson_username cannot be null'); + } $this->container['watson_username'] = $watson_username; return $this; @@ -549,6 +674,9 @@ public function getWatsonPassword() */ public function setWatsonPassword($watson_password) { + if (is_null($watson_password)) { + throw new \InvalidArgumentException('non-nullable watson_password cannot be null'); + } $this->container['watson_password'] = $watson_password; return $this; @@ -573,6 +701,9 @@ public function getWatsonConversationWorkplaceId() */ public function setWatsonConversationWorkplaceId($watson_conversation_workplace_id) { + if (is_null($watson_conversation_workplace_id)) { + throw new \InvalidArgumentException('non-nullable watson_conversation_workplace_id cannot be null'); + } $this->container['watson_conversation_workplace_id'] = $watson_conversation_workplace_id; return $this; @@ -584,7 +715,7 @@ public function setWatsonConversationWorkplaceId($watson_conversation_workplace_ * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -596,6 +727,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -609,7 +741,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -625,7 +757,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -637,6 +769,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTServiceCreateParams.php b/lib/Model/WTServiceCreateParams.php index f61fe54..56cd2dc 100644 --- a/lib/Model/WTServiceCreateParams.php +++ b/lib/Model/WTServiceCreateParams.php @@ -2,7 +2,7 @@ /** * WTServiceCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTServiceCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTServiceCreateParams implements ModelInterface, ArrayAccess, \JsonSeriali 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTServiceCreateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTServiceCreateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTServiceCreateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTServiceUpdateParams.php b/lib/Model/WTServiceUpdateParams.php index 021f604..bdd70d1 100644 --- a/lib/Model/WTServiceUpdateParams.php +++ b/lib/Model/WTServiceUpdateParams.php @@ -2,7 +2,7 @@ /** * WTServiceUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTServiceUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -84,6 +82,27 @@ class WTServiceUpdateParams implements ModelInterface, ArrayAccess, \JsonSeriali 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'displayed_price' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['displayed_price'] = $data['displayed_price'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('displayed_price', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -276,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTServiceUpdateParams., must be bigger than or equal to 1.'); @@ -305,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTServiceUpdateParams., must be bigger than or equal to 1.'); @@ -334,6 +429,9 @@ public function getDisplayedPrice() */ public function setDisplayedPrice($displayed_price) { + if (is_null($displayed_price)) { + throw new \InvalidArgumentException('non-nullable displayed_price cannot be null'); + } $this->container['displayed_price'] = $displayed_price; return $this; @@ -358,6 +456,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTServiceUpdateParams., must be bigger than or equal to 1.'); @@ -387,6 +488,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } $this->container['media_url'] = $media_url; return $this; @@ -411,6 +515,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -422,7 +529,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -434,6 +541,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -447,7 +555,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -463,7 +571,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -475,6 +583,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTSettingsSetPassword.php b/lib/Model/WTSettingsSetPassword.php index d468c56..b388f7e 100644 --- a/lib/Model/WTSettingsSetPassword.php +++ b/lib/Model/WTSettingsSetPassword.php @@ -2,7 +2,7 @@ /** * WTSettingsSetPassword * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTSettingsSetPassword implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -74,6 +72,22 @@ class WTSettingsSetPassword implements ModelInterface, ArrayAccess, \JsonSeriali 'password' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'password' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -94,6 +108,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -179,7 +245,25 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['password'] = $data['password'] ?? null; + $this->setIfExists('password', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -232,6 +316,9 @@ public function getPassword() */ public function setPassword($password) { + if (is_null($password)) { + throw new \InvalidArgumentException('non-nullable password cannot be null'); + } if ((mb_strlen($password) < 1)) { throw new \InvalidArgumentException('invalid length for $password when calling WTSettingsSetPassword., must be bigger than or equal to 1.'); @@ -248,7 +335,7 @@ public function setPassword($password) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -260,6 +347,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -273,7 +361,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -289,7 +377,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -301,6 +389,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTSmsSubscriberCreateParams.php b/lib/Model/WTSmsSubscriberCreateParams.php new file mode 100644 index 0000000..88e39a4 --- /dev/null +++ b/lib/Model/WTSmsSubscriberCreateParams.php @@ -0,0 +1,413 @@ + + */ +class WTSmsSubscriberCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTSmsSubscriberCreateParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mobile_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mobile_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'mobile_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'mobile_number' => 'mobileNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mobile_number' => 'setMobileNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mobile_number' => 'getMobileNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('mobile_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['mobile_number'] === null) { + $invalidProperties[] = "'mobile_number' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets mobile_number + * + * @return string + */ + public function getMobileNumber() + { + return $this->container['mobile_number']; + } + + /** + * Sets mobile_number + * + * @param string $mobile_number mobile_number + * + * @return self + */ + public function setMobileNumber($mobile_number) + { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } + $this->container['mobile_number'] = $mobile_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTSmsSubscriberCreateParamsWalletUI.php b/lib/Model/WTSmsSubscriberCreateParamsWalletUI.php new file mode 100644 index 0000000..b6280a7 --- /dev/null +++ b/lib/Model/WTSmsSubscriberCreateParamsWalletUI.php @@ -0,0 +1,472 @@ + + */ +class WTSmsSubscriberCreateParamsWalletUI implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTSmsSubscriberCreateParamsWalletUI'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mobile_number' => 'string', + 'merchant_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mobile_number' => null, + 'merchant_id' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'mobile_number' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'mobile_number' => 'mobileNumber', + 'merchant_id' => 'merchantID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mobile_number' => 'setMobileNumber', + 'merchant_id' => 'setMerchantId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mobile_number' => 'getMobileNumber', + 'merchant_id' => 'getMerchantId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('mobile_number', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['mobile_number'] === null) { + $invalidProperties[] = "'mobile_number' can't be null"; + } + if ($this->container['merchant_id'] === null) { + $invalidProperties[] = "'merchant_id' can't be null"; + } + if ((mb_strlen($this->container['merchant_id']) > 10)) { + $invalidProperties[] = "invalid value for 'merchant_id', the character length must be smaller than or equal to 10."; + } + + if ((mb_strlen($this->container['merchant_id']) < 10)) { + $invalidProperties[] = "invalid value for 'merchant_id', the character length must be bigger than or equal to 10."; + } + + if (!preg_match("/^[a-zA-Z0-9]+$/", $this->container['merchant_id'])) { + $invalidProperties[] = "invalid value for 'merchant_id', must be conform to the pattern /^[a-zA-Z0-9]+$/."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets mobile_number + * + * @return string + */ + public function getMobileNumber() + { + return $this->container['mobile_number']; + } + + /** + * Sets mobile_number + * + * @param string $mobile_number mobile_number + * + * @return self + */ + public function setMobileNumber($mobile_number) + { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } + $this->container['mobile_number'] = $mobile_number; + + return $this; + } + + /** + * Gets merchant_id + * + * @return string + */ + public function getMerchantId() + { + return $this->container['merchant_id']; + } + + /** + * Sets merchant_id + * + * @param string $merchant_id merchant_id + * + * @return self + */ + public function setMerchantId($merchant_id) + { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } + if ((mb_strlen($merchant_id) > 10)) { + throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTSmsSubscriberCreateParamsWalletUI., must be smaller than or equal to 10.'); + } + if ((mb_strlen($merchant_id) < 10)) { + throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTSmsSubscriberCreateParamsWalletUI., must be bigger than or equal to 10.'); + } + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTSmsSubscriberCreateParamsWalletUI., must conform to the pattern /^[a-zA-Z0-9]+$/."); + } + + $this->container['merchant_id'] = $merchant_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTSmsSubscriberUpdateParams.php b/lib/Model/WTSmsSubscriberUpdateParams.php new file mode 100644 index 0000000..bcd4414 --- /dev/null +++ b/lib/Model/WTSmsSubscriberUpdateParams.php @@ -0,0 +1,413 @@ + + */ +class WTSmsSubscriberUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTSmsSubscriberUpdateParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mobile_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mobile_number' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'mobile_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'mobile_number' => 'mobileNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mobile_number' => 'setMobileNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mobile_number' => 'getMobileNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('mobile_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['mobile_number'] === null) { + $invalidProperties[] = "'mobile_number' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets mobile_number + * + * @return string + */ + public function getMobileNumber() + { + return $this->container['mobile_number']; + } + + /** + * Sets mobile_number + * + * @param string $mobile_number mobile_number + * + * @return self + */ + public function setMobileNumber($mobile_number) + { + if (is_null($mobile_number)) { + throw new \InvalidArgumentException('non-nullable mobile_number cannot be null'); + } + $this->container['mobile_number'] = $mobile_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTStaticVoucher.php b/lib/Model/WTStaticVoucher.php index 8f8020a..57db65a 100644 --- a/lib/Model/WTStaticVoucher.php +++ b/lib/Model/WTStaticVoucher.php @@ -2,7 +2,7 @@ /** * WTStaticVoucher * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTStaticVoucher implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,14 +58,14 @@ class WTStaticVoucher implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'campaign_id' => 'string', 'member_id' => 'string', 'cell_phone_number' => 'string', 'offer_amount_cents' => 'int', 'order_number' => 'int', - 'transaction_type' => 'string', - 'register_id' => 'string', + 'transaction_type' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType', + 'register_id' => '\OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID', 'redeemed_source' => 'string', 'redeemed_transaction_id' => 'string', 'redeemed_amount' => 'int', @@ -136,6 +134,53 @@ class WTStaticVoucher implements ModelInterface, ArrayAccess, \JsonSerializable 'reason_invalid' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'campaign_id' => false, + 'member_id' => false, + 'cell_phone_number' => false, + 'offer_amount_cents' => false, + 'order_number' => false, + 'transaction_type' => false, + 'register_id' => false, + 'redeemed_source' => false, + 'redeemed_transaction_id' => false, + 'redeemed_amount' => false, + 'is_redeemed' => false, + 'refunded_transaction_id' => false, + 'refunded_amount' => false, + 'status' => false, + 'customer_id' => false, + 'authorized_against_check_number' => false, + 'authorized_amount' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'authorized_amount_decimal' => false, + 'authorized_amount_string' => false, + 'offer_amount_cents_decimal' => false, + 'offer_amount_cents_string' => false, + 'redeemed_amount_decimal' => false, + 'redeemed_amount_string' => false, + 'date_time_redeemed' => true, + 'date_time_refunded' => true, + 'date_time_last_viewed' => true, + 'reason_invalid' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -156,6 +201,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -334,38 +431,56 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['campaign_id'] = $data['campaign_id'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['cell_phone_number'] = $data['cell_phone_number'] ?? null; - $this->container['offer_amount_cents'] = $data['offer_amount_cents'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['redeemed_source'] = $data['redeemed_source'] ?? null; - $this->container['redeemed_transaction_id'] = $data['redeemed_transaction_id'] ?? null; - $this->container['redeemed_amount'] = $data['redeemed_amount'] ?? null; - $this->container['is_redeemed'] = $data['is_redeemed'] ?? null; - $this->container['refunded_transaction_id'] = $data['refunded_transaction_id'] ?? null; - $this->container['refunded_amount'] = $data['refunded_amount'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['customer_id'] = $data['customer_id'] ?? null; - $this->container['authorized_against_check_number'] = $data['authorized_against_check_number'] ?? null; - $this->container['authorized_amount'] = $data['authorized_amount'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['authorized_amount_decimal'] = $data['authorized_amount_decimal'] ?? null; - $this->container['authorized_amount_string'] = $data['authorized_amount_string'] ?? null; - $this->container['offer_amount_cents_decimal'] = $data['offer_amount_cents_decimal'] ?? null; - $this->container['offer_amount_cents_string'] = $data['offer_amount_cents_string'] ?? null; - $this->container['redeemed_amount_decimal'] = $data['redeemed_amount_decimal'] ?? null; - $this->container['redeemed_amount_string'] = $data['redeemed_amount_string'] ?? null; - $this->container['date_time_redeemed'] = $data['date_time_redeemed'] ?? null; - $this->container['date_time_refunded'] = $data['date_time_refunded'] ?? null; - $this->container['date_time_last_viewed'] = $data['date_time_last_viewed'] ?? null; - $this->container['reason_invalid'] = $data['reason_invalid'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('campaign_id', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('cell_phone_number', $data ?? [], null); + $this->setIfExists('offer_amount_cents', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('redeemed_source', $data ?? [], null); + $this->setIfExists('redeemed_transaction_id', $data ?? [], null); + $this->setIfExists('redeemed_amount', $data ?? [], null); + $this->setIfExists('is_redeemed', $data ?? [], null); + $this->setIfExists('refunded_transaction_id', $data ?? [], null); + $this->setIfExists('refunded_amount', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('customer_id', $data ?? [], null); + $this->setIfExists('authorized_against_check_number', $data ?? [], null); + $this->setIfExists('authorized_amount', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('authorized_amount_decimal', $data ?? [], null); + $this->setIfExists('authorized_amount_string', $data ?? [], null); + $this->setIfExists('offer_amount_cents_decimal', $data ?? [], null); + $this->setIfExists('offer_amount_cents_string', $data ?? [], null); + $this->setIfExists('redeemed_amount_decimal', $data ?? [], null); + $this->setIfExists('redeemed_amount_string', $data ?? [], null); + $this->setIfExists('date_time_redeemed', $data ?? [], null); + $this->setIfExists('date_time_refunded', $data ?? [], null); + $this->setIfExists('date_time_last_viewed', $data ?? [], null); + $this->setIfExists('reason_invalid', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -380,14 +495,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['campaign_id'] === null) { $invalidProperties[] = "'campaign_id' can't be null"; } @@ -526,7 +633,7 @@ public function valid() /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -536,19 +643,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTStaticVoucher., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTStaticVoucher., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -573,14 +676,17 @@ public function getCampaignId() */ public function setCampaignId($campaign_id) { + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); + } if ((mb_strlen($campaign_id) > 10)) { throw new \InvalidArgumentException('invalid length for $campaign_id when calling WTStaticVoucher., must be smaller than or equal to 10.'); } if ((mb_strlen($campaign_id) < 10)) { throw new \InvalidArgumentException('invalid length for $campaign_id when calling WTStaticVoucher., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $campaign_id))) { - throw new \InvalidArgumentException("invalid value for $campaign_id when calling WTStaticVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($campaign_id)))) { + throw new \InvalidArgumentException("invalid value for \$campaign_id when calling WTStaticVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['campaign_id'] = $campaign_id; @@ -607,9 +713,12 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling WTStaticVoucher., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling WTStaticVoucher., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -636,6 +745,9 @@ public function getCellPhoneNumber() */ public function setCellPhoneNumber($cell_phone_number) { + if (is_null($cell_phone_number)) { + throw new \InvalidArgumentException('non-nullable cell_phone_number cannot be null'); + } $this->container['cell_phone_number'] = $cell_phone_number; return $this; @@ -660,6 +772,9 @@ public function getOfferAmountCents() */ public function setOfferAmountCents($offer_amount_cents) { + if (is_null($offer_amount_cents)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents cannot be null'); + } if (($offer_amount_cents < 0)) { throw new \InvalidArgumentException('invalid value for $offer_amount_cents when calling WTStaticVoucher., must be bigger than or equal to 0.'); @@ -689,6 +804,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 0)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTStaticVoucher., must be bigger than or equal to 0.'); @@ -702,7 +820,7 @@ public function setOrderNumber($order_number) /** * Gets transaction_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType */ public function getTransactionType() { @@ -712,12 +830,15 @@ public function getTransactionType() /** * Sets transaction_type * - * @param string $transaction_type The type of the transaction - only redemption at the moment + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionType $transaction_type transaction_type * * @return self */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -726,7 +847,7 @@ public function setTransactionType($transaction_type) /** * Gets register_id * - * @return string + * @return \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID */ public function getRegisterId() { @@ -736,12 +857,15 @@ public function getRegisterId() /** * Sets register_id * - * @param string $register_id The ID of the register where the transaction occurred + * @param \OpenAPI\Client\Model\PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterID $register_id register_id * * @return self */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -766,6 +890,9 @@ public function getRedeemedSource() */ public function setRedeemedSource($redeemed_source) { + if (is_null($redeemed_source)) { + throw new \InvalidArgumentException('non-nullable redeemed_source cannot be null'); + } $this->container['redeemed_source'] = $redeemed_source; return $this; @@ -790,6 +917,9 @@ public function getRedeemedTransactionId() */ public function setRedeemedTransactionId($redeemed_transaction_id) { + if (is_null($redeemed_transaction_id)) { + throw new \InvalidArgumentException('non-nullable redeemed_transaction_id cannot be null'); + } $this->container['redeemed_transaction_id'] = $redeemed_transaction_id; return $this; @@ -814,6 +944,9 @@ public function getRedeemedAmount() */ public function setRedeemedAmount($redeemed_amount) { + if (is_null($redeemed_amount)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount cannot be null'); + } if (($redeemed_amount < 0)) { throw new \InvalidArgumentException('invalid value for $redeemed_amount when calling WTStaticVoucher., must be bigger than or equal to 0.'); @@ -843,6 +976,9 @@ public function getIsRedeemed() */ public function setIsRedeemed($is_redeemed) { + if (is_null($is_redeemed)) { + throw new \InvalidArgumentException('non-nullable is_redeemed cannot be null'); + } $this->container['is_redeemed'] = $is_redeemed; return $this; @@ -867,6 +1003,9 @@ public function getRefundedTransactionId() */ public function setRefundedTransactionId($refunded_transaction_id) { + if (is_null($refunded_transaction_id)) { + throw new \InvalidArgumentException('non-nullable refunded_transaction_id cannot be null'); + } $this->container['refunded_transaction_id'] = $refunded_transaction_id; return $this; @@ -891,6 +1030,9 @@ public function getRefundedAmount() */ public function setRefundedAmount($refunded_amount) { + if (is_null($refunded_amount)) { + throw new \InvalidArgumentException('non-nullable refunded_amount cannot be null'); + } if (($refunded_amount < 0)) { throw new \InvalidArgumentException('invalid value for $refunded_amount when calling WTStaticVoucher., must be bigger than or equal to 0.'); @@ -920,6 +1062,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -944,6 +1089,9 @@ public function getCustomerId() */ public function setCustomerId($customer_id) { + if (is_null($customer_id)) { + throw new \InvalidArgumentException('non-nullable customer_id cannot be null'); + } $this->container['customer_id'] = $customer_id; return $this; @@ -968,6 +1116,9 @@ public function getAuthorizedAgainstCheckNumber() */ public function setAuthorizedAgainstCheckNumber($authorized_against_check_number) { + if (is_null($authorized_against_check_number)) { + throw new \InvalidArgumentException('non-nullable authorized_against_check_number cannot be null'); + } $this->container['authorized_against_check_number'] = $authorized_against_check_number; return $this; @@ -992,6 +1143,9 @@ public function getAuthorizedAmount() */ public function setAuthorizedAmount($authorized_amount) { + if (is_null($authorized_amount)) { + throw new \InvalidArgumentException('non-nullable authorized_amount cannot be null'); + } if (($authorized_amount < 0)) { throw new \InvalidArgumentException('invalid value for $authorized_amount when calling WTStaticVoucher., must be bigger than or equal to 0.'); @@ -1021,14 +1175,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTStaticVoucher., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTStaticVoucher., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTStaticVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTStaticVoucher., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -1055,6 +1212,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -1079,6 +1239,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -1103,6 +1266,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -1127,6 +1293,9 @@ public function getAuthorizedAmountDecimal() */ public function setAuthorizedAmountDecimal($authorized_amount_decimal) { + if (is_null($authorized_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable authorized_amount_decimal cannot be null'); + } $this->container['authorized_amount_decimal'] = $authorized_amount_decimal; return $this; @@ -1151,6 +1320,9 @@ public function getAuthorizedAmountString() */ public function setAuthorizedAmountString($authorized_amount_string) { + if (is_null($authorized_amount_string)) { + throw new \InvalidArgumentException('non-nullable authorized_amount_string cannot be null'); + } $this->container['authorized_amount_string'] = $authorized_amount_string; return $this; @@ -1175,6 +1347,9 @@ public function getOfferAmountCentsDecimal() */ public function setOfferAmountCentsDecimal($offer_amount_cents_decimal) { + if (is_null($offer_amount_cents_decimal)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents_decimal cannot be null'); + } $this->container['offer_amount_cents_decimal'] = $offer_amount_cents_decimal; return $this; @@ -1199,6 +1374,9 @@ public function getOfferAmountCentsString() */ public function setOfferAmountCentsString($offer_amount_cents_string) { + if (is_null($offer_amount_cents_string)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents_string cannot be null'); + } $this->container['offer_amount_cents_string'] = $offer_amount_cents_string; return $this; @@ -1223,6 +1401,9 @@ public function getRedeemedAmountDecimal() */ public function setRedeemedAmountDecimal($redeemed_amount_decimal) { + if (is_null($redeemed_amount_decimal)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount_decimal cannot be null'); + } $this->container['redeemed_amount_decimal'] = $redeemed_amount_decimal; return $this; @@ -1247,6 +1428,9 @@ public function getRedeemedAmountString() */ public function setRedeemedAmountString($redeemed_amount_string) { + if (is_null($redeemed_amount_string)) { + throw new \InvalidArgumentException('non-nullable redeemed_amount_string cannot be null'); + } $this->container['redeemed_amount_string'] = $redeemed_amount_string; return $this; @@ -1271,6 +1455,16 @@ public function getDateTimeRedeemed() */ public function setDateTimeRedeemed($date_time_redeemed) { + if (is_null($date_time_redeemed)) { + array_push($this->openAPINullablesSetToNull, 'date_time_redeemed'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_time_redeemed', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['date_time_redeemed'] = $date_time_redeemed; return $this; @@ -1295,6 +1489,16 @@ public function getDateTimeRefunded() */ public function setDateTimeRefunded($date_time_refunded) { + if (is_null($date_time_refunded)) { + array_push($this->openAPINullablesSetToNull, 'date_time_refunded'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_time_refunded', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['date_time_refunded'] = $date_time_refunded; return $this; @@ -1319,6 +1523,16 @@ public function getDateTimeLastViewed() */ public function setDateTimeLastViewed($date_time_last_viewed) { + if (is_null($date_time_last_viewed)) { + array_push($this->openAPINullablesSetToNull, 'date_time_last_viewed'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_time_last_viewed', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } $this->container['date_time_last_viewed'] = $date_time_last_viewed; return $this; @@ -1343,6 +1557,9 @@ public function getReasonInvalid() */ public function setReasonInvalid($reason_invalid) { + if (is_null($reason_invalid)) { + throw new \InvalidArgumentException('non-nullable reason_invalid cannot be null'); + } $this->container['reason_invalid'] = $reason_invalid; return $this; @@ -1354,7 +1571,7 @@ public function setReasonInvalid($reason_invalid) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1366,6 +1583,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1379,7 +1597,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1395,7 +1613,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1407,6 +1625,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTStaticVoucherCampaign.php b/lib/Model/WTStaticVoucherCampaign.php index 55cb060..c535054 100644 --- a/lib/Model/WTStaticVoucherCampaign.php +++ b/lib/Model/WTStaticVoucherCampaign.php @@ -2,7 +2,7 @@ /** * WTStaticVoucherCampaign * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTStaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,10 +58,10 @@ class WTStaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'title' => 'string', 'notes' => 'string', - 'value_type' => 'string', + 'value_type' => '\OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType', 'is_loaded' => 'bool', 'display_value' => 'string', 'merchants_reference_id' => 'string', @@ -80,7 +78,7 @@ class WTStaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonSeria 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', - 'voucher_type' => 'double', + 'voucher_type' => 'float', 'reinvestment_sum_decimal' => 'string', 'reinvestment_sum_string' => 'string', 'start_date' => '\DateTime', @@ -122,6 +120,46 @@ class WTStaticVoucherCampaign implements ModelInterface, ArrayAccess, \JsonSeria 'expiration_date' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'title' => false, + 'notes' => false, + 'value_type' => false, + 'is_loaded' => false, + 'display_value' => false, + 'merchants_reference_id' => false, + 'valid_only_at_pos_register_ids' => false, + 'payment_design_id' => false, + 'employee_id' => false, + 'reinvestment_sum' => false, + 'number_of_vouchers_in_file' => false, + 'campaign_group_id' => false, + 'bucket' => false, + 'created_by_source_id' => false, + 'original_file_name' => false, + 'merchant_id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'voucher_type' => false, + 'reinvestment_sum_decimal' => false, + 'reinvestment_sum_string' => false, + 'start_date' => false, + 'expiration_date' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -142,6 +180,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -299,31 +389,49 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['title'] = $data['title'] ?? null; - $this->container['notes'] = $data['notes'] ?? null; - $this->container['value_type'] = $data['value_type'] ?? null; - $this->container['is_loaded'] = $data['is_loaded'] ?? null; - $this->container['display_value'] = $data['display_value'] ?? null; - $this->container['merchants_reference_id'] = $data['merchants_reference_id'] ?? null; - $this->container['valid_only_at_pos_register_ids'] = $data['valid_only_at_pos_register_ids'] ?? null; - $this->container['payment_design_id'] = $data['payment_design_id'] ?? null; - $this->container['employee_id'] = $data['employee_id'] ?? null; - $this->container['reinvestment_sum'] = $data['reinvestment_sum'] ?? null; - $this->container['number_of_vouchers_in_file'] = $data['number_of_vouchers_in_file'] ?? null; - $this->container['campaign_group_id'] = $data['campaign_group_id'] ?? null; - $this->container['bucket'] = $data['bucket'] ?? null; - $this->container['created_by_source_id'] = $data['created_by_source_id'] ?? null; - $this->container['original_file_name'] = $data['original_file_name'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['voucher_type'] = $data['voucher_type'] ?? null; - $this->container['reinvestment_sum_decimal'] = $data['reinvestment_sum_decimal'] ?? null; - $this->container['reinvestment_sum_string'] = $data['reinvestment_sum_string'] ?? null; - $this->container['start_date'] = $data['start_date'] ?? null; - $this->container['expiration_date'] = $data['expiration_date'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + $this->setIfExists('value_type', $data ?? [], null); + $this->setIfExists('is_loaded', $data ?? [], null); + $this->setIfExists('display_value', $data ?? [], null); + $this->setIfExists('merchants_reference_id', $data ?? [], null); + $this->setIfExists('valid_only_at_pos_register_ids', $data ?? [], null); + $this->setIfExists('payment_design_id', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('reinvestment_sum', $data ?? [], null); + $this->setIfExists('number_of_vouchers_in_file', $data ?? [], null); + $this->setIfExists('campaign_group_id', $data ?? [], null); + $this->setIfExists('bucket', $data ?? [], null); + $this->setIfExists('created_by_source_id', $data ?? [], null); + $this->setIfExists('original_file_name', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('voucher_type', $data ?? [], null); + $this->setIfExists('reinvestment_sum_decimal', $data ?? [], null); + $this->setIfExists('reinvestment_sum_string', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('expiration_date', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -338,14 +446,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['title'] === null) { $invalidProperties[] = "'title' can't be null"; } @@ -478,7 +578,7 @@ public function valid() /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -488,19 +588,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTStaticVoucherCampaign., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTStaticVoucherCampaign., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -525,6 +621,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTStaticVoucherCampaign., must be bigger than or equal to 1.'); @@ -554,6 +653,9 @@ public function getNotes() */ public function setNotes($notes) { + if (is_null($notes)) { + throw new \InvalidArgumentException('non-nullable notes cannot be null'); + } $this->container['notes'] = $notes; return $this; @@ -562,7 +664,7 @@ public function setNotes($notes) /** * Gets value_type * - * @return string + * @return \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType */ public function getValueType() { @@ -572,12 +674,15 @@ public function getValueType() /** * Sets value_type * - * @param string $value_type value_type + * @param \OpenAPI\Client\Model\PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueType $value_type value_type * * @return self */ public function setValueType($value_type) { + if (is_null($value_type)) { + throw new \InvalidArgumentException('non-nullable value_type cannot be null'); + } $this->container['value_type'] = $value_type; return $this; @@ -602,6 +707,9 @@ public function getIsLoaded() */ public function setIsLoaded($is_loaded) { + if (is_null($is_loaded)) { + throw new \InvalidArgumentException('non-nullable is_loaded cannot be null'); + } $this->container['is_loaded'] = $is_loaded; return $this; @@ -626,6 +734,9 @@ public function getDisplayValue() */ public function setDisplayValue($display_value) { + if (is_null($display_value)) { + throw new \InvalidArgumentException('non-nullable display_value cannot be null'); + } $this->container['display_value'] = $display_value; return $this; @@ -650,6 +761,9 @@ public function getMerchantsReferenceId() */ public function setMerchantsReferenceId($merchants_reference_id) { + if (is_null($merchants_reference_id)) { + throw new \InvalidArgumentException('non-nullable merchants_reference_id cannot be null'); + } $this->container['merchants_reference_id'] = $merchants_reference_id; return $this; @@ -674,6 +788,9 @@ public function getValidOnlyAtPosRegisterIds() */ public function setValidOnlyAtPosRegisterIds($valid_only_at_pos_register_ids) { + if (is_null($valid_only_at_pos_register_ids)) { + throw new \InvalidArgumentException('non-nullable valid_only_at_pos_register_ids cannot be null'); + } $this->container['valid_only_at_pos_register_ids'] = $valid_only_at_pos_register_ids; return $this; @@ -698,14 +815,17 @@ public function getPaymentDesignId() */ public function setPaymentDesignId($payment_design_id) { + if (is_null($payment_design_id)) { + throw new \InvalidArgumentException('non-nullable payment_design_id cannot be null'); + } if ((mb_strlen($payment_design_id) > 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTStaticVoucherCampaign., must be smaller than or equal to 10.'); } if ((mb_strlen($payment_design_id) < 10)) { throw new \InvalidArgumentException('invalid length for $payment_design_id when calling WTStaticVoucherCampaign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $payment_design_id))) { - throw new \InvalidArgumentException("invalid value for $payment_design_id when calling WTStaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($payment_design_id)))) { + throw new \InvalidArgumentException("invalid value for \$payment_design_id when calling WTStaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['payment_design_id'] = $payment_design_id; @@ -732,14 +852,17 @@ public function getEmployeeId() */ public function setEmployeeId($employee_id) { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } if ((mb_strlen($employee_id) > 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTStaticVoucherCampaign., must be smaller than or equal to 10.'); } if ((mb_strlen($employee_id) < 10)) { throw new \InvalidArgumentException('invalid length for $employee_id when calling WTStaticVoucherCampaign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $employee_id))) { - throw new \InvalidArgumentException("invalid value for $employee_id when calling WTStaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($employee_id)))) { + throw new \InvalidArgumentException("invalid value for \$employee_id when calling WTStaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['employee_id'] = $employee_id; @@ -766,6 +889,9 @@ public function getReinvestmentSum() */ public function setReinvestmentSum($reinvestment_sum) { + if (is_null($reinvestment_sum)) { + throw new \InvalidArgumentException('non-nullable reinvestment_sum cannot be null'); + } if (($reinvestment_sum < 0)) { throw new \InvalidArgumentException('invalid value for $reinvestment_sum when calling WTStaticVoucherCampaign., must be bigger than or equal to 0.'); @@ -795,6 +921,9 @@ public function getNumberOfVouchersInFile() */ public function setNumberOfVouchersInFile($number_of_vouchers_in_file) { + if (is_null($number_of_vouchers_in_file)) { + throw new \InvalidArgumentException('non-nullable number_of_vouchers_in_file cannot be null'); + } if (($number_of_vouchers_in_file < 0)) { throw new \InvalidArgumentException('invalid value for $number_of_vouchers_in_file when calling WTStaticVoucherCampaign., must be bigger than or equal to 0.'); @@ -824,14 +953,17 @@ public function getCampaignGroupId() */ public function setCampaignGroupId($campaign_group_id) { - if (!is_null($campaign_group_id) && (mb_strlen($campaign_group_id) > 10)) { + if (is_null($campaign_group_id)) { + throw new \InvalidArgumentException('non-nullable campaign_group_id cannot be null'); + } + if ((mb_strlen($campaign_group_id) > 10)) { throw new \InvalidArgumentException('invalid length for $campaign_group_id when calling WTStaticVoucherCampaign., must be smaller than or equal to 10.'); } - if (!is_null($campaign_group_id) && (mb_strlen($campaign_group_id) < 10)) { + if ((mb_strlen($campaign_group_id) < 10)) { throw new \InvalidArgumentException('invalid length for $campaign_group_id when calling WTStaticVoucherCampaign., must be bigger than or equal to 10.'); } - if (!is_null($campaign_group_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $campaign_group_id))) { - throw new \InvalidArgumentException("invalid value for $campaign_group_id when calling WTStaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($campaign_group_id)))) { + throw new \InvalidArgumentException("invalid value for \$campaign_group_id when calling WTStaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['campaign_group_id'] = $campaign_group_id; @@ -858,6 +990,9 @@ public function getBucket() */ public function setBucket($bucket) { + if (is_null($bucket)) { + throw new \InvalidArgumentException('non-nullable bucket cannot be null'); + } $this->container['bucket'] = $bucket; return $this; @@ -882,6 +1017,9 @@ public function getCreatedBySourceId() */ public function setCreatedBySourceId($created_by_source_id) { + if (is_null($created_by_source_id)) { + throw new \InvalidArgumentException('non-nullable created_by_source_id cannot be null'); + } $this->container['created_by_source_id'] = $created_by_source_id; return $this; @@ -906,6 +1044,9 @@ public function getOriginalFileName() */ public function setOriginalFileName($original_file_name) { + if (is_null($original_file_name)) { + throw new \InvalidArgumentException('non-nullable original_file_name cannot be null'); + } $this->container['original_file_name'] = $original_file_name; return $this; @@ -930,14 +1071,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTStaticVoucherCampaign., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTStaticVoucherCampaign., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTStaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTStaticVoucherCampaign., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -964,6 +1108,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -988,6 +1135,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -1012,6 +1162,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -1020,7 +1173,7 @@ public function setIsActive($is_active) /** * Gets voucher_type * - * @return double + * @return float */ public function getVoucherType() { @@ -1030,12 +1183,15 @@ public function getVoucherType() /** * Sets voucher_type * - * @param double $voucher_type voucher_type + * @param float $voucher_type voucher_type * * @return self */ public function setVoucherType($voucher_type) { + if (is_null($voucher_type)) { + throw new \InvalidArgumentException('non-nullable voucher_type cannot be null'); + } $this->container['voucher_type'] = $voucher_type; return $this; @@ -1060,6 +1216,9 @@ public function getReinvestmentSumDecimal() */ public function setReinvestmentSumDecimal($reinvestment_sum_decimal) { + if (is_null($reinvestment_sum_decimal)) { + throw new \InvalidArgumentException('non-nullable reinvestment_sum_decimal cannot be null'); + } $this->container['reinvestment_sum_decimal'] = $reinvestment_sum_decimal; return $this; @@ -1084,6 +1243,9 @@ public function getReinvestmentSumString() */ public function setReinvestmentSumString($reinvestment_sum_string) { + if (is_null($reinvestment_sum_string)) { + throw new \InvalidArgumentException('non-nullable reinvestment_sum_string cannot be null'); + } $this->container['reinvestment_sum_string'] = $reinvestment_sum_string; return $this; @@ -1108,6 +1270,9 @@ public function getStartDate() */ public function setStartDate($start_date) { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } $this->container['start_date'] = $start_date; return $this; @@ -1132,6 +1297,9 @@ public function getExpirationDate() */ public function setExpirationDate($expiration_date) { + if (is_null($expiration_date)) { + throw new \InvalidArgumentException('non-nullable expiration_date cannot be null'); + } $this->container['expiration_date'] = $expiration_date; return $this; @@ -1143,7 +1311,7 @@ public function setExpirationDate($expiration_date) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1155,6 +1323,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1168,7 +1337,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1184,7 +1353,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1196,6 +1365,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTStaticVoucherCampaignPreviewMessages.php b/lib/Model/WTStaticVoucherCampaignPreviewMessages.php index 8950377..aa227b2 100644 --- a/lib/Model/WTStaticVoucherCampaignPreviewMessages.php +++ b/lib/Model/WTStaticVoucherCampaignPreviewMessages.php @@ -2,7 +2,7 @@ /** * WTStaticVoucherCampaignPreviewMessages * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTStaticVoucherCampaignPreviewMessages implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTStaticVoucherCampaignPreviewMessages implements ModelInterface, ArrayAcc 'timezone' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false, + 'locale' => false, + 'timezone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['message'] = $data['message'] ?? null; - $this->container['locale'] = $data['locale'] ?? null; - $this->container['timezone'] = $data['timezone'] ?? null; + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('timezone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +332,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -270,6 +359,9 @@ public function getLocale() */ public function setLocale($locale) { + if (is_null($locale)) { + throw new \InvalidArgumentException('non-nullable locale cannot be null'); + } $this->container['locale'] = $locale; return $this; @@ -294,6 +386,9 @@ public function getTimezone() */ public function setTimezone($timezone) { + if (is_null($timezone)) { + throw new \InvalidArgumentException('non-nullable timezone cannot be null'); + } $this->container['timezone'] = $timezone; return $this; @@ -305,7 +400,7 @@ public function setTimezone($timezone) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTStaticVoucherCampaignPreviewMessagesByPage.php b/lib/Model/WTStaticVoucherCampaignPreviewMessagesByPage.php index 5f2a96c..70951f0 100644 --- a/lib/Model/WTStaticVoucherCampaignPreviewMessagesByPage.php +++ b/lib/Model/WTStaticVoucherCampaignPreviewMessagesByPage.php @@ -2,7 +2,7 @@ /** * WTStaticVoucherCampaignPreviewMessagesByPage * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTStaticVoucherCampaignPreviewMessagesByPage implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,8 +61,8 @@ class WTStaticVoucherCampaignPreviewMessagesByPage implements ModelInterface, Ar 'message' => 'string', 'locale' => 'string', 'timezone' => 'string', - 'page_num' => 'double', - 'page_size' => 'double' + 'page_num' => 'float', + 'page_size' => 'float' ]; /** @@ -82,6 +80,26 @@ class WTStaticVoucherCampaignPreviewMessagesByPage implements ModelInterface, Ar 'page_size' => 'double' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'message' => false, + 'locale' => false, + 'timezone' => false, + 'page_num' => false, + 'page_size' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['message'] = $data['message'] ?? null; - $this->container['locale'] = $data['locale'] ?? null; - $this->container['timezone'] = $data['timezone'] ?? null; - $this->container['page_num'] = $data['page_num'] ?? null; - $this->container['page_size'] = $data['page_size'] ?? null; + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('locale', $data ?? [], null); + $this->setIfExists('timezone', $data ?? [], null); + $this->setIfExists('page_num', $data ?? [], null); + $this->setIfExists('page_size', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -264,6 +352,9 @@ public function getMessage() */ public function setMessage($message) { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } $this->container['message'] = $message; return $this; @@ -288,6 +379,9 @@ public function getLocale() */ public function setLocale($locale) { + if (is_null($locale)) { + throw new \InvalidArgumentException('non-nullable locale cannot be null'); + } $this->container['locale'] = $locale; return $this; @@ -312,6 +406,9 @@ public function getTimezone() */ public function setTimezone($timezone) { + if (is_null($timezone)) { + throw new \InvalidArgumentException('non-nullable timezone cannot be null'); + } $this->container['timezone'] = $timezone; return $this; @@ -320,7 +417,7 @@ public function setTimezone($timezone) /** * Gets page_num * - * @return double + * @return float */ public function getPageNum() { @@ -330,12 +427,15 @@ public function getPageNum() /** * Sets page_num * - * @param double $page_num page_num + * @param float $page_num page_num * * @return self */ public function setPageNum($page_num) { + if (is_null($page_num)) { + throw new \InvalidArgumentException('non-nullable page_num cannot be null'); + } $this->container['page_num'] = $page_num; return $this; @@ -344,7 +444,7 @@ public function setPageNum($page_num) /** * Gets page_size * - * @return double + * @return float */ public function getPageSize() { @@ -354,12 +454,15 @@ public function getPageSize() /** * Sets page_size * - * @param double $page_size page_size + * @param float $page_size page_size * * @return self */ public function setPageSize($page_size) { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } $this->container['page_size'] = $page_size; return $this; @@ -371,7 +474,7 @@ public function setPageSize($page_size) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -383,6 +486,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -396,7 +500,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -412,7 +516,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -424,6 +528,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTStaticVoucherCreateParams.php b/lib/Model/WTStaticVoucherCreateParams.php index 310aaa9..dc1d99d 100644 --- a/lib/Model/WTStaticVoucherCreateParams.php +++ b/lib/Model/WTStaticVoucherCreateParams.php @@ -2,7 +2,7 @@ /** * WTStaticVoucherCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTStaticVoucherCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -63,7 +61,7 @@ class WTStaticVoucherCreateParams implements ModelInterface, ArrayAccess, \JsonS 'offer_amount_cents' => 'int', 'member_id' => 'string', 'cell_phone' => 'string', - 'campaign_id' => 'string' + 'campaign_id' => '\OpenAPI\Client\Model\WTWalletPageViewId' ]; /** @@ -80,6 +78,25 @@ class WTStaticVoucherCreateParams implements ModelInterface, ArrayAccess, \JsonS 'campaign_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'offer_amount_cents' => false, + 'member_id' => false, + 'cell_phone' => false, + 'campaign_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +117,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -194,10 +263,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['offer_amount_cents'] = $data['offer_amount_cents'] ?? null; - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['cell_phone'] = $data['cell_phone'] ?? null; - $this->container['campaign_id'] = $data['campaign_id'] ?? null; + $this->setIfExists('offer_amount_cents', $data ?? [], null); + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('cell_phone', $data ?? [], null); + $this->setIfExists('campaign_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -230,14 +317,6 @@ public function listInvalidProperties() if ($this->container['campaign_id'] === null) { $invalidProperties[] = "'campaign_id' can't be null"; } - if ((mb_strlen($this->container['campaign_id']) > 12)) { - $invalidProperties[] = "invalid value for 'campaign_id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['campaign_id']) < 10)) { - $invalidProperties[] = "invalid value for 'campaign_id', the character length must be bigger than or equal to 10."; - } - return $invalidProperties; } @@ -272,6 +351,9 @@ public function getOfferAmountCents() */ public function setOfferAmountCents($offer_amount_cents) { + if (is_null($offer_amount_cents)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents cannot be null'); + } if (($offer_amount_cents < 0)) { throw new \InvalidArgumentException('invalid value for $offer_amount_cents when calling WTStaticVoucherCreateParams., must be bigger than or equal to 0.'); @@ -301,9 +383,12 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling WTStaticVoucherCreateParams., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling WTStaticVoucherCreateParams., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -330,6 +415,9 @@ public function getCellPhone() */ public function setCellPhone($cell_phone) { + if (is_null($cell_phone)) { + throw new \InvalidArgumentException('non-nullable cell_phone cannot be null'); + } if ((mb_strlen($cell_phone) < 10)) { throw new \InvalidArgumentException('invalid length for $cell_phone when calling WTStaticVoucherCreateParams., must be bigger than or equal to 10.'); @@ -343,7 +431,7 @@ public function setCellPhone($cell_phone) /** * Gets campaign_id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getCampaignId() { @@ -353,19 +441,15 @@ public function getCampaignId() /** * Sets campaign_id * - * @param string $campaign_id campaign_id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $campaign_id campaign_id * * @return self */ public function setCampaignId($campaign_id) { - if ((mb_strlen($campaign_id) > 12)) { - throw new \InvalidArgumentException('invalid length for $campaign_id when calling WTStaticVoucherCreateParams., must be smaller than or equal to 12.'); - } - if ((mb_strlen($campaign_id) < 10)) { - throw new \InvalidArgumentException('invalid length for $campaign_id when calling WTStaticVoucherCreateParams., must be bigger than or equal to 10.'); + if (is_null($campaign_id)) { + throw new \InvalidArgumentException('non-nullable campaign_id cannot be null'); } - $this->container['campaign_id'] = $campaign_id; return $this; @@ -377,7 +461,7 @@ public function setCampaignId($campaign_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -389,6 +473,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -402,7 +487,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -418,7 +503,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -430,6 +515,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTStaticVoucherUpdateParams.php b/lib/Model/WTStaticVoucherUpdateParams.php index b9240c1..472f963 100644 --- a/lib/Model/WTStaticVoucherUpdateParams.php +++ b/lib/Model/WTStaticVoucherUpdateParams.php @@ -2,7 +2,7 @@ /** * WTStaticVoucherUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTStaticVoucherUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTStaticVoucherUpdateParams implements ModelInterface, ArrayAccess, \JsonS 'cell_phone' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'member_id' => false, + 'offer_amount_cents' => false, + 'cell_phone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['member_id'] = $data['member_id'] ?? null; - $this->container['offer_amount_cents'] = $data['offer_amount_cents'] ?? null; - $this->container['cell_phone'] = $data['cell_phone'] ?? null; + $this->setIfExists('member_id', $data ?? [], null); + $this->setIfExists('offer_amount_cents', $data ?? [], null); + $this->setIfExists('cell_phone', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -255,9 +341,12 @@ public function getMemberId() */ public function setMemberId($member_id) { + if (is_null($member_id)) { + throw new \InvalidArgumentException('non-nullable member_id cannot be null'); + } - if (!is_null($member_id) && (!preg_match("/^[a-zA-Z0-9]*$/", $member_id))) { - throw new \InvalidArgumentException("invalid value for $member_id when calling WTStaticVoucherUpdateParams., must conform to the pattern /^[a-zA-Z0-9]*$/."); + if ((!preg_match("/^[a-zA-Z0-9]*$/", ObjectSerializer::toString($member_id)))) { + throw new \InvalidArgumentException("invalid value for \$member_id when calling WTStaticVoucherUpdateParams., must conform to the pattern /^[a-zA-Z0-9]*$/."); } $this->container['member_id'] = $member_id; @@ -284,6 +373,9 @@ public function getOfferAmountCents() */ public function setOfferAmountCents($offer_amount_cents) { + if (is_null($offer_amount_cents)) { + throw new \InvalidArgumentException('non-nullable offer_amount_cents cannot be null'); + } if (($offer_amount_cents < 0)) { throw new \InvalidArgumentException('invalid value for $offer_amount_cents when calling WTStaticVoucherUpdateParams., must be bigger than or equal to 0.'); @@ -313,6 +405,9 @@ public function getCellPhone() */ public function setCellPhone($cell_phone) { + if (is_null($cell_phone)) { + throw new \InvalidArgumentException('non-nullable cell_phone cannot be null'); + } if ((mb_strlen($cell_phone) < 10)) { throw new \InvalidArgumentException('invalid length for $cell_phone when calling WTStaticVoucherUpdateParams., must be bigger than or equal to 10.'); @@ -329,7 +424,7 @@ public function setCellPhone($cell_phone) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -341,6 +436,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -354,7 +450,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -370,7 +466,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -382,6 +478,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTSystemApprovePhoneNumber.php b/lib/Model/WTSystemApprovePhoneNumber.php index 38bd079..2b7260c 100644 --- a/lib/Model/WTSystemApprovePhoneNumber.php +++ b/lib/Model/WTSystemApprovePhoneNumber.php @@ -2,7 +2,7 @@ /** * WTSystemApprovePhoneNumber * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTSystemApprovePhoneNumber implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTSystemApprovePhoneNumber implements ModelInterface, ArrayAccess, \JsonSe 'phone_number_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'merchant_id' => false, + 'phone_number_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['phone_number_id'] = $data['phone_number_id'] ?? null; + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('phone_number_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -261,14 +346,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTSystemApprovePhoneNumber., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTSystemApprovePhoneNumber., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTSystemApprovePhoneNumber., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTSystemApprovePhoneNumber., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -295,14 +383,17 @@ public function getPhoneNumberId() */ public function setPhoneNumberId($phone_number_id) { + if (is_null($phone_number_id)) { + throw new \InvalidArgumentException('non-nullable phone_number_id cannot be null'); + } if ((mb_strlen($phone_number_id) > 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTSystemApprovePhoneNumber., must be smaller than or equal to 10.'); } if ((mb_strlen($phone_number_id) < 10)) { throw new \InvalidArgumentException('invalid length for $phone_number_id when calling WTSystemApprovePhoneNumber., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $phone_number_id))) { - throw new \InvalidArgumentException("invalid value for $phone_number_id when calling WTSystemApprovePhoneNumber., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($phone_number_id)))) { + throw new \InvalidArgumentException("invalid value for \$phone_number_id when calling WTSystemApprovePhoneNumber., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['phone_number_id'] = $phone_number_id; @@ -316,7 +407,7 @@ public function setPhoneNumberId($phone_number_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -328,6 +419,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -341,7 +433,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -357,7 +449,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -369,6 +461,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTSystemRoleCreate.php b/lib/Model/WTSystemRoleCreate.php index a1bfc1a..4a678b7 100644 --- a/lib/Model/WTSystemRoleCreate.php +++ b/lib/Model/WTSystemRoleCreate.php @@ -2,7 +2,7 @@ /** * WTSystemRoleCreate * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTSystemRoleCreate implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTSystemRoleCreate implements ModelInterface, ArrayAccess, \JsonSerializab 'webpages_to_add' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'display_name' => false, + 'webpages_to_add' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['display_name'] = $data['display_name'] ?? null; - $this->container['webpages_to_add'] = $data['webpages_to_add'] ?? null; + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('webpages_to_add', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -237,6 +322,9 @@ public function getDisplayName() */ public function setDisplayName($display_name) { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } $this->container['display_name'] = $display_name; return $this; @@ -261,6 +349,9 @@ public function getWebpagesToAdd() */ public function setWebpagesToAdd($webpages_to_add) { + if (is_null($webpages_to_add)) { + throw new \InvalidArgumentException('non-nullable webpages_to_add cannot be null'); + } $this->container['webpages_to_add'] = $webpages_to_add; return $this; @@ -272,7 +363,7 @@ public function setWebpagesToAdd($webpages_to_add) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -284,6 +375,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -297,7 +389,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -313,7 +405,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -325,6 +417,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTTCPAOpt.php b/lib/Model/WTTCPAOpt.php index 60d2680..66819f4 100644 --- a/lib/Model/WTTCPAOpt.php +++ b/lib/Model/WTTCPAOpt.php @@ -2,7 +2,7 @@ /** * WTTCPAOpt * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTTCPAOpt implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,8 +58,8 @@ class WTTCPAOpt implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'list_id' => 'string', - 'source_id' => 'string', + 'list_id' => '\OpenAPI\Client\Model\WTTCPAOptListID', + 'source_id' => '\OpenAPI\Client\Model\WTTCPAOptSourceID', 'phone_number' => 'string' ]; @@ -78,6 +76,24 @@ class WTTCPAOpt implements ModelInterface, ArrayAccess, \JsonSerializable 'phone_number' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'list_id' => false, + 'source_id' => false, + 'phone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['list_id'] = $data['list_id'] ?? null; - $this->container['source_id'] = $data['source_id'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; + $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('source_id', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -230,7 +316,7 @@ public function valid() /** * Gets list_id * - * @return string + * @return \OpenAPI\Client\Model\WTTCPAOptListID */ public function getListId() { @@ -240,12 +326,15 @@ public function getListId() /** * Sets list_id * - * @param string $list_id list_id + * @param \OpenAPI\Client\Model\WTTCPAOptListID $list_id list_id * * @return self */ public function setListId($list_id) { + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + } $this->container['list_id'] = $list_id; return $this; @@ -254,7 +343,7 @@ public function setListId($list_id) /** * Gets source_id * - * @return string + * @return \OpenAPI\Client\Model\WTTCPAOptSourceID */ public function getSourceId() { @@ -264,12 +353,15 @@ public function getSourceId() /** * Sets source_id * - * @param string $source_id source_id + * @param \OpenAPI\Client\Model\WTTCPAOptSourceID $source_id source_id * * @return self */ public function setSourceId($source_id) { + if (is_null($source_id)) { + throw new \InvalidArgumentException('non-nullable source_id cannot be null'); + } $this->container['source_id'] = $source_id; return $this; @@ -294,6 +386,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -305,7 +400,7 @@ public function setPhoneNumber($phone_number) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTTCPAOptListID.php b/lib/Model/WTTCPAOptListID.php new file mode 100644 index 0000000..81b165e --- /dev/null +++ b/lib/Model/WTTCPAOptListID.php @@ -0,0 +1,382 @@ + + */ +class WTTCPAOptListID implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTTCPAOpt_listID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTTCPAOptSourceID.php b/lib/Model/WTTCPAOptSourceID.php new file mode 100644 index 0000000..3d67e01 --- /dev/null +++ b/lib/Model/WTTCPAOptSourceID.php @@ -0,0 +1,382 @@ + + */ +class WTTCPAOptSourceID implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTTCPAOpt_sourceID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WTTicket.php b/lib/Model/WTTicket.php index 5827f9e..88d7b73 100644 --- a/lib/Model/WTTicket.php +++ b/lib/Model/WTTicket.php @@ -2,7 +2,7 @@ /** * WTTicket * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTTicket implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,9 +62,9 @@ class WTTicket implements ModelInterface, ArrayAccess, \JsonSerializable 'recipient_email_address' => 'string', 'recipient_member_id' => 'string', 'is_comp' => 'bool', - 'quantity' => 'double', + 'quantity' => 'float', 'performance_id' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID', 'created_at' => '\DateTime', 'updated_at' => '\DateTime', 'is_active' => 'bool', @@ -112,6 +110,41 @@ class WTTicket implements ModelInterface, ArrayAccess, \JsonSerializable 'date_time_redeemed' => 'date-time' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'recipient_phone_number' => false, + 'recipient_email_address' => false, + 'recipient_member_id' => false, + 'is_comp' => false, + 'quantity' => false, + 'performance_id' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'is_active' => false, + 'merchant_id' => false, + 'is_claimed' => false, + 'date_time_claimed' => false, + 'claimed_by_phone_number' => false, + 'redeemed_source' => false, + 'redeemed_transaction_id' => false, + 'transaction_type' => false, + 'register_id' => false, + 'is_redeemed' => false, + 'date_time_redeemed' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -132,6 +165,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -274,26 +359,44 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['recipient_phone_number'] = $data['recipient_phone_number'] ?? null; - $this->container['recipient_email_address'] = $data['recipient_email_address'] ?? null; - $this->container['recipient_member_id'] = $data['recipient_member_id'] ?? null; - $this->container['is_comp'] = $data['is_comp'] ?? null; - $this->container['quantity'] = $data['quantity'] ?? null; - $this->container['performance_id'] = $data['performance_id'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['is_claimed'] = $data['is_claimed'] ?? null; - $this->container['date_time_claimed'] = $data['date_time_claimed'] ?? null; - $this->container['claimed_by_phone_number'] = $data['claimed_by_phone_number'] ?? null; - $this->container['redeemed_source'] = $data['redeemed_source'] ?? null; - $this->container['redeemed_transaction_id'] = $data['redeemed_transaction_id'] ?? null; - $this->container['transaction_type'] = $data['transaction_type'] ?? null; - $this->container['register_id'] = $data['register_id'] ?? null; - $this->container['is_redeemed'] = $data['is_redeemed'] ?? null; - $this->container['date_time_redeemed'] = $data['date_time_redeemed'] ?? null; + $this->setIfExists('recipient_phone_number', $data ?? [], null); + $this->setIfExists('recipient_email_address', $data ?? [], null); + $this->setIfExists('recipient_member_id', $data ?? [], null); + $this->setIfExists('is_comp', $data ?? [], null); + $this->setIfExists('quantity', $data ?? [], null); + $this->setIfExists('performance_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('is_claimed', $data ?? [], null); + $this->setIfExists('date_time_claimed', $data ?? [], null); + $this->setIfExists('claimed_by_phone_number', $data ?? [], null); + $this->setIfExists('redeemed_source', $data ?? [], null); + $this->setIfExists('redeemed_transaction_id', $data ?? [], null); + $this->setIfExists('transaction_type', $data ?? [], null); + $this->setIfExists('register_id', $data ?? [], null); + $this->setIfExists('is_redeemed', $data ?? [], null); + $this->setIfExists('date_time_redeemed', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -373,6 +476,9 @@ public function getRecipientPhoneNumber() */ public function setRecipientPhoneNumber($recipient_phone_number) { + if (is_null($recipient_phone_number)) { + throw new \InvalidArgumentException('non-nullable recipient_phone_number cannot be null'); + } $this->container['recipient_phone_number'] = $recipient_phone_number; return $this; @@ -397,6 +503,9 @@ public function getRecipientEmailAddress() */ public function setRecipientEmailAddress($recipient_email_address) { + if (is_null($recipient_email_address)) { + throw new \InvalidArgumentException('non-nullable recipient_email_address cannot be null'); + } $this->container['recipient_email_address'] = $recipient_email_address; return $this; @@ -421,6 +530,9 @@ public function getRecipientMemberId() */ public function setRecipientMemberId($recipient_member_id) { + if (is_null($recipient_member_id)) { + throw new \InvalidArgumentException('non-nullable recipient_member_id cannot be null'); + } $this->container['recipient_member_id'] = $recipient_member_id; return $this; @@ -445,6 +557,9 @@ public function getIsComp() */ public function setIsComp($is_comp) { + if (is_null($is_comp)) { + throw new \InvalidArgumentException('non-nullable is_comp cannot be null'); + } $this->container['is_comp'] = $is_comp; return $this; @@ -453,7 +568,7 @@ public function setIsComp($is_comp) /** * Gets quantity * - * @return double|null + * @return float|null */ public function getQuantity() { @@ -463,14 +578,17 @@ public function getQuantity() /** * Sets quantity * - * @param double|null $quantity The number of tickets allocated to the recipient. + * @param float|null $quantity The number of tickets allocated to the recipient. * * @return self */ public function setQuantity($quantity) { + if (is_null($quantity)) { + throw new \InvalidArgumentException('non-nullable quantity cannot be null'); + } - if (!is_null($quantity) && ($quantity < 1)) { + if (($quantity < 1)) { throw new \InvalidArgumentException('invalid value for $quantity when calling WTTicket., must be bigger than or equal to 1.'); } @@ -498,6 +616,9 @@ public function getPerformanceId() */ public function setPerformanceId($performance_id) { + if (is_null($performance_id)) { + throw new \InvalidArgumentException('non-nullable performance_id cannot be null'); + } $this->container['performance_id'] = $performance_id; return $this; @@ -506,7 +627,7 @@ public function setPerformanceId($performance_id) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID */ public function getId() { @@ -516,12 +637,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\SaveTicketSettingsRequestPaymentDesignID $id id * * @return self */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } $this->container['id'] = $id; return $this; @@ -546,6 +670,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -570,6 +697,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -594,6 +724,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -618,14 +751,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTTicket., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTTicket., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTTicket., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTTicket., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -652,6 +788,9 @@ public function getIsClaimed() */ public function setIsClaimed($is_claimed) { + if (is_null($is_claimed)) { + throw new \InvalidArgumentException('non-nullable is_claimed cannot be null'); + } $this->container['is_claimed'] = $is_claimed; return $this; @@ -676,6 +815,9 @@ public function getDateTimeClaimed() */ public function setDateTimeClaimed($date_time_claimed) { + if (is_null($date_time_claimed)) { + throw new \InvalidArgumentException('non-nullable date_time_claimed cannot be null'); + } $this->container['date_time_claimed'] = $date_time_claimed; return $this; @@ -700,6 +842,9 @@ public function getClaimedByPhoneNumber() */ public function setClaimedByPhoneNumber($claimed_by_phone_number) { + if (is_null($claimed_by_phone_number)) { + throw new \InvalidArgumentException('non-nullable claimed_by_phone_number cannot be null'); + } $this->container['claimed_by_phone_number'] = $claimed_by_phone_number; return $this; @@ -724,6 +869,9 @@ public function getRedeemedSource() */ public function setRedeemedSource($redeemed_source) { + if (is_null($redeemed_source)) { + throw new \InvalidArgumentException('non-nullable redeemed_source cannot be null'); + } $this->container['redeemed_source'] = $redeemed_source; return $this; @@ -748,6 +896,9 @@ public function getRedeemedTransactionId() */ public function setRedeemedTransactionId($redeemed_transaction_id) { + if (is_null($redeemed_transaction_id)) { + throw new \InvalidArgumentException('non-nullable redeemed_transaction_id cannot be null'); + } $this->container['redeemed_transaction_id'] = $redeemed_transaction_id; return $this; @@ -772,6 +923,9 @@ public function getTransactionType() */ public function setTransactionType($transaction_type) { + if (is_null($transaction_type)) { + throw new \InvalidArgumentException('non-nullable transaction_type cannot be null'); + } $this->container['transaction_type'] = $transaction_type; return $this; @@ -796,6 +950,9 @@ public function getRegisterId() */ public function setRegisterId($register_id) { + if (is_null($register_id)) { + throw new \InvalidArgumentException('non-nullable register_id cannot be null'); + } $this->container['register_id'] = $register_id; return $this; @@ -820,6 +977,9 @@ public function getIsRedeemed() */ public function setIsRedeemed($is_redeemed) { + if (is_null($is_redeemed)) { + throw new \InvalidArgumentException('non-nullable is_redeemed cannot be null'); + } $this->container['is_redeemed'] = $is_redeemed; return $this; @@ -844,6 +1004,9 @@ public function getDateTimeRedeemed() */ public function setDateTimeRedeemed($date_time_redeemed) { + if (is_null($date_time_redeemed)) { + throw new \InvalidArgumentException('non-nullable date_time_redeemed cannot be null'); + } $this->container['date_time_redeemed'] = $date_time_redeemed; return $this; @@ -855,7 +1018,7 @@ public function setDateTimeRedeemed($date_time_redeemed) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -867,6 +1030,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -880,7 +1044,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -896,7 +1060,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -908,6 +1072,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTTicketCreateParams.php b/lib/Model/WTTicketCreateParams.php index 6670d43..9be0c25 100644 --- a/lib/Model/WTTicketCreateParams.php +++ b/lib/Model/WTTicketCreateParams.php @@ -2,7 +2,7 @@ /** * WTTicketCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTTicketCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class WTTicketCreateParams implements ModelInterface, ArrayAccess, \JsonSerializ 'recipient_email_address' => 'string', 'recipient_member_id' => 'string', 'is_comp' => 'bool', - 'quantity' => 'double', + 'quantity' => 'float', 'performance_id' => 'string' ]; @@ -84,6 +82,27 @@ class WTTicketCreateParams implements ModelInterface, ArrayAccess, \JsonSerializ 'performance_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'recipient_phone_number' => false, + 'recipient_email_address' => false, + 'recipient_member_id' => false, + 'is_comp' => false, + 'quantity' => false, + 'performance_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -104,6 +123,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -204,12 +275,30 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['recipient_phone_number'] = $data['recipient_phone_number'] ?? null; - $this->container['recipient_email_address'] = $data['recipient_email_address'] ?? null; - $this->container['recipient_member_id'] = $data['recipient_member_id'] ?? null; - $this->container['is_comp'] = $data['is_comp'] ?? null; - $this->container['quantity'] = $data['quantity'] ?? null; - $this->container['performance_id'] = $data['performance_id'] ?? null; + $this->setIfExists('recipient_phone_number', $data ?? [], null); + $this->setIfExists('recipient_email_address', $data ?? [], null); + $this->setIfExists('recipient_member_id', $data ?? [], null); + $this->setIfExists('is_comp', $data ?? [], null); + $this->setIfExists('quantity', $data ?? [], null); + $this->setIfExists('performance_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -262,6 +351,9 @@ public function getRecipientPhoneNumber() */ public function setRecipientPhoneNumber($recipient_phone_number) { + if (is_null($recipient_phone_number)) { + throw new \InvalidArgumentException('non-nullable recipient_phone_number cannot be null'); + } $this->container['recipient_phone_number'] = $recipient_phone_number; return $this; @@ -286,6 +378,9 @@ public function getRecipientEmailAddress() */ public function setRecipientEmailAddress($recipient_email_address) { + if (is_null($recipient_email_address)) { + throw new \InvalidArgumentException('non-nullable recipient_email_address cannot be null'); + } $this->container['recipient_email_address'] = $recipient_email_address; return $this; @@ -310,6 +405,9 @@ public function getRecipientMemberId() */ public function setRecipientMemberId($recipient_member_id) { + if (is_null($recipient_member_id)) { + throw new \InvalidArgumentException('non-nullable recipient_member_id cannot be null'); + } $this->container['recipient_member_id'] = $recipient_member_id; return $this; @@ -334,6 +432,9 @@ public function getIsComp() */ public function setIsComp($is_comp) { + if (is_null($is_comp)) { + throw new \InvalidArgumentException('non-nullable is_comp cannot be null'); + } $this->container['is_comp'] = $is_comp; return $this; @@ -342,7 +443,7 @@ public function setIsComp($is_comp) /** * Gets quantity * - * @return double|null + * @return float|null */ public function getQuantity() { @@ -352,14 +453,17 @@ public function getQuantity() /** * Sets quantity * - * @param double|null $quantity The number of tickets allocated to the recipient. + * @param float|null $quantity The number of tickets allocated to the recipient. * * @return self */ public function setQuantity($quantity) { + if (is_null($quantity)) { + throw new \InvalidArgumentException('non-nullable quantity cannot be null'); + } - if (!is_null($quantity) && ($quantity < 1)) { + if (($quantity < 1)) { throw new \InvalidArgumentException('invalid value for $quantity when calling WTTicketCreateParams., must be bigger than or equal to 1.'); } @@ -387,6 +491,9 @@ public function getPerformanceId() */ public function setPerformanceId($performance_id) { + if (is_null($performance_id)) { + throw new \InvalidArgumentException('non-nullable performance_id cannot be null'); + } $this->container['performance_id'] = $performance_id; return $this; @@ -398,7 +505,7 @@ public function setPerformanceId($performance_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -410,6 +517,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -423,7 +531,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -439,7 +547,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -451,6 +559,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTTicketUpdateParams.php b/lib/Model/WTTicketUpdateParams.php index 8879183..314f8e4 100644 --- a/lib/Model/WTTicketUpdateParams.php +++ b/lib/Model/WTTicketUpdateParams.php @@ -2,7 +2,7 @@ /** * WTTicketUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTTicketUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -64,7 +62,7 @@ class WTTicketUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializ 'recipient_email_address' => 'string', 'recipient_member_id' => 'string', 'is_comp' => 'bool', - 'quantity' => 'double' + 'quantity' => 'float' ]; /** @@ -82,6 +80,26 @@ class WTTicketUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializ 'quantity' => 'double' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'recipient_phone_number' => false, + 'recipient_email_address' => false, + 'recipient_member_id' => false, + 'is_comp' => false, + 'quantity' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['recipient_phone_number'] = $data['recipient_phone_number'] ?? null; - $this->container['recipient_email_address'] = $data['recipient_email_address'] ?? null; - $this->container['recipient_member_id'] = $data['recipient_member_id'] ?? null; - $this->container['is_comp'] = $data['is_comp'] ?? null; - $this->container['quantity'] = $data['quantity'] ?? null; + $this->setIfExists('recipient_phone_number', $data ?? [], null); + $this->setIfExists('recipient_email_address', $data ?? [], null); + $this->setIfExists('recipient_member_id', $data ?? [], null); + $this->setIfExists('is_comp', $data ?? [], null); + $this->setIfExists('quantity', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -253,6 +341,9 @@ public function getRecipientPhoneNumber() */ public function setRecipientPhoneNumber($recipient_phone_number) { + if (is_null($recipient_phone_number)) { + throw new \InvalidArgumentException('non-nullable recipient_phone_number cannot be null'); + } $this->container['recipient_phone_number'] = $recipient_phone_number; return $this; @@ -277,6 +368,9 @@ public function getRecipientEmailAddress() */ public function setRecipientEmailAddress($recipient_email_address) { + if (is_null($recipient_email_address)) { + throw new \InvalidArgumentException('non-nullable recipient_email_address cannot be null'); + } $this->container['recipient_email_address'] = $recipient_email_address; return $this; @@ -301,6 +395,9 @@ public function getRecipientMemberId() */ public function setRecipientMemberId($recipient_member_id) { + if (is_null($recipient_member_id)) { + throw new \InvalidArgumentException('non-nullable recipient_member_id cannot be null'); + } $this->container['recipient_member_id'] = $recipient_member_id; return $this; @@ -325,6 +422,9 @@ public function getIsComp() */ public function setIsComp($is_comp) { + if (is_null($is_comp)) { + throw new \InvalidArgumentException('non-nullable is_comp cannot be null'); + } $this->container['is_comp'] = $is_comp; return $this; @@ -333,7 +433,7 @@ public function setIsComp($is_comp) /** * Gets quantity * - * @return double|null + * @return float|null */ public function getQuantity() { @@ -343,14 +443,17 @@ public function getQuantity() /** * Sets quantity * - * @param double|null $quantity The number of tickets allocated to the recipient. + * @param float|null $quantity The number of tickets allocated to the recipient. * * @return self */ public function setQuantity($quantity) { + if (is_null($quantity)) { + throw new \InvalidArgumentException('non-nullable quantity cannot be null'); + } - if (!is_null($quantity) && ($quantity < 1)) { + if (($quantity < 1)) { throw new \InvalidArgumentException('invalid value for $quantity when calling WTTicketUpdateParams., must be bigger than or equal to 1.'); } @@ -365,7 +468,7 @@ public function setQuantity($quantity) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -377,6 +480,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -390,7 +494,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -406,7 +510,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -418,6 +522,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTTwilioRequestAuthyCode.php b/lib/Model/WTTwilioRequestAuthyCode.php index ed30795..e60de48 100644 --- a/lib/Model/WTTwilioRequestAuthyCode.php +++ b/lib/Model/WTTwilioRequestAuthyCode.php @@ -2,7 +2,7 @@ /** * WTTwilioRequestAuthyCode * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTTwilioRequestAuthyCode implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -76,6 +74,23 @@ class WTTwilioRequestAuthyCode implements ModelInterface, ArrayAccess, \JsonSeri 'phone_number' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'merchant_id' => false, + 'phone_number' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -249,14 +334,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTTwilioRequestAuthyCode., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTTwilioRequestAuthyCode., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTTwilioRequestAuthyCode., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTTwilioRequestAuthyCode., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -283,6 +371,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -294,7 +385,7 @@ public function setPhoneNumber($phone_number) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -306,6 +397,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -319,7 +411,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -335,7 +427,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -347,6 +439,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTTwilioVerifyAuthyCode.php b/lib/Model/WTTwilioVerifyAuthyCode.php index a6e74c7..909177d 100644 --- a/lib/Model/WTTwilioVerifyAuthyCode.php +++ b/lib/Model/WTTwilioVerifyAuthyCode.php @@ -2,7 +2,7 @@ /** * WTTwilioVerifyAuthyCode * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTTwilioVerifyAuthyCode implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTTwilioVerifyAuthyCode implements ModelInterface, ArrayAccess, \JsonSeria 'otp' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'merchant_id' => false, + 'phone_number' => false, + 'otp' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['otp'] = $data['otp'] ?? null; + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('otp', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -258,14 +344,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTTwilioVerifyAuthyCode., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTTwilioVerifyAuthyCode., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTTwilioVerifyAuthyCode., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTTwilioVerifyAuthyCode., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -292,6 +381,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } $this->container['phone_number'] = $phone_number; return $this; @@ -316,6 +408,9 @@ public function getOtp() */ public function setOtp($otp) { + if (is_null($otp)) { + throw new \InvalidArgumentException('non-nullable otp cannot be null'); + } $this->container['otp'] = $otp; return $this; @@ -327,7 +422,7 @@ public function setOtp($otp) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -339,6 +434,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -352,7 +448,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -368,7 +464,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -380,6 +476,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTVideoCreateParams.php b/lib/Model/WTVideoCreateParams.php index 6aecc52..42180ad 100644 --- a/lib/Model/WTVideoCreateParams.php +++ b/lib/Model/WTVideoCreateParams.php @@ -2,7 +2,7 @@ /** * WTVideoCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTVideoCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -82,6 +80,26 @@ class WTVideoCreateParams implements ModelInterface, ArrayAccess, \JsonSerializa 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -277,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTVideoCreateParams., must be bigger than or equal to 1.'); @@ -306,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTVideoCreateParams., must be bigger than or equal to 1.'); @@ -335,6 +429,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTVideoCreateParams., must be bigger than or equal to 1.'); @@ -364,6 +461,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } if ((mb_strlen($media_url) < 12)) { throw new \InvalidArgumentException('invalid length for $media_url when calling WTVideoCreateParams., must be bigger than or equal to 12.'); @@ -393,6 +493,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -404,7 +507,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -416,6 +519,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -429,7 +533,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -445,7 +549,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -457,6 +561,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTVideoUpdateParams.php b/lib/Model/WTVideoUpdateParams.php index 4121561..211d26b 100644 --- a/lib/Model/WTVideoUpdateParams.php +++ b/lib/Model/WTVideoUpdateParams.php @@ -2,7 +2,7 @@ /** * WTVideoUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTVideoUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -82,6 +80,26 @@ class WTVideoUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializa 'additional_info_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'title' => false, + 'description' => false, + 'order_number' => false, + 'media_url' => false, + 'additional_info_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -102,6 +120,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -199,11 +269,29 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['title'] = $data['title'] ?? null; - $this->container['description'] = $data['description'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['media_url'] = $data['media_url'] ?? null; - $this->container['additional_info_url'] = $data['additional_info_url'] ?? null; + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('media_url', $data ?? [], null); + $this->setIfExists('additional_info_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -277,6 +365,9 @@ public function getTitle() */ public function setTitle($title) { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } if ((mb_strlen($title) < 1)) { throw new \InvalidArgumentException('invalid length for $title when calling WTVideoUpdateParams., must be bigger than or equal to 1.'); @@ -306,6 +397,9 @@ public function getDescription() */ public function setDescription($description) { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } if ((mb_strlen($description) < 1)) { throw new \InvalidArgumentException('invalid length for $description when calling WTVideoUpdateParams., must be bigger than or equal to 1.'); @@ -335,6 +429,9 @@ public function getOrderNumber() */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } if (($order_number < 1)) { throw new \InvalidArgumentException('invalid value for $order_number when calling WTVideoUpdateParams., must be bigger than or equal to 1.'); @@ -364,6 +461,9 @@ public function getMediaUrl() */ public function setMediaUrl($media_url) { + if (is_null($media_url)) { + throw new \InvalidArgumentException('non-nullable media_url cannot be null'); + } if ((mb_strlen($media_url) < 12)) { throw new \InvalidArgumentException('invalid length for $media_url when calling WTVideoUpdateParams., must be bigger than or equal to 12.'); @@ -393,6 +493,9 @@ public function getAdditionalInfoUrl() */ public function setAdditionalInfoUrl($additional_info_url) { + if (is_null($additional_info_url)) { + throw new \InvalidArgumentException('non-nullable additional_info_url cannot be null'); + } $this->container['additional_info_url'] = $additional_info_url; return $this; @@ -404,7 +507,7 @@ public function setAdditionalInfoUrl($additional_info_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -416,6 +519,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -429,7 +533,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -445,7 +549,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -457,6 +561,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTVirtualBusinessCardCreateParams.php b/lib/Model/WTVirtualBusinessCardCreateParams.php index a5e09fd..0a5ba77 100644 --- a/lib/Model/WTVirtualBusinessCardCreateParams.php +++ b/lib/Model/WTVirtualBusinessCardCreateParams.php @@ -2,7 +2,7 @@ /** * WTVirtualBusinessCardCreateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTVirtualBusinessCardCreateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -98,6 +96,34 @@ class WTVirtualBusinessCardCreateParams implements ModelInterface, ArrayAccess, 'avatar_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email_address' => false, + 'designation' => false, + 'phone_number' => false, + 'introduction' => false, + 'instagram' => false, + 'facebook' => false, + 'you_tube' => false, + 'twitter' => false, + 'linked_in' => false, + 'whats_app' => false, + 'avatar_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -118,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -239,19 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['designation'] = $data['designation'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['introduction'] = $data['introduction'] ?? null; - $this->container['instagram'] = $data['instagram'] ?? null; - $this->container['facebook'] = $data['facebook'] ?? null; - $this->container['you_tube'] = $data['you_tube'] ?? null; - $this->container['twitter'] = $data['twitter'] ?? null; - $this->container['linked_in'] = $data['linked_in'] ?? null; - $this->container['whats_app'] = $data['whats_app'] ?? null; - $this->container['avatar_url'] = $data['avatar_url'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('designation', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('introduction', $data ?? [], null); + $this->setIfExists('instagram', $data ?? [], null); + $this->setIfExists('facebook', $data ?? [], null); + $this->setIfExists('you_tube', $data ?? [], null); + $this->setIfExists('twitter', $data ?? [], null); + $this->setIfExists('linked_in', $data ?? [], null); + $this->setIfExists('whats_app', $data ?? [], null); + $this->setIfExists('avatar_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -336,6 +432,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling WTVirtualBusinessCardCreateParams., must be bigger than or equal to 1.'); @@ -365,6 +464,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling WTVirtualBusinessCardCreateParams., must be bigger than or equal to 1.'); @@ -394,6 +496,9 @@ public function getEmailAddress() */ public function setEmailAddress($email_address) { + if (is_null($email_address)) { + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + } if ((mb_strlen($email_address) < 1)) { throw new \InvalidArgumentException('invalid length for $email_address when calling WTVirtualBusinessCardCreateParams., must be bigger than or equal to 1.'); @@ -423,6 +528,9 @@ public function getDesignation() */ public function setDesignation($designation) { + if (is_null($designation)) { + throw new \InvalidArgumentException('non-nullable designation cannot be null'); + } if ((mb_strlen($designation) < 1)) { throw new \InvalidArgumentException('invalid length for $designation when calling WTVirtualBusinessCardCreateParams., must be bigger than or equal to 1.'); @@ -452,6 +560,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } if ((mb_strlen($phone_number) < 1)) { throw new \InvalidArgumentException('invalid length for $phone_number when calling WTVirtualBusinessCardCreateParams., must be bigger than or equal to 1.'); @@ -481,8 +592,11 @@ public function getIntroduction() */ public function setIntroduction($introduction) { + if (is_null($introduction)) { + throw new \InvalidArgumentException('non-nullable introduction cannot be null'); + } - if (!is_null($introduction) && (mb_strlen($introduction) < 0)) { + if ((mb_strlen($introduction) < 0)) { throw new \InvalidArgumentException('invalid length for $introduction when calling WTVirtualBusinessCardCreateParams., must be bigger than or equal to 0.'); } @@ -510,6 +624,9 @@ public function getInstagram() */ public function setInstagram($instagram) { + if (is_null($instagram)) { + throw new \InvalidArgumentException('non-nullable instagram cannot be null'); + } $this->container['instagram'] = $instagram; @@ -536,6 +653,9 @@ public function getFacebook() */ public function setFacebook($facebook) { + if (is_null($facebook)) { + throw new \InvalidArgumentException('non-nullable facebook cannot be null'); + } $this->container['facebook'] = $facebook; @@ -562,6 +682,9 @@ public function getYouTube() */ public function setYouTube($you_tube) { + if (is_null($you_tube)) { + throw new \InvalidArgumentException('non-nullable you_tube cannot be null'); + } $this->container['you_tube'] = $you_tube; @@ -588,6 +711,9 @@ public function getTwitter() */ public function setTwitter($twitter) { + if (is_null($twitter)) { + throw new \InvalidArgumentException('non-nullable twitter cannot be null'); + } $this->container['twitter'] = $twitter; @@ -614,6 +740,9 @@ public function getLinkedIn() */ public function setLinkedIn($linked_in) { + if (is_null($linked_in)) { + throw new \InvalidArgumentException('non-nullable linked_in cannot be null'); + } $this->container['linked_in'] = $linked_in; @@ -640,6 +769,9 @@ public function getWhatsApp() */ public function setWhatsApp($whats_app) { + if (is_null($whats_app)) { + throw new \InvalidArgumentException('non-nullable whats_app cannot be null'); + } $this->container['whats_app'] = $whats_app; @@ -666,6 +798,9 @@ public function getAvatarUrl() */ public function setAvatarUrl($avatar_url) { + if (is_null($avatar_url)) { + throw new \InvalidArgumentException('non-nullable avatar_url cannot be null'); + } $this->container['avatar_url'] = $avatar_url; @@ -679,7 +814,7 @@ public function setAvatarUrl($avatar_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -691,6 +826,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -704,7 +840,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -720,7 +856,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -732,6 +868,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTVirtualBusinessCardUpdateParams.php b/lib/Model/WTVirtualBusinessCardUpdateParams.php index 79f2d7c..2618fb4 100644 --- a/lib/Model/WTVirtualBusinessCardUpdateParams.php +++ b/lib/Model/WTVirtualBusinessCardUpdateParams.php @@ -2,7 +2,7 @@ /** * WTVirtualBusinessCardUpdateParams * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTVirtualBusinessCardUpdateParams implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -98,6 +96,34 @@ class WTVirtualBusinessCardUpdateParams implements ModelInterface, ArrayAccess, 'avatar_url' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => false, + 'last_name' => false, + 'email_address' => false, + 'designation' => false, + 'phone_number' => false, + 'introduction' => false, + 'instagram' => false, + 'facebook' => false, + 'you_tube' => false, + 'twitter' => false, + 'linked_in' => false, + 'whats_app' => false, + 'avatar_url' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -118,6 +144,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -239,19 +317,37 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['first_name'] = $data['first_name'] ?? null; - $this->container['last_name'] = $data['last_name'] ?? null; - $this->container['email_address'] = $data['email_address'] ?? null; - $this->container['designation'] = $data['designation'] ?? null; - $this->container['phone_number'] = $data['phone_number'] ?? null; - $this->container['introduction'] = $data['introduction'] ?? null; - $this->container['instagram'] = $data['instagram'] ?? null; - $this->container['facebook'] = $data['facebook'] ?? null; - $this->container['you_tube'] = $data['you_tube'] ?? null; - $this->container['twitter'] = $data['twitter'] ?? null; - $this->container['linked_in'] = $data['linked_in'] ?? null; - $this->container['whats_app'] = $data['whats_app'] ?? null; - $this->container['avatar_url'] = $data['avatar_url'] ?? null; + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email_address', $data ?? [], null); + $this->setIfExists('designation', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('introduction', $data ?? [], null); + $this->setIfExists('instagram', $data ?? [], null); + $this->setIfExists('facebook', $data ?? [], null); + $this->setIfExists('you_tube', $data ?? [], null); + $this->setIfExists('twitter', $data ?? [], null); + $this->setIfExists('linked_in', $data ?? [], null); + $this->setIfExists('whats_app', $data ?? [], null); + $this->setIfExists('avatar_url', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -336,6 +432,9 @@ public function getFirstName() */ public function setFirstName($first_name) { + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + } if ((mb_strlen($first_name) < 1)) { throw new \InvalidArgumentException('invalid length for $first_name when calling WTVirtualBusinessCardUpdateParams., must be bigger than or equal to 1.'); @@ -365,6 +464,9 @@ public function getLastName() */ public function setLastName($last_name) { + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + } if ((mb_strlen($last_name) < 1)) { throw new \InvalidArgumentException('invalid length for $last_name when calling WTVirtualBusinessCardUpdateParams., must be bigger than or equal to 1.'); @@ -394,6 +496,9 @@ public function getEmailAddress() */ public function setEmailAddress($email_address) { + if (is_null($email_address)) { + throw new \InvalidArgumentException('non-nullable email_address cannot be null'); + } if ((mb_strlen($email_address) < 1)) { throw new \InvalidArgumentException('invalid length for $email_address when calling WTVirtualBusinessCardUpdateParams., must be bigger than or equal to 1.'); @@ -423,6 +528,9 @@ public function getDesignation() */ public function setDesignation($designation) { + if (is_null($designation)) { + throw new \InvalidArgumentException('non-nullable designation cannot be null'); + } if ((mb_strlen($designation) < 1)) { throw new \InvalidArgumentException('invalid length for $designation when calling WTVirtualBusinessCardUpdateParams., must be bigger than or equal to 1.'); @@ -452,6 +560,9 @@ public function getPhoneNumber() */ public function setPhoneNumber($phone_number) { + if (is_null($phone_number)) { + throw new \InvalidArgumentException('non-nullable phone_number cannot be null'); + } if ((mb_strlen($phone_number) < 1)) { throw new \InvalidArgumentException('invalid length for $phone_number when calling WTVirtualBusinessCardUpdateParams., must be bigger than or equal to 1.'); @@ -481,8 +592,11 @@ public function getIntroduction() */ public function setIntroduction($introduction) { + if (is_null($introduction)) { + throw new \InvalidArgumentException('non-nullable introduction cannot be null'); + } - if (!is_null($introduction) && (mb_strlen($introduction) < 0)) { + if ((mb_strlen($introduction) < 0)) { throw new \InvalidArgumentException('invalid length for $introduction when calling WTVirtualBusinessCardUpdateParams., must be bigger than or equal to 0.'); } @@ -510,6 +624,9 @@ public function getInstagram() */ public function setInstagram($instagram) { + if (is_null($instagram)) { + throw new \InvalidArgumentException('non-nullable instagram cannot be null'); + } $this->container['instagram'] = $instagram; @@ -536,6 +653,9 @@ public function getFacebook() */ public function setFacebook($facebook) { + if (is_null($facebook)) { + throw new \InvalidArgumentException('non-nullable facebook cannot be null'); + } $this->container['facebook'] = $facebook; @@ -562,6 +682,9 @@ public function getYouTube() */ public function setYouTube($you_tube) { + if (is_null($you_tube)) { + throw new \InvalidArgumentException('non-nullable you_tube cannot be null'); + } $this->container['you_tube'] = $you_tube; @@ -588,6 +711,9 @@ public function getTwitter() */ public function setTwitter($twitter) { + if (is_null($twitter)) { + throw new \InvalidArgumentException('non-nullable twitter cannot be null'); + } $this->container['twitter'] = $twitter; @@ -614,6 +740,9 @@ public function getLinkedIn() */ public function setLinkedIn($linked_in) { + if (is_null($linked_in)) { + throw new \InvalidArgumentException('non-nullable linked_in cannot be null'); + } $this->container['linked_in'] = $linked_in; @@ -640,6 +769,9 @@ public function getWhatsApp() */ public function setWhatsApp($whats_app) { + if (is_null($whats_app)) { + throw new \InvalidArgumentException('non-nullable whats_app cannot be null'); + } $this->container['whats_app'] = $whats_app; @@ -666,6 +798,9 @@ public function getAvatarUrl() */ public function setAvatarUrl($avatar_url) { + if (is_null($avatar_url)) { + throw new \InvalidArgumentException('non-nullable avatar_url cannot be null'); + } $this->container['avatar_url'] = $avatar_url; @@ -679,7 +814,7 @@ public function setAvatarUrl($avatar_url) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -691,6 +826,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -704,7 +840,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -720,7 +856,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -732,6 +868,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTWalletConfigurationSaveWalletRecord.php b/lib/Model/WTWalletConfigurationSaveWalletRecord.php index 2d30927..f250481 100644 --- a/lib/Model/WTWalletConfigurationSaveWalletRecord.php +++ b/lib/Model/WTWalletConfigurationSaveWalletRecord.php @@ -2,7 +2,7 @@ /** * WTWalletConfigurationSaveWalletRecord * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTWalletConfigurationSaveWalletRecord implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -105,11 +103,11 @@ class WTWalletConfigurationSaveWalletRecord implements ModelInterface, ArrayAcce 'is_settings' => 'bool', 'is_chat_room' => 'bool', 'is_sms_opt_in' => 'bool', - 'sms_opt_in_source_id' => 'string', + 'sms_opt_in_source_id' => '\OpenAPI\Client\Model\WalletConfigurationSmsOptInSourceID', 'is_email_subscriber' => 'bool', 'google_analytics_id' => 'string', 'facebook_pixel_id' => 'string', - 'public_chat_room_channel_id' => 'double', + 'public_chat_room_channel_id' => 'float', 'vanity_handle' => 'string', 'vanity_page_wallet_prefix' => 'string', 'merchant_credit_payment_design_id' => 'string', @@ -117,7 +115,7 @@ class WTWalletConfigurationSaveWalletRecord implements ModelInterface, ArrayAcce 'is_claimed' => 'bool', 'mobile_app_icon_url' => 'string', 'is_age_gate' => 'bool', - 'age_gate_minimum' => 'double', + 'age_gate_minimum' => 'float', 'social_instagram_url' => 'string', 'social_facebook_url' => 'string', 'social_you_tube_url' => 'string', @@ -204,6 +202,87 @@ class WTWalletConfigurationSaveWalletRecord implements ModelInterface, ArrayAcce 'primary_email_address' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'header_background_color' => false, + 'header_button_color' => false, + 'left_menu_header_background_color' => false, + 'left_menu_header_font_color' => false, + 'left_menu_section_background_color' => false, + 'left_menu_section_font_color' => false, + 'company_logo_url' => false, + 'header_image_url' => false, + 'header_custom_icon' => false, + 'welcome_message' => false, + 'is_apple_enabled' => false, + 'is_google_enabled' => false, + 'is_samsung_enabled' => false, + 'is_ad_credits' => false, + 'is_static_vouchers' => false, + 'is_dynamic_vouchers' => false, + 'is_membership_tier' => false, + 'is_membership_points' => false, + 'is_membership_level' => false, + 'is_gift_cards' => false, + 'is_gift_certificates' => false, + 'is_promotions' => false, + 'is_merchant_credit' => false, + 'is_tickets' => false, + 'is_news_articles' => false, + 'is_performances' => false, + 'is_messages' => false, + 'is_call' => false, + 'is_representatives' => false, + 'is_products' => false, + 'is_services' => false, + 'is_room_rates' => false, + 'is_amenities' => false, + 'is_gaming' => false, + 'is_dining' => false, + 'is_lounges' => false, + 'is_map_directions' => false, + 'is_link_book' => false, + 'is_image_grid' => false, + 'is_videos' => false, + 'is_transaction_history' => false, + 'is_profile' => false, + 'is_settings' => false, + 'is_chat_room' => false, + 'is_sms_opt_in' => false, + 'sms_opt_in_source_id' => false, + 'is_email_subscriber' => false, + 'google_analytics_id' => false, + 'facebook_pixel_id' => false, + 'public_chat_room_channel_id' => false, + 'vanity_handle' => false, + 'vanity_page_wallet_prefix' => false, + 'merchant_credit_payment_design_id' => false, + 'custom_domain' => false, + 'is_claimed' => false, + 'mobile_app_icon_url' => false, + 'is_age_gate' => false, + 'age_gate_minimum' => false, + 'social_instagram_url' => false, + 'social_facebook_url' => false, + 'social_you_tube_url' => false, + 'social_twitter_url' => false, + 'social_linked_in_url' => false, + 'primary_phone_number' => false, + 'primary_whats_app' => false, + 'primary_email_address' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -224,6 +303,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -504,72 +635,90 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['header_background_color'] = $data['header_background_color'] ?? null; - $this->container['header_button_color'] = $data['header_button_color'] ?? null; - $this->container['left_menu_header_background_color'] = $data['left_menu_header_background_color'] ?? null; - $this->container['left_menu_header_font_color'] = $data['left_menu_header_font_color'] ?? null; - $this->container['left_menu_section_background_color'] = $data['left_menu_section_background_color'] ?? null; - $this->container['left_menu_section_font_color'] = $data['left_menu_section_font_color'] ?? null; - $this->container['company_logo_url'] = $data['company_logo_url'] ?? null; - $this->container['header_image_url'] = $data['header_image_url'] ?? null; - $this->container['header_custom_icon'] = $data['header_custom_icon'] ?? null; - $this->container['welcome_message'] = $data['welcome_message'] ?? null; - $this->container['is_apple_enabled'] = $data['is_apple_enabled'] ?? null; - $this->container['is_google_enabled'] = $data['is_google_enabled'] ?? null; - $this->container['is_samsung_enabled'] = $data['is_samsung_enabled'] ?? null; - $this->container['is_ad_credits'] = $data['is_ad_credits'] ?? null; - $this->container['is_static_vouchers'] = $data['is_static_vouchers'] ?? null; - $this->container['is_dynamic_vouchers'] = $data['is_dynamic_vouchers'] ?? null; - $this->container['is_membership_tier'] = $data['is_membership_tier'] ?? null; - $this->container['is_membership_points'] = $data['is_membership_points'] ?? null; - $this->container['is_membership_level'] = $data['is_membership_level'] ?? null; - $this->container['is_gift_cards'] = $data['is_gift_cards'] ?? null; - $this->container['is_gift_certificates'] = $data['is_gift_certificates'] ?? null; - $this->container['is_promotions'] = $data['is_promotions'] ?? null; - $this->container['is_merchant_credit'] = $data['is_merchant_credit'] ?? null; - $this->container['is_tickets'] = $data['is_tickets'] ?? null; - $this->container['is_news_articles'] = $data['is_news_articles'] ?? null; - $this->container['is_performances'] = $data['is_performances'] ?? null; - $this->container['is_messages'] = $data['is_messages'] ?? null; - $this->container['is_call'] = $data['is_call'] ?? null; - $this->container['is_representatives'] = $data['is_representatives'] ?? null; - $this->container['is_products'] = $data['is_products'] ?? null; - $this->container['is_services'] = $data['is_services'] ?? null; - $this->container['is_room_rates'] = $data['is_room_rates'] ?? null; - $this->container['is_amenities'] = $data['is_amenities'] ?? null; - $this->container['is_gaming'] = $data['is_gaming'] ?? null; - $this->container['is_dining'] = $data['is_dining'] ?? null; - $this->container['is_lounges'] = $data['is_lounges'] ?? null; - $this->container['is_map_directions'] = $data['is_map_directions'] ?? null; - $this->container['is_link_book'] = $data['is_link_book'] ?? null; - $this->container['is_image_grid'] = $data['is_image_grid'] ?? null; - $this->container['is_videos'] = $data['is_videos'] ?? null; - $this->container['is_transaction_history'] = $data['is_transaction_history'] ?? null; - $this->container['is_profile'] = $data['is_profile'] ?? null; - $this->container['is_settings'] = $data['is_settings'] ?? null; - $this->container['is_chat_room'] = $data['is_chat_room'] ?? null; - $this->container['is_sms_opt_in'] = $data['is_sms_opt_in'] ?? null; - $this->container['sms_opt_in_source_id'] = $data['sms_opt_in_source_id'] ?? null; - $this->container['is_email_subscriber'] = $data['is_email_subscriber'] ?? null; - $this->container['google_analytics_id'] = $data['google_analytics_id'] ?? null; - $this->container['facebook_pixel_id'] = $data['facebook_pixel_id'] ?? null; - $this->container['public_chat_room_channel_id'] = $data['public_chat_room_channel_id'] ?? null; - $this->container['vanity_handle'] = $data['vanity_handle'] ?? null; - $this->container['vanity_page_wallet_prefix'] = $data['vanity_page_wallet_prefix'] ?? null; - $this->container['merchant_credit_payment_design_id'] = $data['merchant_credit_payment_design_id'] ?? null; - $this->container['custom_domain'] = $data['custom_domain'] ?? null; - $this->container['is_claimed'] = $data['is_claimed'] ?? null; - $this->container['mobile_app_icon_url'] = $data['mobile_app_icon_url'] ?? null; - $this->container['is_age_gate'] = $data['is_age_gate'] ?? null; - $this->container['age_gate_minimum'] = $data['age_gate_minimum'] ?? null; - $this->container['social_instagram_url'] = $data['social_instagram_url'] ?? null; - $this->container['social_facebook_url'] = $data['social_facebook_url'] ?? null; - $this->container['social_you_tube_url'] = $data['social_you_tube_url'] ?? null; - $this->container['social_twitter_url'] = $data['social_twitter_url'] ?? null; - $this->container['social_linked_in_url'] = $data['social_linked_in_url'] ?? null; - $this->container['primary_phone_number'] = $data['primary_phone_number'] ?? null; - $this->container['primary_whats_app'] = $data['primary_whats_app'] ?? null; - $this->container['primary_email_address'] = $data['primary_email_address'] ?? null; + $this->setIfExists('header_background_color', $data ?? [], null); + $this->setIfExists('header_button_color', $data ?? [], null); + $this->setIfExists('left_menu_header_background_color', $data ?? [], null); + $this->setIfExists('left_menu_header_font_color', $data ?? [], null); + $this->setIfExists('left_menu_section_background_color', $data ?? [], null); + $this->setIfExists('left_menu_section_font_color', $data ?? [], null); + $this->setIfExists('company_logo_url', $data ?? [], null); + $this->setIfExists('header_image_url', $data ?? [], null); + $this->setIfExists('header_custom_icon', $data ?? [], null); + $this->setIfExists('welcome_message', $data ?? [], null); + $this->setIfExists('is_apple_enabled', $data ?? [], null); + $this->setIfExists('is_google_enabled', $data ?? [], null); + $this->setIfExists('is_samsung_enabled', $data ?? [], null); + $this->setIfExists('is_ad_credits', $data ?? [], null); + $this->setIfExists('is_static_vouchers', $data ?? [], null); + $this->setIfExists('is_dynamic_vouchers', $data ?? [], null); + $this->setIfExists('is_membership_tier', $data ?? [], null); + $this->setIfExists('is_membership_points', $data ?? [], null); + $this->setIfExists('is_membership_level', $data ?? [], null); + $this->setIfExists('is_gift_cards', $data ?? [], null); + $this->setIfExists('is_gift_certificates', $data ?? [], null); + $this->setIfExists('is_promotions', $data ?? [], null); + $this->setIfExists('is_merchant_credit', $data ?? [], null); + $this->setIfExists('is_tickets', $data ?? [], null); + $this->setIfExists('is_news_articles', $data ?? [], null); + $this->setIfExists('is_performances', $data ?? [], null); + $this->setIfExists('is_messages', $data ?? [], null); + $this->setIfExists('is_call', $data ?? [], null); + $this->setIfExists('is_representatives', $data ?? [], null); + $this->setIfExists('is_products', $data ?? [], null); + $this->setIfExists('is_services', $data ?? [], null); + $this->setIfExists('is_room_rates', $data ?? [], null); + $this->setIfExists('is_amenities', $data ?? [], null); + $this->setIfExists('is_gaming', $data ?? [], null); + $this->setIfExists('is_dining', $data ?? [], null); + $this->setIfExists('is_lounges', $data ?? [], null); + $this->setIfExists('is_map_directions', $data ?? [], null); + $this->setIfExists('is_link_book', $data ?? [], null); + $this->setIfExists('is_image_grid', $data ?? [], null); + $this->setIfExists('is_videos', $data ?? [], null); + $this->setIfExists('is_transaction_history', $data ?? [], null); + $this->setIfExists('is_profile', $data ?? [], null); + $this->setIfExists('is_settings', $data ?? [], null); + $this->setIfExists('is_chat_room', $data ?? [], null); + $this->setIfExists('is_sms_opt_in', $data ?? [], null); + $this->setIfExists('sms_opt_in_source_id', $data ?? [], null); + $this->setIfExists('is_email_subscriber', $data ?? [], null); + $this->setIfExists('google_analytics_id', $data ?? [], null); + $this->setIfExists('facebook_pixel_id', $data ?? [], null); + $this->setIfExists('public_chat_room_channel_id', $data ?? [], null); + $this->setIfExists('vanity_handle', $data ?? [], null); + $this->setIfExists('vanity_page_wallet_prefix', $data ?? [], null); + $this->setIfExists('merchant_credit_payment_design_id', $data ?? [], null); + $this->setIfExists('custom_domain', $data ?? [], null); + $this->setIfExists('is_claimed', $data ?? [], null); + $this->setIfExists('mobile_app_icon_url', $data ?? [], null); + $this->setIfExists('is_age_gate', $data ?? [], null); + $this->setIfExists('age_gate_minimum', $data ?? [], null); + $this->setIfExists('social_instagram_url', $data ?? [], null); + $this->setIfExists('social_facebook_url', $data ?? [], null); + $this->setIfExists('social_you_tube_url', $data ?? [], null); + $this->setIfExists('social_twitter_url', $data ?? [], null); + $this->setIfExists('social_linked_in_url', $data ?? [], null); + $this->setIfExists('primary_phone_number', $data ?? [], null); + $this->setIfExists('primary_whats_app', $data ?? [], null); + $this->setIfExists('primary_email_address', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -707,18 +856,6 @@ public function listInvalidProperties() if ($this->container['is_sms_opt_in'] === null) { $invalidProperties[] = "'is_sms_opt_in' can't be null"; } - if (!is_null($this->container['sms_opt_in_source_id']) && (mb_strlen($this->container['sms_opt_in_source_id']) > 10)) { - $invalidProperties[] = "invalid value for 'sms_opt_in_source_id', the character length must be smaller than or equal to 10."; - } - - if (!is_null($this->container['sms_opt_in_source_id']) && (mb_strlen($this->container['sms_opt_in_source_id']) < 10)) { - $invalidProperties[] = "invalid value for 'sms_opt_in_source_id', the character length must be bigger than or equal to 10."; - } - - if (!is_null($this->container['sms_opt_in_source_id']) && !preg_match("/^[a-zA-Z0-9]+$/", $this->container['sms_opt_in_source_id'])) { - $invalidProperties[] = "invalid value for 'sms_opt_in_source_id', must be conform to the pattern /^[a-zA-Z0-9]+$/."; - } - if ($this->container['is_email_subscriber'] === null) { $invalidProperties[] = "'is_email_subscriber' can't be null"; } @@ -756,6 +893,9 @@ public function getHeaderBackgroundColor() */ public function setHeaderBackgroundColor($header_background_color) { + if (is_null($header_background_color)) { + throw new \InvalidArgumentException('non-nullable header_background_color cannot be null'); + } $this->container['header_background_color'] = $header_background_color; return $this; @@ -780,6 +920,9 @@ public function getHeaderButtonColor() */ public function setHeaderButtonColor($header_button_color) { + if (is_null($header_button_color)) { + throw new \InvalidArgumentException('non-nullable header_button_color cannot be null'); + } $this->container['header_button_color'] = $header_button_color; return $this; @@ -804,6 +947,9 @@ public function getLeftMenuHeaderBackgroundColor() */ public function setLeftMenuHeaderBackgroundColor($left_menu_header_background_color) { + if (is_null($left_menu_header_background_color)) { + throw new \InvalidArgumentException('non-nullable left_menu_header_background_color cannot be null'); + } $this->container['left_menu_header_background_color'] = $left_menu_header_background_color; return $this; @@ -828,6 +974,9 @@ public function getLeftMenuHeaderFontColor() */ public function setLeftMenuHeaderFontColor($left_menu_header_font_color) { + if (is_null($left_menu_header_font_color)) { + throw new \InvalidArgumentException('non-nullable left_menu_header_font_color cannot be null'); + } $this->container['left_menu_header_font_color'] = $left_menu_header_font_color; return $this; @@ -852,6 +1001,9 @@ public function getLeftMenuSectionBackgroundColor() */ public function setLeftMenuSectionBackgroundColor($left_menu_section_background_color) { + if (is_null($left_menu_section_background_color)) { + throw new \InvalidArgumentException('non-nullable left_menu_section_background_color cannot be null'); + } $this->container['left_menu_section_background_color'] = $left_menu_section_background_color; return $this; @@ -876,6 +1028,9 @@ public function getLeftMenuSectionFontColor() */ public function setLeftMenuSectionFontColor($left_menu_section_font_color) { + if (is_null($left_menu_section_font_color)) { + throw new \InvalidArgumentException('non-nullable left_menu_section_font_color cannot be null'); + } $this->container['left_menu_section_font_color'] = $left_menu_section_font_color; return $this; @@ -900,6 +1055,9 @@ public function getCompanyLogoUrl() */ public function setCompanyLogoUrl($company_logo_url) { + if (is_null($company_logo_url)) { + throw new \InvalidArgumentException('non-nullable company_logo_url cannot be null'); + } $this->container['company_logo_url'] = $company_logo_url; return $this; @@ -924,6 +1082,9 @@ public function getHeaderImageUrl() */ public function setHeaderImageUrl($header_image_url) { + if (is_null($header_image_url)) { + throw new \InvalidArgumentException('non-nullable header_image_url cannot be null'); + } $this->container['header_image_url'] = $header_image_url; return $this; @@ -948,6 +1109,9 @@ public function getHeaderCustomIcon() */ public function setHeaderCustomIcon($header_custom_icon) { + if (is_null($header_custom_icon)) { + throw new \InvalidArgumentException('non-nullable header_custom_icon cannot be null'); + } $this->container['header_custom_icon'] = $header_custom_icon; return $this; @@ -972,6 +1136,9 @@ public function getWelcomeMessage() */ public function setWelcomeMessage($welcome_message) { + if (is_null($welcome_message)) { + throw new \InvalidArgumentException('non-nullable welcome_message cannot be null'); + } $this->container['welcome_message'] = $welcome_message; return $this; @@ -996,6 +1163,9 @@ public function getIsAppleEnabled() */ public function setIsAppleEnabled($is_apple_enabled) { + if (is_null($is_apple_enabled)) { + throw new \InvalidArgumentException('non-nullable is_apple_enabled cannot be null'); + } $this->container['is_apple_enabled'] = $is_apple_enabled; return $this; @@ -1020,6 +1190,9 @@ public function getIsGoogleEnabled() */ public function setIsGoogleEnabled($is_google_enabled) { + if (is_null($is_google_enabled)) { + throw new \InvalidArgumentException('non-nullable is_google_enabled cannot be null'); + } $this->container['is_google_enabled'] = $is_google_enabled; return $this; @@ -1044,6 +1217,9 @@ public function getIsSamsungEnabled() */ public function setIsSamsungEnabled($is_samsung_enabled) { + if (is_null($is_samsung_enabled)) { + throw new \InvalidArgumentException('non-nullable is_samsung_enabled cannot be null'); + } $this->container['is_samsung_enabled'] = $is_samsung_enabled; return $this; @@ -1068,6 +1244,9 @@ public function getIsAdCredits() */ public function setIsAdCredits($is_ad_credits) { + if (is_null($is_ad_credits)) { + throw new \InvalidArgumentException('non-nullable is_ad_credits cannot be null'); + } $this->container['is_ad_credits'] = $is_ad_credits; return $this; @@ -1092,6 +1271,9 @@ public function getIsStaticVouchers() */ public function setIsStaticVouchers($is_static_vouchers) { + if (is_null($is_static_vouchers)) { + throw new \InvalidArgumentException('non-nullable is_static_vouchers cannot be null'); + } $this->container['is_static_vouchers'] = $is_static_vouchers; return $this; @@ -1116,6 +1298,9 @@ public function getIsDynamicVouchers() */ public function setIsDynamicVouchers($is_dynamic_vouchers) { + if (is_null($is_dynamic_vouchers)) { + throw new \InvalidArgumentException('non-nullable is_dynamic_vouchers cannot be null'); + } $this->container['is_dynamic_vouchers'] = $is_dynamic_vouchers; return $this; @@ -1140,6 +1325,9 @@ public function getIsMembershipTier() */ public function setIsMembershipTier($is_membership_tier) { + if (is_null($is_membership_tier)) { + throw new \InvalidArgumentException('non-nullable is_membership_tier cannot be null'); + } $this->container['is_membership_tier'] = $is_membership_tier; return $this; @@ -1164,6 +1352,9 @@ public function getIsMembershipPoints() */ public function setIsMembershipPoints($is_membership_points) { + if (is_null($is_membership_points)) { + throw new \InvalidArgumentException('non-nullable is_membership_points cannot be null'); + } $this->container['is_membership_points'] = $is_membership_points; return $this; @@ -1188,6 +1379,9 @@ public function getIsMembershipLevel() */ public function setIsMembershipLevel($is_membership_level) { + if (is_null($is_membership_level)) { + throw new \InvalidArgumentException('non-nullable is_membership_level cannot be null'); + } $this->container['is_membership_level'] = $is_membership_level; return $this; @@ -1212,6 +1406,9 @@ public function getIsGiftCards() */ public function setIsGiftCards($is_gift_cards) { + if (is_null($is_gift_cards)) { + throw new \InvalidArgumentException('non-nullable is_gift_cards cannot be null'); + } $this->container['is_gift_cards'] = $is_gift_cards; return $this; @@ -1236,6 +1433,9 @@ public function getIsGiftCertificates() */ public function setIsGiftCertificates($is_gift_certificates) { + if (is_null($is_gift_certificates)) { + throw new \InvalidArgumentException('non-nullable is_gift_certificates cannot be null'); + } $this->container['is_gift_certificates'] = $is_gift_certificates; return $this; @@ -1260,6 +1460,9 @@ public function getIsPromotions() */ public function setIsPromotions($is_promotions) { + if (is_null($is_promotions)) { + throw new \InvalidArgumentException('non-nullable is_promotions cannot be null'); + } $this->container['is_promotions'] = $is_promotions; return $this; @@ -1284,6 +1487,9 @@ public function getIsMerchantCredit() */ public function setIsMerchantCredit($is_merchant_credit) { + if (is_null($is_merchant_credit)) { + throw new \InvalidArgumentException('non-nullable is_merchant_credit cannot be null'); + } $this->container['is_merchant_credit'] = $is_merchant_credit; return $this; @@ -1308,6 +1514,9 @@ public function getIsTickets() */ public function setIsTickets($is_tickets) { + if (is_null($is_tickets)) { + throw new \InvalidArgumentException('non-nullable is_tickets cannot be null'); + } $this->container['is_tickets'] = $is_tickets; return $this; @@ -1332,6 +1541,9 @@ public function getIsNewsArticles() */ public function setIsNewsArticles($is_news_articles) { + if (is_null($is_news_articles)) { + throw new \InvalidArgumentException('non-nullable is_news_articles cannot be null'); + } $this->container['is_news_articles'] = $is_news_articles; return $this; @@ -1356,6 +1568,9 @@ public function getIsPerformances() */ public function setIsPerformances($is_performances) { + if (is_null($is_performances)) { + throw new \InvalidArgumentException('non-nullable is_performances cannot be null'); + } $this->container['is_performances'] = $is_performances; return $this; @@ -1380,6 +1595,9 @@ public function getIsMessages() */ public function setIsMessages($is_messages) { + if (is_null($is_messages)) { + throw new \InvalidArgumentException('non-nullable is_messages cannot be null'); + } $this->container['is_messages'] = $is_messages; return $this; @@ -1404,6 +1622,9 @@ public function getIsCall() */ public function setIsCall($is_call) { + if (is_null($is_call)) { + throw new \InvalidArgumentException('non-nullable is_call cannot be null'); + } $this->container['is_call'] = $is_call; return $this; @@ -1428,6 +1649,9 @@ public function getIsRepresentatives() */ public function setIsRepresentatives($is_representatives) { + if (is_null($is_representatives)) { + throw new \InvalidArgumentException('non-nullable is_representatives cannot be null'); + } $this->container['is_representatives'] = $is_representatives; return $this; @@ -1452,6 +1676,9 @@ public function getIsProducts() */ public function setIsProducts($is_products) { + if (is_null($is_products)) { + throw new \InvalidArgumentException('non-nullable is_products cannot be null'); + } $this->container['is_products'] = $is_products; return $this; @@ -1476,6 +1703,9 @@ public function getIsServices() */ public function setIsServices($is_services) { + if (is_null($is_services)) { + throw new \InvalidArgumentException('non-nullable is_services cannot be null'); + } $this->container['is_services'] = $is_services; return $this; @@ -1500,6 +1730,9 @@ public function getIsRoomRates() */ public function setIsRoomRates($is_room_rates) { + if (is_null($is_room_rates)) { + throw new \InvalidArgumentException('non-nullable is_room_rates cannot be null'); + } $this->container['is_room_rates'] = $is_room_rates; return $this; @@ -1524,6 +1757,9 @@ public function getIsAmenities() */ public function setIsAmenities($is_amenities) { + if (is_null($is_amenities)) { + throw new \InvalidArgumentException('non-nullable is_amenities cannot be null'); + } $this->container['is_amenities'] = $is_amenities; return $this; @@ -1548,6 +1784,9 @@ public function getIsGaming() */ public function setIsGaming($is_gaming) { + if (is_null($is_gaming)) { + throw new \InvalidArgumentException('non-nullable is_gaming cannot be null'); + } $this->container['is_gaming'] = $is_gaming; return $this; @@ -1572,6 +1811,9 @@ public function getIsDining() */ public function setIsDining($is_dining) { + if (is_null($is_dining)) { + throw new \InvalidArgumentException('non-nullable is_dining cannot be null'); + } $this->container['is_dining'] = $is_dining; return $this; @@ -1596,6 +1838,9 @@ public function getIsLounges() */ public function setIsLounges($is_lounges) { + if (is_null($is_lounges)) { + throw new \InvalidArgumentException('non-nullable is_lounges cannot be null'); + } $this->container['is_lounges'] = $is_lounges; return $this; @@ -1620,6 +1865,9 @@ public function getIsMapDirections() */ public function setIsMapDirections($is_map_directions) { + if (is_null($is_map_directions)) { + throw new \InvalidArgumentException('non-nullable is_map_directions cannot be null'); + } $this->container['is_map_directions'] = $is_map_directions; return $this; @@ -1644,6 +1892,9 @@ public function getIsLinkBook() */ public function setIsLinkBook($is_link_book) { + if (is_null($is_link_book)) { + throw new \InvalidArgumentException('non-nullable is_link_book cannot be null'); + } $this->container['is_link_book'] = $is_link_book; return $this; @@ -1668,6 +1919,9 @@ public function getIsImageGrid() */ public function setIsImageGrid($is_image_grid) { + if (is_null($is_image_grid)) { + throw new \InvalidArgumentException('non-nullable is_image_grid cannot be null'); + } $this->container['is_image_grid'] = $is_image_grid; return $this; @@ -1692,6 +1946,9 @@ public function getIsVideos() */ public function setIsVideos($is_videos) { + if (is_null($is_videos)) { + throw new \InvalidArgumentException('non-nullable is_videos cannot be null'); + } $this->container['is_videos'] = $is_videos; return $this; @@ -1716,6 +1973,9 @@ public function getIsTransactionHistory() */ public function setIsTransactionHistory($is_transaction_history) { + if (is_null($is_transaction_history)) { + throw new \InvalidArgumentException('non-nullable is_transaction_history cannot be null'); + } $this->container['is_transaction_history'] = $is_transaction_history; return $this; @@ -1740,6 +2000,9 @@ public function getIsProfile() */ public function setIsProfile($is_profile) { + if (is_null($is_profile)) { + throw new \InvalidArgumentException('non-nullable is_profile cannot be null'); + } $this->container['is_profile'] = $is_profile; return $this; @@ -1764,6 +2027,9 @@ public function getIsSettings() */ public function setIsSettings($is_settings) { + if (is_null($is_settings)) { + throw new \InvalidArgumentException('non-nullable is_settings cannot be null'); + } $this->container['is_settings'] = $is_settings; return $this; @@ -1788,6 +2054,9 @@ public function getIsChatRoom() */ public function setIsChatRoom($is_chat_room) { + if (is_null($is_chat_room)) { + throw new \InvalidArgumentException('non-nullable is_chat_room cannot be null'); + } $this->container['is_chat_room'] = $is_chat_room; return $this; @@ -1812,6 +2081,9 @@ public function getIsSmsOptIn() */ public function setIsSmsOptIn($is_sms_opt_in) { + if (is_null($is_sms_opt_in)) { + throw new \InvalidArgumentException('non-nullable is_sms_opt_in cannot be null'); + } $this->container['is_sms_opt_in'] = $is_sms_opt_in; return $this; @@ -1820,7 +2092,7 @@ public function setIsSmsOptIn($is_sms_opt_in) /** * Gets sms_opt_in_source_id * - * @return string|null + * @return \OpenAPI\Client\Model\WalletConfigurationSmsOptInSourceID|null */ public function getSmsOptInSourceId() { @@ -1830,22 +2102,15 @@ public function getSmsOptInSourceId() /** * Sets sms_opt_in_source_id * - * @param string|null $sms_opt_in_source_id sms_opt_in_source_id + * @param \OpenAPI\Client\Model\WalletConfigurationSmsOptInSourceID|null $sms_opt_in_source_id sms_opt_in_source_id * * @return self */ public function setSmsOptInSourceId($sms_opt_in_source_id) { - if (!is_null($sms_opt_in_source_id) && (mb_strlen($sms_opt_in_source_id) > 10)) { - throw new \InvalidArgumentException('invalid length for $sms_opt_in_source_id when calling WTWalletConfigurationSaveWalletRecord., must be smaller than or equal to 10.'); - } - if (!is_null($sms_opt_in_source_id) && (mb_strlen($sms_opt_in_source_id) < 10)) { - throw new \InvalidArgumentException('invalid length for $sms_opt_in_source_id when calling WTWalletConfigurationSaveWalletRecord., must be bigger than or equal to 10.'); + if (is_null($sms_opt_in_source_id)) { + throw new \InvalidArgumentException('non-nullable sms_opt_in_source_id cannot be null'); } - if (!is_null($sms_opt_in_source_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $sms_opt_in_source_id))) { - throw new \InvalidArgumentException("invalid value for $sms_opt_in_source_id when calling WTWalletConfigurationSaveWalletRecord., must conform to the pattern /^[a-zA-Z0-9]+$/."); - } - $this->container['sms_opt_in_source_id'] = $sms_opt_in_source_id; return $this; @@ -1870,6 +2135,9 @@ public function getIsEmailSubscriber() */ public function setIsEmailSubscriber($is_email_subscriber) { + if (is_null($is_email_subscriber)) { + throw new \InvalidArgumentException('non-nullable is_email_subscriber cannot be null'); + } $this->container['is_email_subscriber'] = $is_email_subscriber; return $this; @@ -1894,6 +2162,9 @@ public function getGoogleAnalyticsId() */ public function setGoogleAnalyticsId($google_analytics_id) { + if (is_null($google_analytics_id)) { + throw new \InvalidArgumentException('non-nullable google_analytics_id cannot be null'); + } $this->container['google_analytics_id'] = $google_analytics_id; return $this; @@ -1918,6 +2189,9 @@ public function getFacebookPixelId() */ public function setFacebookPixelId($facebook_pixel_id) { + if (is_null($facebook_pixel_id)) { + throw new \InvalidArgumentException('non-nullable facebook_pixel_id cannot be null'); + } $this->container['facebook_pixel_id'] = $facebook_pixel_id; return $this; @@ -1926,7 +2200,7 @@ public function setFacebookPixelId($facebook_pixel_id) /** * Gets public_chat_room_channel_id * - * @return double|null + * @return float|null */ public function getPublicChatRoomChannelId() { @@ -1936,12 +2210,15 @@ public function getPublicChatRoomChannelId() /** * Sets public_chat_room_channel_id * - * @param double|null $public_chat_room_channel_id public_chat_room_channel_id + * @param float|null $public_chat_room_channel_id public_chat_room_channel_id * * @return self */ public function setPublicChatRoomChannelId($public_chat_room_channel_id) { + if (is_null($public_chat_room_channel_id)) { + throw new \InvalidArgumentException('non-nullable public_chat_room_channel_id cannot be null'); + } $this->container['public_chat_room_channel_id'] = $public_chat_room_channel_id; return $this; @@ -1966,6 +2243,9 @@ public function getVanityHandle() */ public function setVanityHandle($vanity_handle) { + if (is_null($vanity_handle)) { + throw new \InvalidArgumentException('non-nullable vanity_handle cannot be null'); + } $this->container['vanity_handle'] = $vanity_handle; return $this; @@ -1990,6 +2270,9 @@ public function getVanityPageWalletPrefix() */ public function setVanityPageWalletPrefix($vanity_page_wallet_prefix) { + if (is_null($vanity_page_wallet_prefix)) { + throw new \InvalidArgumentException('non-nullable vanity_page_wallet_prefix cannot be null'); + } $this->container['vanity_page_wallet_prefix'] = $vanity_page_wallet_prefix; return $this; @@ -2014,6 +2297,9 @@ public function getMerchantCreditPaymentDesignId() */ public function setMerchantCreditPaymentDesignId($merchant_credit_payment_design_id) { + if (is_null($merchant_credit_payment_design_id)) { + throw new \InvalidArgumentException('non-nullable merchant_credit_payment_design_id cannot be null'); + } $this->container['merchant_credit_payment_design_id'] = $merchant_credit_payment_design_id; return $this; @@ -2038,6 +2324,9 @@ public function getCustomDomain() */ public function setCustomDomain($custom_domain) { + if (is_null($custom_domain)) { + throw new \InvalidArgumentException('non-nullable custom_domain cannot be null'); + } $this->container['custom_domain'] = $custom_domain; return $this; @@ -2062,6 +2351,9 @@ public function getIsClaimed() */ public function setIsClaimed($is_claimed) { + if (is_null($is_claimed)) { + throw new \InvalidArgumentException('non-nullable is_claimed cannot be null'); + } $this->container['is_claimed'] = $is_claimed; return $this; @@ -2086,6 +2378,9 @@ public function getMobileAppIconUrl() */ public function setMobileAppIconUrl($mobile_app_icon_url) { + if (is_null($mobile_app_icon_url)) { + throw new \InvalidArgumentException('non-nullable mobile_app_icon_url cannot be null'); + } $this->container['mobile_app_icon_url'] = $mobile_app_icon_url; return $this; @@ -2110,6 +2405,9 @@ public function getIsAgeGate() */ public function setIsAgeGate($is_age_gate) { + if (is_null($is_age_gate)) { + throw new \InvalidArgumentException('non-nullable is_age_gate cannot be null'); + } $this->container['is_age_gate'] = $is_age_gate; return $this; @@ -2118,7 +2416,7 @@ public function setIsAgeGate($is_age_gate) /** * Gets age_gate_minimum * - * @return double|null + * @return float|null */ public function getAgeGateMinimum() { @@ -2128,12 +2426,15 @@ public function getAgeGateMinimum() /** * Sets age_gate_minimum * - * @param double|null $age_gate_minimum age_gate_minimum + * @param float|null $age_gate_minimum age_gate_minimum * * @return self */ public function setAgeGateMinimum($age_gate_minimum) { + if (is_null($age_gate_minimum)) { + throw new \InvalidArgumentException('non-nullable age_gate_minimum cannot be null'); + } $this->container['age_gate_minimum'] = $age_gate_minimum; return $this; @@ -2158,6 +2459,9 @@ public function getSocialInstagramUrl() */ public function setSocialInstagramUrl($social_instagram_url) { + if (is_null($social_instagram_url)) { + throw new \InvalidArgumentException('non-nullable social_instagram_url cannot be null'); + } $this->container['social_instagram_url'] = $social_instagram_url; return $this; @@ -2182,6 +2486,9 @@ public function getSocialFacebookUrl() */ public function setSocialFacebookUrl($social_facebook_url) { + if (is_null($social_facebook_url)) { + throw new \InvalidArgumentException('non-nullable social_facebook_url cannot be null'); + } $this->container['social_facebook_url'] = $social_facebook_url; return $this; @@ -2206,6 +2513,9 @@ public function getSocialYouTubeUrl() */ public function setSocialYouTubeUrl($social_you_tube_url) { + if (is_null($social_you_tube_url)) { + throw new \InvalidArgumentException('non-nullable social_you_tube_url cannot be null'); + } $this->container['social_you_tube_url'] = $social_you_tube_url; return $this; @@ -2230,6 +2540,9 @@ public function getSocialTwitterUrl() */ public function setSocialTwitterUrl($social_twitter_url) { + if (is_null($social_twitter_url)) { + throw new \InvalidArgumentException('non-nullable social_twitter_url cannot be null'); + } $this->container['social_twitter_url'] = $social_twitter_url; return $this; @@ -2254,6 +2567,9 @@ public function getSocialLinkedInUrl() */ public function setSocialLinkedInUrl($social_linked_in_url) { + if (is_null($social_linked_in_url)) { + throw new \InvalidArgumentException('non-nullable social_linked_in_url cannot be null'); + } $this->container['social_linked_in_url'] = $social_linked_in_url; return $this; @@ -2278,6 +2594,9 @@ public function getPrimaryPhoneNumber() */ public function setPrimaryPhoneNumber($primary_phone_number) { + if (is_null($primary_phone_number)) { + throw new \InvalidArgumentException('non-nullable primary_phone_number cannot be null'); + } $this->container['primary_phone_number'] = $primary_phone_number; return $this; @@ -2302,6 +2621,9 @@ public function getPrimaryWhatsApp() */ public function setPrimaryWhatsApp($primary_whats_app) { + if (is_null($primary_whats_app)) { + throw new \InvalidArgumentException('non-nullable primary_whats_app cannot be null'); + } $this->container['primary_whats_app'] = $primary_whats_app; return $this; @@ -2326,6 +2648,9 @@ public function getPrimaryEmailAddress() */ public function setPrimaryEmailAddress($primary_email_address) { + if (is_null($primary_email_address)) { + throw new \InvalidArgumentException('non-nullable primary_email_address cannot be null'); + } $this->container['primary_email_address'] = $primary_email_address; return $this; @@ -2337,7 +2662,7 @@ public function setPrimaryEmailAddress($primary_email_address) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -2349,6 +2674,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -2362,7 +2688,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -2378,7 +2704,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -2390,6 +2716,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTWalletItemRedemption.php b/lib/Model/WTWalletItemRedemption.php index e448693..36856b1 100644 --- a/lib/Model/WTWalletItemRedemption.php +++ b/lib/Model/WTWalletItemRedemption.php @@ -2,7 +2,7 @@ /** * WTWalletItemRedemption * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTWalletItemRedemption implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,7 +58,7 @@ class WTWalletItemRedemption implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'check_amount' => 'double', + 'check_amount' => 'float', 'transaction_number' => 'string', 'meta_value' => 'string' ]; @@ -78,6 +76,24 @@ class WTWalletItemRedemption implements ModelInterface, ArrayAccess, \JsonSerial 'meta_value' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'check_amount' => false, + 'transaction_number' => false, + 'meta_value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['check_amount'] = $data['check_amount'] ?? null; - $this->container['transaction_number'] = $data['transaction_number'] ?? null; - $this->container['meta_value'] = $data['meta_value'] ?? null; + $this->setIfExists('check_amount', $data ?? [], null); + $this->setIfExists('transaction_number', $data ?? [], null); + $this->setIfExists('meta_value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -227,7 +313,7 @@ public function valid() /** * Gets check_amount * - * @return double + * @return float */ public function getCheckAmount() { @@ -237,12 +323,15 @@ public function getCheckAmount() /** * Sets check_amount * - * @param double $check_amount check_amount + * @param float $check_amount check_amount * * @return self */ public function setCheckAmount($check_amount) { + if (is_null($check_amount)) { + throw new \InvalidArgumentException('non-nullable check_amount cannot be null'); + } $this->container['check_amount'] = $check_amount; return $this; @@ -267,6 +356,9 @@ public function getTransactionNumber() */ public function setTransactionNumber($transaction_number) { + if (is_null($transaction_number)) { + throw new \InvalidArgumentException('non-nullable transaction_number cannot be null'); + } $this->container['transaction_number'] = $transaction_number; return $this; @@ -291,6 +383,9 @@ public function getMetaValue() */ public function setMetaValue($meta_value) { + if (is_null($meta_value)) { + throw new \InvalidArgumentException('non-nullable meta_value cannot be null'); + } $this->container['meta_value'] = $meta_value; return $this; @@ -302,7 +397,7 @@ public function setMetaValue($meta_value) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -314,6 +409,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -327,7 +423,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -343,7 +439,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -355,6 +451,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTWalletObjectPrefixCounts.php b/lib/Model/WTWalletObjectPrefixCounts.php index 27430e4..a60c297 100644 --- a/lib/Model/WTWalletObjectPrefixCounts.php +++ b/lib/Model/WTWalletObjectPrefixCounts.php @@ -2,7 +2,7 @@ /** * WTWalletObjectPrefixCounts * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTWalletObjectPrefixCounts implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -78,6 +76,24 @@ class WTWalletObjectPrefixCounts implements ModelInterface, ArrayAccess, \JsonSe 'list' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'wallet_object_prefix' => false, + 'wallet_object_name' => false, + 'list' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -98,6 +114,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -189,9 +257,27 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['wallet_object_prefix'] = $data['wallet_object_prefix'] ?? null; - $this->container['wallet_object_name'] = $data['wallet_object_name'] ?? null; - $this->container['list'] = $data['list'] ?? null; + $this->setIfExists('wallet_object_prefix', $data ?? [], null); + $this->setIfExists('wallet_object_name', $data ?? [], null); + $this->setIfExists('list', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -246,6 +332,9 @@ public function getWalletObjectPrefix() */ public function setWalletObjectPrefix($wallet_object_prefix) { + if (is_null($wallet_object_prefix)) { + throw new \InvalidArgumentException('non-nullable wallet_object_prefix cannot be null'); + } $this->container['wallet_object_prefix'] = $wallet_object_prefix; return $this; @@ -270,6 +359,9 @@ public function getWalletObjectName() */ public function setWalletObjectName($wallet_object_name) { + if (is_null($wallet_object_name)) { + throw new \InvalidArgumentException('non-nullable wallet_object_name cannot be null'); + } $this->container['wallet_object_name'] = $wallet_object_name; return $this; @@ -294,6 +386,9 @@ public function getList() */ public function setList($list) { + if (is_null($list)) { + throw new \InvalidArgumentException('non-nullable list cannot be null'); + } $this->container['list'] = $list; return $this; @@ -305,7 +400,7 @@ public function setList($list) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -317,6 +412,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -330,7 +426,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -346,7 +442,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -358,6 +454,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTWalletPageView.php b/lib/Model/WTWalletPageView.php index f6a9e34..71a60f6 100644 --- a/lib/Model/WTWalletPageView.php +++ b/lib/Model/WTWalletPageView.php @@ -2,7 +2,7 @@ /** * WTWalletPageView * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTWalletPageView implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -80,7 +78,7 @@ class WTWalletPageView implements ModelInterface, ArrayAccess, \JsonSerializable 'phone_verification_token' => 'string', 'referring_domain' => 'string', 'referrer' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'status' => 'string', 'country' => 'string', 'country_code' => 'string', @@ -88,8 +86,8 @@ class WTWalletPageView implements ModelInterface, ArrayAccess, \JsonSerializable 'region_name' => 'string', 'city' => 'string', 'zip' => 'string', - 'latitude' => 'double', - 'longitude' => 'double', + 'latitude' => 'float', + 'longitude' => 'float', 'timezone' => 'string', 'isp' => 'string', 'org' => 'string', @@ -150,6 +148,60 @@ class WTWalletPageView implements ModelInterface, ArrayAccess, \JsonSerializable 'geo_point' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ip' => false, + 'wallet_object_id' => false, + 'wallet_object_prefix' => false, + 'parent_object_id' => false, + 'parent_object_prefix' => false, + 'session_id' => false, + 'navigator_agent' => false, + 'browser_name' => false, + 'browser_version' => false, + 'engine_name' => false, + 'engine_version' => false, + 'o_s_name' => false, + 'o_s_version' => false, + 'is_mobile' => false, + 'device_vendor' => false, + 'device_model' => false, + 'device_type' => false, + 'phone_verification_token' => false, + 'referring_domain' => false, + 'referrer' => false, + 'id' => false, + 'status' => false, + 'country' => false, + 'country_code' => false, + 'region' => false, + 'region_name' => false, + 'city' => false, + 'zip' => false, + 'latitude' => false, + 'longitude' => false, + 'timezone' => false, + 'isp' => false, + 'org' => false, + 'asn' => false, + 'created_at' => false, + 'updated_at' => false, + 'merchant_id' => false, + 'is_active' => false, + 'geo_point' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -170,6 +222,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -369,45 +473,63 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['ip'] = $data['ip'] ?? null; - $this->container['wallet_object_id'] = $data['wallet_object_id'] ?? null; - $this->container['wallet_object_prefix'] = $data['wallet_object_prefix'] ?? null; - $this->container['parent_object_id'] = $data['parent_object_id'] ?? null; - $this->container['parent_object_prefix'] = $data['parent_object_prefix'] ?? null; - $this->container['session_id'] = $data['session_id'] ?? null; - $this->container['navigator_agent'] = $data['navigator_agent'] ?? null; - $this->container['browser_name'] = $data['browser_name'] ?? null; - $this->container['browser_version'] = $data['browser_version'] ?? null; - $this->container['engine_name'] = $data['engine_name'] ?? null; - $this->container['engine_version'] = $data['engine_version'] ?? null; - $this->container['o_s_name'] = $data['o_s_name'] ?? null; - $this->container['o_s_version'] = $data['o_s_version'] ?? null; - $this->container['is_mobile'] = $data['is_mobile'] ?? null; - $this->container['device_vendor'] = $data['device_vendor'] ?? null; - $this->container['device_model'] = $data['device_model'] ?? null; - $this->container['device_type'] = $data['device_type'] ?? null; - $this->container['phone_verification_token'] = $data['phone_verification_token'] ?? null; - $this->container['referring_domain'] = $data['referring_domain'] ?? null; - $this->container['referrer'] = $data['referrer'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['country'] = $data['country'] ?? null; - $this->container['country_code'] = $data['country_code'] ?? null; - $this->container['region'] = $data['region'] ?? null; - $this->container['region_name'] = $data['region_name'] ?? null; - $this->container['city'] = $data['city'] ?? null; - $this->container['zip'] = $data['zip'] ?? null; - $this->container['latitude'] = $data['latitude'] ?? null; - $this->container['longitude'] = $data['longitude'] ?? null; - $this->container['timezone'] = $data['timezone'] ?? null; - $this->container['isp'] = $data['isp'] ?? null; - $this->container['org'] = $data['org'] ?? null; - $this->container['asn'] = $data['asn'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['geo_point'] = $data['geo_point'] ?? null; + $this->setIfExists('ip', $data ?? [], null); + $this->setIfExists('wallet_object_id', $data ?? [], null); + $this->setIfExists('wallet_object_prefix', $data ?? [], null); + $this->setIfExists('parent_object_id', $data ?? [], null); + $this->setIfExists('parent_object_prefix', $data ?? [], null); + $this->setIfExists('session_id', $data ?? [], null); + $this->setIfExists('navigator_agent', $data ?? [], null); + $this->setIfExists('browser_name', $data ?? [], null); + $this->setIfExists('browser_version', $data ?? [], null); + $this->setIfExists('engine_name', $data ?? [], null); + $this->setIfExists('engine_version', $data ?? [], null); + $this->setIfExists('o_s_name', $data ?? [], null); + $this->setIfExists('o_s_version', $data ?? [], null); + $this->setIfExists('is_mobile', $data ?? [], null); + $this->setIfExists('device_vendor', $data ?? [], null); + $this->setIfExists('device_model', $data ?? [], null); + $this->setIfExists('device_type', $data ?? [], null); + $this->setIfExists('phone_verification_token', $data ?? [], null); + $this->setIfExists('referring_domain', $data ?? [], null); + $this->setIfExists('referrer', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('region', $data ?? [], null); + $this->setIfExists('region_name', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('zip', $data ?? [], null); + $this->setIfExists('latitude', $data ?? [], null); + $this->setIfExists('longitude', $data ?? [], null); + $this->setIfExists('timezone', $data ?? [], null); + $this->setIfExists('isp', $data ?? [], null); + $this->setIfExists('org', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('geo_point', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -476,14 +598,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -584,6 +698,9 @@ public function getIp() */ public function setIp($ip) { + if (is_null($ip)) { + throw new \InvalidArgumentException('non-nullable ip cannot be null'); + } $this->container['ip'] = $ip; return $this; @@ -608,6 +725,9 @@ public function getWalletObjectId() */ public function setWalletObjectId($wallet_object_id) { + if (is_null($wallet_object_id)) { + throw new \InvalidArgumentException('non-nullable wallet_object_id cannot be null'); + } $this->container['wallet_object_id'] = $wallet_object_id; return $this; @@ -632,6 +752,9 @@ public function getWalletObjectPrefix() */ public function setWalletObjectPrefix($wallet_object_prefix) { + if (is_null($wallet_object_prefix)) { + throw new \InvalidArgumentException('non-nullable wallet_object_prefix cannot be null'); + } $this->container['wallet_object_prefix'] = $wallet_object_prefix; return $this; @@ -656,6 +779,9 @@ public function getParentObjectId() */ public function setParentObjectId($parent_object_id) { + if (is_null($parent_object_id)) { + throw new \InvalidArgumentException('non-nullable parent_object_id cannot be null'); + } $this->container['parent_object_id'] = $parent_object_id; return $this; @@ -680,6 +806,9 @@ public function getParentObjectPrefix() */ public function setParentObjectPrefix($parent_object_prefix) { + if (is_null($parent_object_prefix)) { + throw new \InvalidArgumentException('non-nullable parent_object_prefix cannot be null'); + } $this->container['parent_object_prefix'] = $parent_object_prefix; return $this; @@ -704,6 +833,9 @@ public function getSessionId() */ public function setSessionId($session_id) { + if (is_null($session_id)) { + throw new \InvalidArgumentException('non-nullable session_id cannot be null'); + } $this->container['session_id'] = $session_id; return $this; @@ -728,6 +860,9 @@ public function getNavigatorAgent() */ public function setNavigatorAgent($navigator_agent) { + if (is_null($navigator_agent)) { + throw new \InvalidArgumentException('non-nullable navigator_agent cannot be null'); + } $this->container['navigator_agent'] = $navigator_agent; return $this; @@ -752,6 +887,9 @@ public function getBrowserName() */ public function setBrowserName($browser_name) { + if (is_null($browser_name)) { + throw new \InvalidArgumentException('non-nullable browser_name cannot be null'); + } $this->container['browser_name'] = $browser_name; return $this; @@ -776,6 +914,9 @@ public function getBrowserVersion() */ public function setBrowserVersion($browser_version) { + if (is_null($browser_version)) { + throw new \InvalidArgumentException('non-nullable browser_version cannot be null'); + } $this->container['browser_version'] = $browser_version; return $this; @@ -800,6 +941,9 @@ public function getEngineName() */ public function setEngineName($engine_name) { + if (is_null($engine_name)) { + throw new \InvalidArgumentException('non-nullable engine_name cannot be null'); + } $this->container['engine_name'] = $engine_name; return $this; @@ -824,6 +968,9 @@ public function getEngineVersion() */ public function setEngineVersion($engine_version) { + if (is_null($engine_version)) { + throw new \InvalidArgumentException('non-nullable engine_version cannot be null'); + } $this->container['engine_version'] = $engine_version; return $this; @@ -848,6 +995,9 @@ public function getOSName() */ public function setOSName($o_s_name) { + if (is_null($o_s_name)) { + throw new \InvalidArgumentException('non-nullable o_s_name cannot be null'); + } $this->container['o_s_name'] = $o_s_name; return $this; @@ -872,6 +1022,9 @@ public function getOSVersion() */ public function setOSVersion($o_s_version) { + if (is_null($o_s_version)) { + throw new \InvalidArgumentException('non-nullable o_s_version cannot be null'); + } $this->container['o_s_version'] = $o_s_version; return $this; @@ -896,6 +1049,9 @@ public function getIsMobile() */ public function setIsMobile($is_mobile) { + if (is_null($is_mobile)) { + throw new \InvalidArgumentException('non-nullable is_mobile cannot be null'); + } $this->container['is_mobile'] = $is_mobile; return $this; @@ -920,6 +1076,9 @@ public function getDeviceVendor() */ public function setDeviceVendor($device_vendor) { + if (is_null($device_vendor)) { + throw new \InvalidArgumentException('non-nullable device_vendor cannot be null'); + } $this->container['device_vendor'] = $device_vendor; return $this; @@ -944,6 +1103,9 @@ public function getDeviceModel() */ public function setDeviceModel($device_model) { + if (is_null($device_model)) { + throw new \InvalidArgumentException('non-nullable device_model cannot be null'); + } $this->container['device_model'] = $device_model; return $this; @@ -968,6 +1130,9 @@ public function getDeviceType() */ public function setDeviceType($device_type) { + if (is_null($device_type)) { + throw new \InvalidArgumentException('non-nullable device_type cannot be null'); + } $this->container['device_type'] = $device_type; return $this; @@ -992,6 +1157,9 @@ public function getPhoneVerificationToken() */ public function setPhoneVerificationToken($phone_verification_token) { + if (is_null($phone_verification_token)) { + throw new \InvalidArgumentException('non-nullable phone_verification_token cannot be null'); + } $this->container['phone_verification_token'] = $phone_verification_token; return $this; @@ -1016,6 +1184,9 @@ public function getReferringDomain() */ public function setReferringDomain($referring_domain) { + if (is_null($referring_domain)) { + throw new \InvalidArgumentException('non-nullable referring_domain cannot be null'); + } $this->container['referring_domain'] = $referring_domain; return $this; @@ -1040,6 +1211,9 @@ public function getReferrer() */ public function setReferrer($referrer) { + if (is_null($referrer)) { + throw new \InvalidArgumentException('non-nullable referrer cannot be null'); + } $this->container['referrer'] = $referrer; return $this; @@ -1048,7 +1222,7 @@ public function setReferrer($referrer) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -1058,19 +1232,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTWalletPageView., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WTWalletPageView., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -1095,6 +1265,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -1119,6 +1292,9 @@ public function getCountry() */ public function setCountry($country) { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } $this->container['country'] = $country; return $this; @@ -1143,6 +1319,9 @@ public function getCountryCode() */ public function setCountryCode($country_code) { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } $this->container['country_code'] = $country_code; return $this; @@ -1167,6 +1346,9 @@ public function getRegion() */ public function setRegion($region) { + if (is_null($region)) { + throw new \InvalidArgumentException('non-nullable region cannot be null'); + } $this->container['region'] = $region; return $this; @@ -1191,6 +1373,9 @@ public function getRegionName() */ public function setRegionName($region_name) { + if (is_null($region_name)) { + throw new \InvalidArgumentException('non-nullable region_name cannot be null'); + } $this->container['region_name'] = $region_name; return $this; @@ -1215,6 +1400,9 @@ public function getCity() */ public function setCity($city) { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } $this->container['city'] = $city; return $this; @@ -1239,6 +1427,9 @@ public function getZip() */ public function setZip($zip) { + if (is_null($zip)) { + throw new \InvalidArgumentException('non-nullable zip cannot be null'); + } $this->container['zip'] = $zip; return $this; @@ -1247,7 +1438,7 @@ public function setZip($zip) /** * Gets latitude * - * @return double + * @return float */ public function getLatitude() { @@ -1257,12 +1448,15 @@ public function getLatitude() /** * Sets latitude * - * @param double $latitude latitude + * @param float $latitude latitude * * @return self */ public function setLatitude($latitude) { + if (is_null($latitude)) { + throw new \InvalidArgumentException('non-nullable latitude cannot be null'); + } $this->container['latitude'] = $latitude; return $this; @@ -1271,7 +1465,7 @@ public function setLatitude($latitude) /** * Gets longitude * - * @return double + * @return float */ public function getLongitude() { @@ -1281,12 +1475,15 @@ public function getLongitude() /** * Sets longitude * - * @param double $longitude longitude + * @param float $longitude longitude * * @return self */ public function setLongitude($longitude) { + if (is_null($longitude)) { + throw new \InvalidArgumentException('non-nullable longitude cannot be null'); + } $this->container['longitude'] = $longitude; return $this; @@ -1311,6 +1508,9 @@ public function getTimezone() */ public function setTimezone($timezone) { + if (is_null($timezone)) { + throw new \InvalidArgumentException('non-nullable timezone cannot be null'); + } $this->container['timezone'] = $timezone; return $this; @@ -1335,6 +1535,9 @@ public function getIsp() */ public function setIsp($isp) { + if (is_null($isp)) { + throw new \InvalidArgumentException('non-nullable isp cannot be null'); + } $this->container['isp'] = $isp; return $this; @@ -1359,6 +1562,9 @@ public function getOrg() */ public function setOrg($org) { + if (is_null($org)) { + throw new \InvalidArgumentException('non-nullable org cannot be null'); + } $this->container['org'] = $org; return $this; @@ -1383,6 +1589,9 @@ public function getAsn() */ public function setAsn($asn) { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } $this->container['asn'] = $asn; return $this; @@ -1407,6 +1616,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -1431,6 +1643,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -1455,14 +1670,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTWalletPageView., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WTWalletPageView., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WTWalletPageView., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WTWalletPageView., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -1489,6 +1707,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -1513,6 +1734,9 @@ public function getGeoPoint() */ public function setGeoPoint($geo_point) { + if (is_null($geo_point)) { + throw new \InvalidArgumentException('non-nullable geo_point cannot be null'); + } $this->container['geo_point'] = $geo_point; return $this; @@ -1524,7 +1748,7 @@ public function setGeoPoint($geo_point) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1536,6 +1760,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1549,7 +1774,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1565,7 +1790,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1577,6 +1802,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTWalletPageViewCount.php b/lib/Model/WTWalletPageViewCount.php index e9165e3..1bfbd61 100644 --- a/lib/Model/WTWalletPageViewCount.php +++ b/lib/Model/WTWalletPageViewCount.php @@ -2,7 +2,7 @@ /** * WTWalletPageViewCount * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTWalletPageViewCount implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -61,7 +59,7 @@ class WTWalletPageViewCount implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'wallet_object_id' => 'string', - 'count' => 'double', + 'count' => 'float', 'date_occurred' => '\DateTime', 'wallet_object_name' => 'string' ]; @@ -80,6 +78,25 @@ class WTWalletPageViewCount implements ModelInterface, ArrayAccess, \JsonSeriali 'wallet_object_name' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'wallet_object_id' => false, + 'count' => false, + 'date_occurred' => false, + 'wallet_object_name' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -100,6 +117,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -194,10 +263,28 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['wallet_object_id'] = $data['wallet_object_id'] ?? null; - $this->container['count'] = $data['count'] ?? null; - $this->container['date_occurred'] = $data['date_occurred'] ?? null; - $this->container['wallet_object_name'] = $data['wallet_object_name'] ?? null; + $this->setIfExists('wallet_object_id', $data ?? [], null); + $this->setIfExists('count', $data ?? [], null); + $this->setIfExists('date_occurred', $data ?? [], null); + $this->setIfExists('wallet_object_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -255,6 +342,9 @@ public function getWalletObjectId() */ public function setWalletObjectId($wallet_object_id) { + if (is_null($wallet_object_id)) { + throw new \InvalidArgumentException('non-nullable wallet_object_id cannot be null'); + } $this->container['wallet_object_id'] = $wallet_object_id; return $this; @@ -263,7 +353,7 @@ public function setWalletObjectId($wallet_object_id) /** * Gets count * - * @return double + * @return float */ public function getCount() { @@ -273,12 +363,15 @@ public function getCount() /** * Sets count * - * @param double $count count + * @param float $count count * * @return self */ public function setCount($count) { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } $this->container['count'] = $count; return $this; @@ -303,6 +396,9 @@ public function getDateOccurred() */ public function setDateOccurred($date_occurred) { + if (is_null($date_occurred)) { + throw new \InvalidArgumentException('non-nullable date_occurred cannot be null'); + } $this->container['date_occurred'] = $date_occurred; return $this; @@ -327,6 +423,9 @@ public function getWalletObjectName() */ public function setWalletObjectName($wallet_object_name) { + if (is_null($wallet_object_name)) { + throw new \InvalidArgumentException('non-nullable wallet_object_name cannot be null'); + } $this->container['wallet_object_name'] = $wallet_object_name; return $this; @@ -338,7 +437,7 @@ public function setWalletObjectName($wallet_object_name) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -350,6 +449,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -363,7 +463,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -379,7 +479,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -391,6 +491,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTWalletPageViewGeoPoint.php b/lib/Model/WTWalletPageViewGeoPoint.php index 7829582..b38b5f8 100644 --- a/lib/Model/WTWalletPageViewGeoPoint.php +++ b/lib/Model/WTWalletPageViewGeoPoint.php @@ -2,7 +2,7 @@ /** * WTWalletPageViewGeoPoint * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WTWalletPageViewGeoPoint implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -60,8 +58,8 @@ class WTWalletPageViewGeoPoint implements ModelInterface, ArrayAccess, \JsonSeri * @var string[] */ protected static $openAPITypes = [ - 'longitude' => 'double', - 'latitude' => 'double' + 'longitude' => 'float', + 'latitude' => 'float' ]; /** @@ -76,6 +74,23 @@ class WTWalletPageViewGeoPoint implements ModelInterface, ArrayAccess, \JsonSeri 'latitude' => 'double' ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'longitude' => false, + 'latitude' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -96,6 +111,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -184,8 +251,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['longitude'] = $data['longitude'] ?? null; - $this->container['latitude'] = $data['latitude'] ?? null; + $this->setIfExists('longitude', $data ?? [], null); + $this->setIfExists('latitude', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -221,7 +306,7 @@ public function valid() /** * Gets longitude * - * @return double + * @return float */ public function getLongitude() { @@ -231,12 +316,15 @@ public function getLongitude() /** * Sets longitude * - * @param double $longitude longitude + * @param float $longitude longitude * * @return self */ public function setLongitude($longitude) { + if (is_null($longitude)) { + throw new \InvalidArgumentException('non-nullable longitude cannot be null'); + } $this->container['longitude'] = $longitude; return $this; @@ -245,7 +333,7 @@ public function setLongitude($longitude) /** * Gets latitude * - * @return double + * @return float */ public function getLatitude() { @@ -255,12 +343,15 @@ public function getLatitude() /** * Sets latitude * - * @param double $latitude latitude + * @param float $latitude latitude * * @return self */ public function setLatitude($latitude) { + if (is_null($latitude)) { + throw new \InvalidArgumentException('non-nullable latitude cannot be null'); + } $this->container['latitude'] = $latitude; return $this; @@ -272,7 +363,7 @@ public function setLatitude($latitude) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -284,6 +375,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -297,7 +389,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -313,7 +405,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -325,6 +417,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WTWalletPageViewId.php b/lib/Model/WTWalletPageViewId.php new file mode 100644 index 0000000..0ca71f1 --- /dev/null +++ b/lib/Model/WTWalletPageViewId.php @@ -0,0 +1,382 @@ + + */ +class WTWalletPageViewId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WTWalletPageView_id'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WalletConfiguration.php b/lib/Model/WalletConfiguration.php index 7bb92bf..9252c81 100644 --- a/lib/Model/WalletConfiguration.php +++ b/lib/Model/WalletConfiguration.php @@ -2,7 +2,7 @@ /** * WalletConfiguration * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WalletConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -105,11 +103,11 @@ class WalletConfiguration implements ModelInterface, ArrayAccess, \JsonSerializa 'is_settings' => 'bool', 'is_chat_room' => 'bool', 'is_sms_opt_in' => 'bool', - 'sms_opt_in_source_id' => 'string', + 'sms_opt_in_source_id' => '\OpenAPI\Client\Model\WalletConfigurationSmsOptInSourceID', 'is_email_subscriber' => 'bool', 'google_analytics_id' => 'string', 'facebook_pixel_id' => 'string', - 'public_chat_room_channel_id' => 'double', + 'public_chat_room_channel_id' => 'float', 'vanity_handle' => 'string', 'vanity_page_wallet_prefix' => 'string', 'merchant_credit_payment_design_id' => 'string', @@ -117,7 +115,7 @@ class WalletConfiguration implements ModelInterface, ArrayAccess, \JsonSerializa 'is_claimed' => 'bool', 'mobile_app_icon_url' => 'string', 'is_age_gate' => 'bool', - 'age_gate_minimum' => 'double', + 'age_gate_minimum' => 'float', 'social_instagram_url' => 'string', 'social_facebook_url' => 'string', 'social_you_tube_url' => 'string', @@ -212,6 +210,91 @@ class WalletConfiguration implements ModelInterface, ArrayAccess, \JsonSerializa 'merchant_id' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'header_background_color' => false, + 'header_button_color' => false, + 'left_menu_header_background_color' => false, + 'left_menu_header_font_color' => false, + 'left_menu_section_background_color' => false, + 'left_menu_section_font_color' => false, + 'company_logo_url' => false, + 'header_image_url' => false, + 'header_custom_icon' => false, + 'welcome_message' => false, + 'is_apple_enabled' => false, + 'is_google_enabled' => false, + 'is_samsung_enabled' => false, + 'is_ad_credits' => false, + 'is_static_vouchers' => false, + 'is_dynamic_vouchers' => false, + 'is_membership_tier' => false, + 'is_membership_points' => false, + 'is_membership_level' => false, + 'is_gift_cards' => false, + 'is_gift_certificates' => false, + 'is_promotions' => false, + 'is_merchant_credit' => false, + 'is_tickets' => false, + 'is_news_articles' => false, + 'is_performances' => false, + 'is_messages' => false, + 'is_call' => false, + 'is_representatives' => false, + 'is_products' => false, + 'is_services' => false, + 'is_room_rates' => false, + 'is_amenities' => false, + 'is_gaming' => false, + 'is_dining' => false, + 'is_lounges' => false, + 'is_map_directions' => false, + 'is_link_book' => false, + 'is_image_grid' => false, + 'is_videos' => false, + 'is_transaction_history' => false, + 'is_profile' => false, + 'is_settings' => false, + 'is_chat_room' => false, + 'is_sms_opt_in' => false, + 'sms_opt_in_source_id' => false, + 'is_email_subscriber' => false, + 'google_analytics_id' => false, + 'facebook_pixel_id' => false, + 'public_chat_room_channel_id' => false, + 'vanity_handle' => false, + 'vanity_page_wallet_prefix' => false, + 'merchant_credit_payment_design_id' => false, + 'custom_domain' => false, + 'is_claimed' => false, + 'mobile_app_icon_url' => false, + 'is_age_gate' => false, + 'age_gate_minimum' => false, + 'social_instagram_url' => false, + 'social_facebook_url' => false, + 'social_you_tube_url' => false, + 'social_twitter_url' => false, + 'social_linked_in_url' => false, + 'primary_phone_number' => false, + 'primary_whats_app' => false, + 'primary_email_address' => false, + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'merchant_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -232,6 +315,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -524,76 +659,94 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['header_background_color'] = $data['header_background_color'] ?? null; - $this->container['header_button_color'] = $data['header_button_color'] ?? null; - $this->container['left_menu_header_background_color'] = $data['left_menu_header_background_color'] ?? null; - $this->container['left_menu_header_font_color'] = $data['left_menu_header_font_color'] ?? null; - $this->container['left_menu_section_background_color'] = $data['left_menu_section_background_color'] ?? null; - $this->container['left_menu_section_font_color'] = $data['left_menu_section_font_color'] ?? null; - $this->container['company_logo_url'] = $data['company_logo_url'] ?? null; - $this->container['header_image_url'] = $data['header_image_url'] ?? null; - $this->container['header_custom_icon'] = $data['header_custom_icon'] ?? null; - $this->container['welcome_message'] = $data['welcome_message'] ?? null; - $this->container['is_apple_enabled'] = $data['is_apple_enabled'] ?? null; - $this->container['is_google_enabled'] = $data['is_google_enabled'] ?? null; - $this->container['is_samsung_enabled'] = $data['is_samsung_enabled'] ?? null; - $this->container['is_ad_credits'] = $data['is_ad_credits'] ?? null; - $this->container['is_static_vouchers'] = $data['is_static_vouchers'] ?? null; - $this->container['is_dynamic_vouchers'] = $data['is_dynamic_vouchers'] ?? null; - $this->container['is_membership_tier'] = $data['is_membership_tier'] ?? null; - $this->container['is_membership_points'] = $data['is_membership_points'] ?? null; - $this->container['is_membership_level'] = $data['is_membership_level'] ?? null; - $this->container['is_gift_cards'] = $data['is_gift_cards'] ?? null; - $this->container['is_gift_certificates'] = $data['is_gift_certificates'] ?? null; - $this->container['is_promotions'] = $data['is_promotions'] ?? null; - $this->container['is_merchant_credit'] = $data['is_merchant_credit'] ?? null; - $this->container['is_tickets'] = $data['is_tickets'] ?? null; - $this->container['is_news_articles'] = $data['is_news_articles'] ?? null; - $this->container['is_performances'] = $data['is_performances'] ?? null; - $this->container['is_messages'] = $data['is_messages'] ?? null; - $this->container['is_call'] = $data['is_call'] ?? null; - $this->container['is_representatives'] = $data['is_representatives'] ?? null; - $this->container['is_products'] = $data['is_products'] ?? null; - $this->container['is_services'] = $data['is_services'] ?? null; - $this->container['is_room_rates'] = $data['is_room_rates'] ?? null; - $this->container['is_amenities'] = $data['is_amenities'] ?? null; - $this->container['is_gaming'] = $data['is_gaming'] ?? null; - $this->container['is_dining'] = $data['is_dining'] ?? null; - $this->container['is_lounges'] = $data['is_lounges'] ?? null; - $this->container['is_map_directions'] = $data['is_map_directions'] ?? null; - $this->container['is_link_book'] = $data['is_link_book'] ?? null; - $this->container['is_image_grid'] = $data['is_image_grid'] ?? null; - $this->container['is_videos'] = $data['is_videos'] ?? null; - $this->container['is_transaction_history'] = $data['is_transaction_history'] ?? null; - $this->container['is_profile'] = $data['is_profile'] ?? null; - $this->container['is_settings'] = $data['is_settings'] ?? null; - $this->container['is_chat_room'] = $data['is_chat_room'] ?? null; - $this->container['is_sms_opt_in'] = $data['is_sms_opt_in'] ?? null; - $this->container['sms_opt_in_source_id'] = $data['sms_opt_in_source_id'] ?? null; - $this->container['is_email_subscriber'] = $data['is_email_subscriber'] ?? null; - $this->container['google_analytics_id'] = $data['google_analytics_id'] ?? null; - $this->container['facebook_pixel_id'] = $data['facebook_pixel_id'] ?? null; - $this->container['public_chat_room_channel_id'] = $data['public_chat_room_channel_id'] ?? null; - $this->container['vanity_handle'] = $data['vanity_handle'] ?? null; - $this->container['vanity_page_wallet_prefix'] = $data['vanity_page_wallet_prefix'] ?? null; - $this->container['merchant_credit_payment_design_id'] = $data['merchant_credit_payment_design_id'] ?? null; - $this->container['custom_domain'] = $data['custom_domain'] ?? null; - $this->container['is_claimed'] = $data['is_claimed'] ?? null; - $this->container['mobile_app_icon_url'] = $data['mobile_app_icon_url'] ?? null; - $this->container['is_age_gate'] = $data['is_age_gate'] ?? null; - $this->container['age_gate_minimum'] = $data['age_gate_minimum'] ?? null; - $this->container['social_instagram_url'] = $data['social_instagram_url'] ?? null; - $this->container['social_facebook_url'] = $data['social_facebook_url'] ?? null; - $this->container['social_you_tube_url'] = $data['social_you_tube_url'] ?? null; - $this->container['social_twitter_url'] = $data['social_twitter_url'] ?? null; - $this->container['social_linked_in_url'] = $data['social_linked_in_url'] ?? null; - $this->container['primary_phone_number'] = $data['primary_phone_number'] ?? null; - $this->container['primary_whats_app'] = $data['primary_whats_app'] ?? null; - $this->container['primary_email_address'] = $data['primary_email_address'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; + $this->setIfExists('header_background_color', $data ?? [], null); + $this->setIfExists('header_button_color', $data ?? [], null); + $this->setIfExists('left_menu_header_background_color', $data ?? [], null); + $this->setIfExists('left_menu_header_font_color', $data ?? [], null); + $this->setIfExists('left_menu_section_background_color', $data ?? [], null); + $this->setIfExists('left_menu_section_font_color', $data ?? [], null); + $this->setIfExists('company_logo_url', $data ?? [], null); + $this->setIfExists('header_image_url', $data ?? [], null); + $this->setIfExists('header_custom_icon', $data ?? [], null); + $this->setIfExists('welcome_message', $data ?? [], null); + $this->setIfExists('is_apple_enabled', $data ?? [], null); + $this->setIfExists('is_google_enabled', $data ?? [], null); + $this->setIfExists('is_samsung_enabled', $data ?? [], null); + $this->setIfExists('is_ad_credits', $data ?? [], null); + $this->setIfExists('is_static_vouchers', $data ?? [], null); + $this->setIfExists('is_dynamic_vouchers', $data ?? [], null); + $this->setIfExists('is_membership_tier', $data ?? [], null); + $this->setIfExists('is_membership_points', $data ?? [], null); + $this->setIfExists('is_membership_level', $data ?? [], null); + $this->setIfExists('is_gift_cards', $data ?? [], null); + $this->setIfExists('is_gift_certificates', $data ?? [], null); + $this->setIfExists('is_promotions', $data ?? [], null); + $this->setIfExists('is_merchant_credit', $data ?? [], null); + $this->setIfExists('is_tickets', $data ?? [], null); + $this->setIfExists('is_news_articles', $data ?? [], null); + $this->setIfExists('is_performances', $data ?? [], null); + $this->setIfExists('is_messages', $data ?? [], null); + $this->setIfExists('is_call', $data ?? [], null); + $this->setIfExists('is_representatives', $data ?? [], null); + $this->setIfExists('is_products', $data ?? [], null); + $this->setIfExists('is_services', $data ?? [], null); + $this->setIfExists('is_room_rates', $data ?? [], null); + $this->setIfExists('is_amenities', $data ?? [], null); + $this->setIfExists('is_gaming', $data ?? [], null); + $this->setIfExists('is_dining', $data ?? [], null); + $this->setIfExists('is_lounges', $data ?? [], null); + $this->setIfExists('is_map_directions', $data ?? [], null); + $this->setIfExists('is_link_book', $data ?? [], null); + $this->setIfExists('is_image_grid', $data ?? [], null); + $this->setIfExists('is_videos', $data ?? [], null); + $this->setIfExists('is_transaction_history', $data ?? [], null); + $this->setIfExists('is_profile', $data ?? [], null); + $this->setIfExists('is_settings', $data ?? [], null); + $this->setIfExists('is_chat_room', $data ?? [], null); + $this->setIfExists('is_sms_opt_in', $data ?? [], null); + $this->setIfExists('sms_opt_in_source_id', $data ?? [], null); + $this->setIfExists('is_email_subscriber', $data ?? [], null); + $this->setIfExists('google_analytics_id', $data ?? [], null); + $this->setIfExists('facebook_pixel_id', $data ?? [], null); + $this->setIfExists('public_chat_room_channel_id', $data ?? [], null); + $this->setIfExists('vanity_handle', $data ?? [], null); + $this->setIfExists('vanity_page_wallet_prefix', $data ?? [], null); + $this->setIfExists('merchant_credit_payment_design_id', $data ?? [], null); + $this->setIfExists('custom_domain', $data ?? [], null); + $this->setIfExists('is_claimed', $data ?? [], null); + $this->setIfExists('mobile_app_icon_url', $data ?? [], null); + $this->setIfExists('is_age_gate', $data ?? [], null); + $this->setIfExists('age_gate_minimum', $data ?? [], null); + $this->setIfExists('social_instagram_url', $data ?? [], null); + $this->setIfExists('social_facebook_url', $data ?? [], null); + $this->setIfExists('social_you_tube_url', $data ?? [], null); + $this->setIfExists('social_twitter_url', $data ?? [], null); + $this->setIfExists('social_linked_in_url', $data ?? [], null); + $this->setIfExists('primary_phone_number', $data ?? [], null); + $this->setIfExists('primary_whats_app', $data ?? [], null); + $this->setIfExists('primary_email_address', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -731,18 +884,6 @@ public function listInvalidProperties() if ($this->container['is_sms_opt_in'] === null) { $invalidProperties[] = "'is_sms_opt_in' can't be null"; } - if (!is_null($this->container['sms_opt_in_source_id']) && (mb_strlen($this->container['sms_opt_in_source_id']) > 10)) { - $invalidProperties[] = "invalid value for 'sms_opt_in_source_id', the character length must be smaller than or equal to 10."; - } - - if (!is_null($this->container['sms_opt_in_source_id']) && (mb_strlen($this->container['sms_opt_in_source_id']) < 10)) { - $invalidProperties[] = "invalid value for 'sms_opt_in_source_id', the character length must be bigger than or equal to 10."; - } - - if (!is_null($this->container['sms_opt_in_source_id']) && !preg_match("/^[a-zA-Z0-9]+$/", $this->container['sms_opt_in_source_id'])) { - $invalidProperties[] = "invalid value for 'sms_opt_in_source_id', must be conform to the pattern /^[a-zA-Z0-9]+$/."; - } - if ($this->container['is_email_subscriber'] === null) { $invalidProperties[] = "'is_email_subscriber' can't be null"; } @@ -816,6 +957,9 @@ public function getHeaderBackgroundColor() */ public function setHeaderBackgroundColor($header_background_color) { + if (is_null($header_background_color)) { + throw new \InvalidArgumentException('non-nullable header_background_color cannot be null'); + } $this->container['header_background_color'] = $header_background_color; return $this; @@ -840,6 +984,9 @@ public function getHeaderButtonColor() */ public function setHeaderButtonColor($header_button_color) { + if (is_null($header_button_color)) { + throw new \InvalidArgumentException('non-nullable header_button_color cannot be null'); + } $this->container['header_button_color'] = $header_button_color; return $this; @@ -864,6 +1011,9 @@ public function getLeftMenuHeaderBackgroundColor() */ public function setLeftMenuHeaderBackgroundColor($left_menu_header_background_color) { + if (is_null($left_menu_header_background_color)) { + throw new \InvalidArgumentException('non-nullable left_menu_header_background_color cannot be null'); + } $this->container['left_menu_header_background_color'] = $left_menu_header_background_color; return $this; @@ -888,6 +1038,9 @@ public function getLeftMenuHeaderFontColor() */ public function setLeftMenuHeaderFontColor($left_menu_header_font_color) { + if (is_null($left_menu_header_font_color)) { + throw new \InvalidArgumentException('non-nullable left_menu_header_font_color cannot be null'); + } $this->container['left_menu_header_font_color'] = $left_menu_header_font_color; return $this; @@ -912,6 +1065,9 @@ public function getLeftMenuSectionBackgroundColor() */ public function setLeftMenuSectionBackgroundColor($left_menu_section_background_color) { + if (is_null($left_menu_section_background_color)) { + throw new \InvalidArgumentException('non-nullable left_menu_section_background_color cannot be null'); + } $this->container['left_menu_section_background_color'] = $left_menu_section_background_color; return $this; @@ -936,6 +1092,9 @@ public function getLeftMenuSectionFontColor() */ public function setLeftMenuSectionFontColor($left_menu_section_font_color) { + if (is_null($left_menu_section_font_color)) { + throw new \InvalidArgumentException('non-nullable left_menu_section_font_color cannot be null'); + } $this->container['left_menu_section_font_color'] = $left_menu_section_font_color; return $this; @@ -960,6 +1119,9 @@ public function getCompanyLogoUrl() */ public function setCompanyLogoUrl($company_logo_url) { + if (is_null($company_logo_url)) { + throw new \InvalidArgumentException('non-nullable company_logo_url cannot be null'); + } $this->container['company_logo_url'] = $company_logo_url; return $this; @@ -984,6 +1146,9 @@ public function getHeaderImageUrl() */ public function setHeaderImageUrl($header_image_url) { + if (is_null($header_image_url)) { + throw new \InvalidArgumentException('non-nullable header_image_url cannot be null'); + } $this->container['header_image_url'] = $header_image_url; return $this; @@ -1008,6 +1173,9 @@ public function getHeaderCustomIcon() */ public function setHeaderCustomIcon($header_custom_icon) { + if (is_null($header_custom_icon)) { + throw new \InvalidArgumentException('non-nullable header_custom_icon cannot be null'); + } $this->container['header_custom_icon'] = $header_custom_icon; return $this; @@ -1032,6 +1200,9 @@ public function getWelcomeMessage() */ public function setWelcomeMessage($welcome_message) { + if (is_null($welcome_message)) { + throw new \InvalidArgumentException('non-nullable welcome_message cannot be null'); + } $this->container['welcome_message'] = $welcome_message; return $this; @@ -1056,6 +1227,9 @@ public function getIsAppleEnabled() */ public function setIsAppleEnabled($is_apple_enabled) { + if (is_null($is_apple_enabled)) { + throw new \InvalidArgumentException('non-nullable is_apple_enabled cannot be null'); + } $this->container['is_apple_enabled'] = $is_apple_enabled; return $this; @@ -1080,6 +1254,9 @@ public function getIsGoogleEnabled() */ public function setIsGoogleEnabled($is_google_enabled) { + if (is_null($is_google_enabled)) { + throw new \InvalidArgumentException('non-nullable is_google_enabled cannot be null'); + } $this->container['is_google_enabled'] = $is_google_enabled; return $this; @@ -1104,6 +1281,9 @@ public function getIsSamsungEnabled() */ public function setIsSamsungEnabled($is_samsung_enabled) { + if (is_null($is_samsung_enabled)) { + throw new \InvalidArgumentException('non-nullable is_samsung_enabled cannot be null'); + } $this->container['is_samsung_enabled'] = $is_samsung_enabled; return $this; @@ -1128,6 +1308,9 @@ public function getIsAdCredits() */ public function setIsAdCredits($is_ad_credits) { + if (is_null($is_ad_credits)) { + throw new \InvalidArgumentException('non-nullable is_ad_credits cannot be null'); + } $this->container['is_ad_credits'] = $is_ad_credits; return $this; @@ -1152,6 +1335,9 @@ public function getIsStaticVouchers() */ public function setIsStaticVouchers($is_static_vouchers) { + if (is_null($is_static_vouchers)) { + throw new \InvalidArgumentException('non-nullable is_static_vouchers cannot be null'); + } $this->container['is_static_vouchers'] = $is_static_vouchers; return $this; @@ -1176,6 +1362,9 @@ public function getIsDynamicVouchers() */ public function setIsDynamicVouchers($is_dynamic_vouchers) { + if (is_null($is_dynamic_vouchers)) { + throw new \InvalidArgumentException('non-nullable is_dynamic_vouchers cannot be null'); + } $this->container['is_dynamic_vouchers'] = $is_dynamic_vouchers; return $this; @@ -1200,6 +1389,9 @@ public function getIsMembershipTier() */ public function setIsMembershipTier($is_membership_tier) { + if (is_null($is_membership_tier)) { + throw new \InvalidArgumentException('non-nullable is_membership_tier cannot be null'); + } $this->container['is_membership_tier'] = $is_membership_tier; return $this; @@ -1224,6 +1416,9 @@ public function getIsMembershipPoints() */ public function setIsMembershipPoints($is_membership_points) { + if (is_null($is_membership_points)) { + throw new \InvalidArgumentException('non-nullable is_membership_points cannot be null'); + } $this->container['is_membership_points'] = $is_membership_points; return $this; @@ -1248,6 +1443,9 @@ public function getIsMembershipLevel() */ public function setIsMembershipLevel($is_membership_level) { + if (is_null($is_membership_level)) { + throw new \InvalidArgumentException('non-nullable is_membership_level cannot be null'); + } $this->container['is_membership_level'] = $is_membership_level; return $this; @@ -1272,6 +1470,9 @@ public function getIsGiftCards() */ public function setIsGiftCards($is_gift_cards) { + if (is_null($is_gift_cards)) { + throw new \InvalidArgumentException('non-nullable is_gift_cards cannot be null'); + } $this->container['is_gift_cards'] = $is_gift_cards; return $this; @@ -1296,6 +1497,9 @@ public function getIsGiftCertificates() */ public function setIsGiftCertificates($is_gift_certificates) { + if (is_null($is_gift_certificates)) { + throw new \InvalidArgumentException('non-nullable is_gift_certificates cannot be null'); + } $this->container['is_gift_certificates'] = $is_gift_certificates; return $this; @@ -1320,6 +1524,9 @@ public function getIsPromotions() */ public function setIsPromotions($is_promotions) { + if (is_null($is_promotions)) { + throw new \InvalidArgumentException('non-nullable is_promotions cannot be null'); + } $this->container['is_promotions'] = $is_promotions; return $this; @@ -1344,6 +1551,9 @@ public function getIsMerchantCredit() */ public function setIsMerchantCredit($is_merchant_credit) { + if (is_null($is_merchant_credit)) { + throw new \InvalidArgumentException('non-nullable is_merchant_credit cannot be null'); + } $this->container['is_merchant_credit'] = $is_merchant_credit; return $this; @@ -1368,6 +1578,9 @@ public function getIsTickets() */ public function setIsTickets($is_tickets) { + if (is_null($is_tickets)) { + throw new \InvalidArgumentException('non-nullable is_tickets cannot be null'); + } $this->container['is_tickets'] = $is_tickets; return $this; @@ -1392,6 +1605,9 @@ public function getIsNewsArticles() */ public function setIsNewsArticles($is_news_articles) { + if (is_null($is_news_articles)) { + throw new \InvalidArgumentException('non-nullable is_news_articles cannot be null'); + } $this->container['is_news_articles'] = $is_news_articles; return $this; @@ -1416,6 +1632,9 @@ public function getIsPerformances() */ public function setIsPerformances($is_performances) { + if (is_null($is_performances)) { + throw new \InvalidArgumentException('non-nullable is_performances cannot be null'); + } $this->container['is_performances'] = $is_performances; return $this; @@ -1440,6 +1659,9 @@ public function getIsMessages() */ public function setIsMessages($is_messages) { + if (is_null($is_messages)) { + throw new \InvalidArgumentException('non-nullable is_messages cannot be null'); + } $this->container['is_messages'] = $is_messages; return $this; @@ -1464,6 +1686,9 @@ public function getIsCall() */ public function setIsCall($is_call) { + if (is_null($is_call)) { + throw new \InvalidArgumentException('non-nullable is_call cannot be null'); + } $this->container['is_call'] = $is_call; return $this; @@ -1488,6 +1713,9 @@ public function getIsRepresentatives() */ public function setIsRepresentatives($is_representatives) { + if (is_null($is_representatives)) { + throw new \InvalidArgumentException('non-nullable is_representatives cannot be null'); + } $this->container['is_representatives'] = $is_representatives; return $this; @@ -1512,6 +1740,9 @@ public function getIsProducts() */ public function setIsProducts($is_products) { + if (is_null($is_products)) { + throw new \InvalidArgumentException('non-nullable is_products cannot be null'); + } $this->container['is_products'] = $is_products; return $this; @@ -1536,6 +1767,9 @@ public function getIsServices() */ public function setIsServices($is_services) { + if (is_null($is_services)) { + throw new \InvalidArgumentException('non-nullable is_services cannot be null'); + } $this->container['is_services'] = $is_services; return $this; @@ -1560,6 +1794,9 @@ public function getIsRoomRates() */ public function setIsRoomRates($is_room_rates) { + if (is_null($is_room_rates)) { + throw new \InvalidArgumentException('non-nullable is_room_rates cannot be null'); + } $this->container['is_room_rates'] = $is_room_rates; return $this; @@ -1584,6 +1821,9 @@ public function getIsAmenities() */ public function setIsAmenities($is_amenities) { + if (is_null($is_amenities)) { + throw new \InvalidArgumentException('non-nullable is_amenities cannot be null'); + } $this->container['is_amenities'] = $is_amenities; return $this; @@ -1608,6 +1848,9 @@ public function getIsGaming() */ public function setIsGaming($is_gaming) { + if (is_null($is_gaming)) { + throw new \InvalidArgumentException('non-nullable is_gaming cannot be null'); + } $this->container['is_gaming'] = $is_gaming; return $this; @@ -1632,6 +1875,9 @@ public function getIsDining() */ public function setIsDining($is_dining) { + if (is_null($is_dining)) { + throw new \InvalidArgumentException('non-nullable is_dining cannot be null'); + } $this->container['is_dining'] = $is_dining; return $this; @@ -1656,6 +1902,9 @@ public function getIsLounges() */ public function setIsLounges($is_lounges) { + if (is_null($is_lounges)) { + throw new \InvalidArgumentException('non-nullable is_lounges cannot be null'); + } $this->container['is_lounges'] = $is_lounges; return $this; @@ -1680,6 +1929,9 @@ public function getIsMapDirections() */ public function setIsMapDirections($is_map_directions) { + if (is_null($is_map_directions)) { + throw new \InvalidArgumentException('non-nullable is_map_directions cannot be null'); + } $this->container['is_map_directions'] = $is_map_directions; return $this; @@ -1704,6 +1956,9 @@ public function getIsLinkBook() */ public function setIsLinkBook($is_link_book) { + if (is_null($is_link_book)) { + throw new \InvalidArgumentException('non-nullable is_link_book cannot be null'); + } $this->container['is_link_book'] = $is_link_book; return $this; @@ -1728,6 +1983,9 @@ public function getIsImageGrid() */ public function setIsImageGrid($is_image_grid) { + if (is_null($is_image_grid)) { + throw new \InvalidArgumentException('non-nullable is_image_grid cannot be null'); + } $this->container['is_image_grid'] = $is_image_grid; return $this; @@ -1752,6 +2010,9 @@ public function getIsVideos() */ public function setIsVideos($is_videos) { + if (is_null($is_videos)) { + throw new \InvalidArgumentException('non-nullable is_videos cannot be null'); + } $this->container['is_videos'] = $is_videos; return $this; @@ -1776,6 +2037,9 @@ public function getIsTransactionHistory() */ public function setIsTransactionHistory($is_transaction_history) { + if (is_null($is_transaction_history)) { + throw new \InvalidArgumentException('non-nullable is_transaction_history cannot be null'); + } $this->container['is_transaction_history'] = $is_transaction_history; return $this; @@ -1800,6 +2064,9 @@ public function getIsProfile() */ public function setIsProfile($is_profile) { + if (is_null($is_profile)) { + throw new \InvalidArgumentException('non-nullable is_profile cannot be null'); + } $this->container['is_profile'] = $is_profile; return $this; @@ -1824,6 +2091,9 @@ public function getIsSettings() */ public function setIsSettings($is_settings) { + if (is_null($is_settings)) { + throw new \InvalidArgumentException('non-nullable is_settings cannot be null'); + } $this->container['is_settings'] = $is_settings; return $this; @@ -1848,6 +2118,9 @@ public function getIsChatRoom() */ public function setIsChatRoom($is_chat_room) { + if (is_null($is_chat_room)) { + throw new \InvalidArgumentException('non-nullable is_chat_room cannot be null'); + } $this->container['is_chat_room'] = $is_chat_room; return $this; @@ -1872,6 +2145,9 @@ public function getIsSmsOptIn() */ public function setIsSmsOptIn($is_sms_opt_in) { + if (is_null($is_sms_opt_in)) { + throw new \InvalidArgumentException('non-nullable is_sms_opt_in cannot be null'); + } $this->container['is_sms_opt_in'] = $is_sms_opt_in; return $this; @@ -1880,7 +2156,7 @@ public function setIsSmsOptIn($is_sms_opt_in) /** * Gets sms_opt_in_source_id * - * @return string|null + * @return \OpenAPI\Client\Model\WalletConfigurationSmsOptInSourceID|null */ public function getSmsOptInSourceId() { @@ -1890,22 +2166,15 @@ public function getSmsOptInSourceId() /** * Sets sms_opt_in_source_id * - * @param string|null $sms_opt_in_source_id sms_opt_in_source_id + * @param \OpenAPI\Client\Model\WalletConfigurationSmsOptInSourceID|null $sms_opt_in_source_id sms_opt_in_source_id * * @return self */ public function setSmsOptInSourceId($sms_opt_in_source_id) { - if (!is_null($sms_opt_in_source_id) && (mb_strlen($sms_opt_in_source_id) > 10)) { - throw new \InvalidArgumentException('invalid length for $sms_opt_in_source_id when calling WalletConfiguration., must be smaller than or equal to 10.'); - } - if (!is_null($sms_opt_in_source_id) && (mb_strlen($sms_opt_in_source_id) < 10)) { - throw new \InvalidArgumentException('invalid length for $sms_opt_in_source_id when calling WalletConfiguration., must be bigger than or equal to 10.'); + if (is_null($sms_opt_in_source_id)) { + throw new \InvalidArgumentException('non-nullable sms_opt_in_source_id cannot be null'); } - if (!is_null($sms_opt_in_source_id) && (!preg_match("/^[a-zA-Z0-9]+$/", $sms_opt_in_source_id))) { - throw new \InvalidArgumentException("invalid value for $sms_opt_in_source_id when calling WalletConfiguration., must conform to the pattern /^[a-zA-Z0-9]+$/."); - } - $this->container['sms_opt_in_source_id'] = $sms_opt_in_source_id; return $this; @@ -1930,6 +2199,9 @@ public function getIsEmailSubscriber() */ public function setIsEmailSubscriber($is_email_subscriber) { + if (is_null($is_email_subscriber)) { + throw new \InvalidArgumentException('non-nullable is_email_subscriber cannot be null'); + } $this->container['is_email_subscriber'] = $is_email_subscriber; return $this; @@ -1954,6 +2226,9 @@ public function getGoogleAnalyticsId() */ public function setGoogleAnalyticsId($google_analytics_id) { + if (is_null($google_analytics_id)) { + throw new \InvalidArgumentException('non-nullable google_analytics_id cannot be null'); + } $this->container['google_analytics_id'] = $google_analytics_id; return $this; @@ -1978,6 +2253,9 @@ public function getFacebookPixelId() */ public function setFacebookPixelId($facebook_pixel_id) { + if (is_null($facebook_pixel_id)) { + throw new \InvalidArgumentException('non-nullable facebook_pixel_id cannot be null'); + } $this->container['facebook_pixel_id'] = $facebook_pixel_id; return $this; @@ -1986,7 +2264,7 @@ public function setFacebookPixelId($facebook_pixel_id) /** * Gets public_chat_room_channel_id * - * @return double|null + * @return float|null */ public function getPublicChatRoomChannelId() { @@ -1996,12 +2274,15 @@ public function getPublicChatRoomChannelId() /** * Sets public_chat_room_channel_id * - * @param double|null $public_chat_room_channel_id public_chat_room_channel_id + * @param float|null $public_chat_room_channel_id public_chat_room_channel_id * * @return self */ public function setPublicChatRoomChannelId($public_chat_room_channel_id) { + if (is_null($public_chat_room_channel_id)) { + throw new \InvalidArgumentException('non-nullable public_chat_room_channel_id cannot be null'); + } $this->container['public_chat_room_channel_id'] = $public_chat_room_channel_id; return $this; @@ -2026,6 +2307,9 @@ public function getVanityHandle() */ public function setVanityHandle($vanity_handle) { + if (is_null($vanity_handle)) { + throw new \InvalidArgumentException('non-nullable vanity_handle cannot be null'); + } $this->container['vanity_handle'] = $vanity_handle; return $this; @@ -2050,6 +2334,9 @@ public function getVanityPageWalletPrefix() */ public function setVanityPageWalletPrefix($vanity_page_wallet_prefix) { + if (is_null($vanity_page_wallet_prefix)) { + throw new \InvalidArgumentException('non-nullable vanity_page_wallet_prefix cannot be null'); + } $this->container['vanity_page_wallet_prefix'] = $vanity_page_wallet_prefix; return $this; @@ -2074,6 +2361,9 @@ public function getMerchantCreditPaymentDesignId() */ public function setMerchantCreditPaymentDesignId($merchant_credit_payment_design_id) { + if (is_null($merchant_credit_payment_design_id)) { + throw new \InvalidArgumentException('non-nullable merchant_credit_payment_design_id cannot be null'); + } $this->container['merchant_credit_payment_design_id'] = $merchant_credit_payment_design_id; return $this; @@ -2098,6 +2388,9 @@ public function getCustomDomain() */ public function setCustomDomain($custom_domain) { + if (is_null($custom_domain)) { + throw new \InvalidArgumentException('non-nullable custom_domain cannot be null'); + } $this->container['custom_domain'] = $custom_domain; return $this; @@ -2122,6 +2415,9 @@ public function getIsClaimed() */ public function setIsClaimed($is_claimed) { + if (is_null($is_claimed)) { + throw new \InvalidArgumentException('non-nullable is_claimed cannot be null'); + } $this->container['is_claimed'] = $is_claimed; return $this; @@ -2146,6 +2442,9 @@ public function getMobileAppIconUrl() */ public function setMobileAppIconUrl($mobile_app_icon_url) { + if (is_null($mobile_app_icon_url)) { + throw new \InvalidArgumentException('non-nullable mobile_app_icon_url cannot be null'); + } $this->container['mobile_app_icon_url'] = $mobile_app_icon_url; return $this; @@ -2170,6 +2469,9 @@ public function getIsAgeGate() */ public function setIsAgeGate($is_age_gate) { + if (is_null($is_age_gate)) { + throw new \InvalidArgumentException('non-nullable is_age_gate cannot be null'); + } $this->container['is_age_gate'] = $is_age_gate; return $this; @@ -2178,7 +2480,7 @@ public function setIsAgeGate($is_age_gate) /** * Gets age_gate_minimum * - * @return double|null + * @return float|null */ public function getAgeGateMinimum() { @@ -2188,12 +2490,15 @@ public function getAgeGateMinimum() /** * Sets age_gate_minimum * - * @param double|null $age_gate_minimum age_gate_minimum + * @param float|null $age_gate_minimum age_gate_minimum * * @return self */ public function setAgeGateMinimum($age_gate_minimum) { + if (is_null($age_gate_minimum)) { + throw new \InvalidArgumentException('non-nullable age_gate_minimum cannot be null'); + } $this->container['age_gate_minimum'] = $age_gate_minimum; return $this; @@ -2218,6 +2523,9 @@ public function getSocialInstagramUrl() */ public function setSocialInstagramUrl($social_instagram_url) { + if (is_null($social_instagram_url)) { + throw new \InvalidArgumentException('non-nullable social_instagram_url cannot be null'); + } $this->container['social_instagram_url'] = $social_instagram_url; return $this; @@ -2242,6 +2550,9 @@ public function getSocialFacebookUrl() */ public function setSocialFacebookUrl($social_facebook_url) { + if (is_null($social_facebook_url)) { + throw new \InvalidArgumentException('non-nullable social_facebook_url cannot be null'); + } $this->container['social_facebook_url'] = $social_facebook_url; return $this; @@ -2266,6 +2577,9 @@ public function getSocialYouTubeUrl() */ public function setSocialYouTubeUrl($social_you_tube_url) { + if (is_null($social_you_tube_url)) { + throw new \InvalidArgumentException('non-nullable social_you_tube_url cannot be null'); + } $this->container['social_you_tube_url'] = $social_you_tube_url; return $this; @@ -2290,6 +2604,9 @@ public function getSocialTwitterUrl() */ public function setSocialTwitterUrl($social_twitter_url) { + if (is_null($social_twitter_url)) { + throw new \InvalidArgumentException('non-nullable social_twitter_url cannot be null'); + } $this->container['social_twitter_url'] = $social_twitter_url; return $this; @@ -2314,6 +2631,9 @@ public function getSocialLinkedInUrl() */ public function setSocialLinkedInUrl($social_linked_in_url) { + if (is_null($social_linked_in_url)) { + throw new \InvalidArgumentException('non-nullable social_linked_in_url cannot be null'); + } $this->container['social_linked_in_url'] = $social_linked_in_url; return $this; @@ -2338,6 +2658,9 @@ public function getPrimaryPhoneNumber() */ public function setPrimaryPhoneNumber($primary_phone_number) { + if (is_null($primary_phone_number)) { + throw new \InvalidArgumentException('non-nullable primary_phone_number cannot be null'); + } $this->container['primary_phone_number'] = $primary_phone_number; return $this; @@ -2362,6 +2685,9 @@ public function getPrimaryWhatsApp() */ public function setPrimaryWhatsApp($primary_whats_app) { + if (is_null($primary_whats_app)) { + throw new \InvalidArgumentException('non-nullable primary_whats_app cannot be null'); + } $this->container['primary_whats_app'] = $primary_whats_app; return $this; @@ -2386,6 +2712,9 @@ public function getPrimaryEmailAddress() */ public function setPrimaryEmailAddress($primary_email_address) { + if (is_null($primary_email_address)) { + throw new \InvalidArgumentException('non-nullable primary_email_address cannot be null'); + } $this->container['primary_email_address'] = $primary_email_address; return $this; @@ -2410,14 +2739,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling WalletConfiguration., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling WalletConfiguration., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling WalletConfiguration., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling WalletConfiguration., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -2444,6 +2776,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -2468,6 +2803,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -2492,14 +2830,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WalletConfiguration., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WalletConfiguration., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WalletConfiguration., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WalletConfiguration., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -2513,7 +2854,7 @@ public function setMerchantId($merchant_id) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -2525,6 +2866,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -2538,7 +2880,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -2554,7 +2896,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -2566,6 +2908,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/WalletConfigurationSmsOptInSourceID.php b/lib/Model/WalletConfigurationSmsOptInSourceID.php new file mode 100644 index 0000000..0c15807 --- /dev/null +++ b/lib/Model/WalletConfigurationSmsOptInSourceID.php @@ -0,0 +1,382 @@ + + */ +class WalletConfigurationSmsOptInSourceID implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WalletConfiguration_smsOptInSourceID'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/WalletPageView.php b/lib/Model/WalletPageView.php index 890b148..241954d 100644 --- a/lib/Model/WalletPageView.php +++ b/lib/Model/WalletPageView.php @@ -2,7 +2,7 @@ /** * WalletPageView * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class WalletPageView implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -80,7 +78,7 @@ class WalletPageView implements ModelInterface, ArrayAccess, \JsonSerializable 'phone_verification_token' => 'string', 'referring_domain' => 'string', 'referrer' => 'string', - 'id' => 'string', + 'id' => '\OpenAPI\Client\Model\WTWalletPageViewId', 'status' => 'string', 'country' => 'string', 'country_code' => 'string', @@ -88,8 +86,8 @@ class WalletPageView implements ModelInterface, ArrayAccess, \JsonSerializable 'region_name' => 'string', 'city' => 'string', 'zip' => 'string', - 'latitude' => 'double', - 'longitude' => 'double', + 'latitude' => 'float', + 'longitude' => 'float', 'timezone' => 'string', 'isp' => 'string', 'org' => 'string', @@ -150,6 +148,60 @@ class WalletPageView implements ModelInterface, ArrayAccess, \JsonSerializable 'geo_point' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ip' => false, + 'wallet_object_id' => false, + 'wallet_object_prefix' => false, + 'parent_object_id' => false, + 'parent_object_prefix' => false, + 'session_id' => false, + 'navigator_agent' => false, + 'browser_name' => false, + 'browser_version' => false, + 'engine_name' => false, + 'engine_version' => false, + 'o_s_name' => false, + 'o_s_version' => false, + 'is_mobile' => false, + 'device_vendor' => false, + 'device_model' => false, + 'device_type' => false, + 'phone_verification_token' => false, + 'referring_domain' => false, + 'referrer' => false, + 'id' => false, + 'status' => false, + 'country' => false, + 'country_code' => false, + 'region' => false, + 'region_name' => false, + 'city' => false, + 'zip' => false, + 'latitude' => false, + 'longitude' => false, + 'timezone' => false, + 'isp' => false, + 'org' => false, + 'asn' => false, + 'created_at' => false, + 'updated_at' => false, + 'merchant_id' => false, + 'is_active' => false, + 'geo_point' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -170,6 +222,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -369,45 +473,63 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['ip'] = $data['ip'] ?? null; - $this->container['wallet_object_id'] = $data['wallet_object_id'] ?? null; - $this->container['wallet_object_prefix'] = $data['wallet_object_prefix'] ?? null; - $this->container['parent_object_id'] = $data['parent_object_id'] ?? null; - $this->container['parent_object_prefix'] = $data['parent_object_prefix'] ?? null; - $this->container['session_id'] = $data['session_id'] ?? null; - $this->container['navigator_agent'] = $data['navigator_agent'] ?? null; - $this->container['browser_name'] = $data['browser_name'] ?? null; - $this->container['browser_version'] = $data['browser_version'] ?? null; - $this->container['engine_name'] = $data['engine_name'] ?? null; - $this->container['engine_version'] = $data['engine_version'] ?? null; - $this->container['o_s_name'] = $data['o_s_name'] ?? null; - $this->container['o_s_version'] = $data['o_s_version'] ?? null; - $this->container['is_mobile'] = $data['is_mobile'] ?? null; - $this->container['device_vendor'] = $data['device_vendor'] ?? null; - $this->container['device_model'] = $data['device_model'] ?? null; - $this->container['device_type'] = $data['device_type'] ?? null; - $this->container['phone_verification_token'] = $data['phone_verification_token'] ?? null; - $this->container['referring_domain'] = $data['referring_domain'] ?? null; - $this->container['referrer'] = $data['referrer'] ?? null; - $this->container['id'] = $data['id'] ?? null; - $this->container['status'] = $data['status'] ?? null; - $this->container['country'] = $data['country'] ?? null; - $this->container['country_code'] = $data['country_code'] ?? null; - $this->container['region'] = $data['region'] ?? null; - $this->container['region_name'] = $data['region_name'] ?? null; - $this->container['city'] = $data['city'] ?? null; - $this->container['zip'] = $data['zip'] ?? null; - $this->container['latitude'] = $data['latitude'] ?? null; - $this->container['longitude'] = $data['longitude'] ?? null; - $this->container['timezone'] = $data['timezone'] ?? null; - $this->container['isp'] = $data['isp'] ?? null; - $this->container['org'] = $data['org'] ?? null; - $this->container['asn'] = $data['asn'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['merchant_id'] = $data['merchant_id'] ?? null; - $this->container['is_active'] = $data['is_active'] ?? null; - $this->container['geo_point'] = $data['geo_point'] ?? null; + $this->setIfExists('ip', $data ?? [], null); + $this->setIfExists('wallet_object_id', $data ?? [], null); + $this->setIfExists('wallet_object_prefix', $data ?? [], null); + $this->setIfExists('parent_object_id', $data ?? [], null); + $this->setIfExists('parent_object_prefix', $data ?? [], null); + $this->setIfExists('session_id', $data ?? [], null); + $this->setIfExists('navigator_agent', $data ?? [], null); + $this->setIfExists('browser_name', $data ?? [], null); + $this->setIfExists('browser_version', $data ?? [], null); + $this->setIfExists('engine_name', $data ?? [], null); + $this->setIfExists('engine_version', $data ?? [], null); + $this->setIfExists('o_s_name', $data ?? [], null); + $this->setIfExists('o_s_version', $data ?? [], null); + $this->setIfExists('is_mobile', $data ?? [], null); + $this->setIfExists('device_vendor', $data ?? [], null); + $this->setIfExists('device_model', $data ?? [], null); + $this->setIfExists('device_type', $data ?? [], null); + $this->setIfExists('phone_verification_token', $data ?? [], null); + $this->setIfExists('referring_domain', $data ?? [], null); + $this->setIfExists('referrer', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('country_code', $data ?? [], null); + $this->setIfExists('region', $data ?? [], null); + $this->setIfExists('region_name', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('zip', $data ?? [], null); + $this->setIfExists('latitude', $data ?? [], null); + $this->setIfExists('longitude', $data ?? [], null); + $this->setIfExists('timezone', $data ?? [], null); + $this->setIfExists('isp', $data ?? [], null); + $this->setIfExists('org', $data ?? [], null); + $this->setIfExists('asn', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('merchant_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('geo_point', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -476,14 +598,6 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ((mb_strlen($this->container['id']) > 12)) { - $invalidProperties[] = "invalid value for 'id', the character length must be smaller than or equal to 12."; - } - - if ((mb_strlen($this->container['id']) < 10)) { - $invalidProperties[] = "invalid value for 'id', the character length must be bigger than or equal to 10."; - } - if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -584,6 +698,9 @@ public function getIp() */ public function setIp($ip) { + if (is_null($ip)) { + throw new \InvalidArgumentException('non-nullable ip cannot be null'); + } $this->container['ip'] = $ip; return $this; @@ -608,6 +725,9 @@ public function getWalletObjectId() */ public function setWalletObjectId($wallet_object_id) { + if (is_null($wallet_object_id)) { + throw new \InvalidArgumentException('non-nullable wallet_object_id cannot be null'); + } $this->container['wallet_object_id'] = $wallet_object_id; return $this; @@ -632,6 +752,9 @@ public function getWalletObjectPrefix() */ public function setWalletObjectPrefix($wallet_object_prefix) { + if (is_null($wallet_object_prefix)) { + throw new \InvalidArgumentException('non-nullable wallet_object_prefix cannot be null'); + } $this->container['wallet_object_prefix'] = $wallet_object_prefix; return $this; @@ -656,6 +779,9 @@ public function getParentObjectId() */ public function setParentObjectId($parent_object_id) { + if (is_null($parent_object_id)) { + throw new \InvalidArgumentException('non-nullable parent_object_id cannot be null'); + } $this->container['parent_object_id'] = $parent_object_id; return $this; @@ -680,6 +806,9 @@ public function getParentObjectPrefix() */ public function setParentObjectPrefix($parent_object_prefix) { + if (is_null($parent_object_prefix)) { + throw new \InvalidArgumentException('non-nullable parent_object_prefix cannot be null'); + } $this->container['parent_object_prefix'] = $parent_object_prefix; return $this; @@ -704,6 +833,9 @@ public function getSessionId() */ public function setSessionId($session_id) { + if (is_null($session_id)) { + throw new \InvalidArgumentException('non-nullable session_id cannot be null'); + } $this->container['session_id'] = $session_id; return $this; @@ -728,6 +860,9 @@ public function getNavigatorAgent() */ public function setNavigatorAgent($navigator_agent) { + if (is_null($navigator_agent)) { + throw new \InvalidArgumentException('non-nullable navigator_agent cannot be null'); + } $this->container['navigator_agent'] = $navigator_agent; return $this; @@ -752,6 +887,9 @@ public function getBrowserName() */ public function setBrowserName($browser_name) { + if (is_null($browser_name)) { + throw new \InvalidArgumentException('non-nullable browser_name cannot be null'); + } $this->container['browser_name'] = $browser_name; return $this; @@ -776,6 +914,9 @@ public function getBrowserVersion() */ public function setBrowserVersion($browser_version) { + if (is_null($browser_version)) { + throw new \InvalidArgumentException('non-nullable browser_version cannot be null'); + } $this->container['browser_version'] = $browser_version; return $this; @@ -800,6 +941,9 @@ public function getEngineName() */ public function setEngineName($engine_name) { + if (is_null($engine_name)) { + throw new \InvalidArgumentException('non-nullable engine_name cannot be null'); + } $this->container['engine_name'] = $engine_name; return $this; @@ -824,6 +968,9 @@ public function getEngineVersion() */ public function setEngineVersion($engine_version) { + if (is_null($engine_version)) { + throw new \InvalidArgumentException('non-nullable engine_version cannot be null'); + } $this->container['engine_version'] = $engine_version; return $this; @@ -848,6 +995,9 @@ public function getOSName() */ public function setOSName($o_s_name) { + if (is_null($o_s_name)) { + throw new \InvalidArgumentException('non-nullable o_s_name cannot be null'); + } $this->container['o_s_name'] = $o_s_name; return $this; @@ -872,6 +1022,9 @@ public function getOSVersion() */ public function setOSVersion($o_s_version) { + if (is_null($o_s_version)) { + throw new \InvalidArgumentException('non-nullable o_s_version cannot be null'); + } $this->container['o_s_version'] = $o_s_version; return $this; @@ -896,6 +1049,9 @@ public function getIsMobile() */ public function setIsMobile($is_mobile) { + if (is_null($is_mobile)) { + throw new \InvalidArgumentException('non-nullable is_mobile cannot be null'); + } $this->container['is_mobile'] = $is_mobile; return $this; @@ -920,6 +1076,9 @@ public function getDeviceVendor() */ public function setDeviceVendor($device_vendor) { + if (is_null($device_vendor)) { + throw new \InvalidArgumentException('non-nullable device_vendor cannot be null'); + } $this->container['device_vendor'] = $device_vendor; return $this; @@ -944,6 +1103,9 @@ public function getDeviceModel() */ public function setDeviceModel($device_model) { + if (is_null($device_model)) { + throw new \InvalidArgumentException('non-nullable device_model cannot be null'); + } $this->container['device_model'] = $device_model; return $this; @@ -968,6 +1130,9 @@ public function getDeviceType() */ public function setDeviceType($device_type) { + if (is_null($device_type)) { + throw new \InvalidArgumentException('non-nullable device_type cannot be null'); + } $this->container['device_type'] = $device_type; return $this; @@ -992,6 +1157,9 @@ public function getPhoneVerificationToken() */ public function setPhoneVerificationToken($phone_verification_token) { + if (is_null($phone_verification_token)) { + throw new \InvalidArgumentException('non-nullable phone_verification_token cannot be null'); + } $this->container['phone_verification_token'] = $phone_verification_token; return $this; @@ -1016,6 +1184,9 @@ public function getReferringDomain() */ public function setReferringDomain($referring_domain) { + if (is_null($referring_domain)) { + throw new \InvalidArgumentException('non-nullable referring_domain cannot be null'); + } $this->container['referring_domain'] = $referring_domain; return $this; @@ -1040,6 +1211,9 @@ public function getReferrer() */ public function setReferrer($referrer) { + if (is_null($referrer)) { + throw new \InvalidArgumentException('non-nullable referrer cannot be null'); + } $this->container['referrer'] = $referrer; return $this; @@ -1048,7 +1222,7 @@ public function setReferrer($referrer) /** * Gets id * - * @return string + * @return \OpenAPI\Client\Model\WTWalletPageViewId */ public function getId() { @@ -1058,19 +1232,15 @@ public function getId() /** * Sets id * - * @param string $id id + * @param \OpenAPI\Client\Model\WTWalletPageViewId $id id * * @return self */ public function setId($id) { - if ((mb_strlen($id) > 12)) { - throw new \InvalidArgumentException('invalid length for $id when calling WalletPageView., must be smaller than or equal to 12.'); - } - if ((mb_strlen($id) < 10)) { - throw new \InvalidArgumentException('invalid length for $id when calling WalletPageView., must be bigger than or equal to 10.'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['id'] = $id; return $this; @@ -1095,6 +1265,9 @@ public function getStatus() */ public function setStatus($status) { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } $this->container['status'] = $status; return $this; @@ -1119,6 +1292,9 @@ public function getCountry() */ public function setCountry($country) { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } $this->container['country'] = $country; return $this; @@ -1143,6 +1319,9 @@ public function getCountryCode() */ public function setCountryCode($country_code) { + if (is_null($country_code)) { + throw new \InvalidArgumentException('non-nullable country_code cannot be null'); + } $this->container['country_code'] = $country_code; return $this; @@ -1167,6 +1346,9 @@ public function getRegion() */ public function setRegion($region) { + if (is_null($region)) { + throw new \InvalidArgumentException('non-nullable region cannot be null'); + } $this->container['region'] = $region; return $this; @@ -1191,6 +1373,9 @@ public function getRegionName() */ public function setRegionName($region_name) { + if (is_null($region_name)) { + throw new \InvalidArgumentException('non-nullable region_name cannot be null'); + } $this->container['region_name'] = $region_name; return $this; @@ -1215,6 +1400,9 @@ public function getCity() */ public function setCity($city) { + if (is_null($city)) { + throw new \InvalidArgumentException('non-nullable city cannot be null'); + } $this->container['city'] = $city; return $this; @@ -1239,6 +1427,9 @@ public function getZip() */ public function setZip($zip) { + if (is_null($zip)) { + throw new \InvalidArgumentException('non-nullable zip cannot be null'); + } $this->container['zip'] = $zip; return $this; @@ -1247,7 +1438,7 @@ public function setZip($zip) /** * Gets latitude * - * @return double + * @return float */ public function getLatitude() { @@ -1257,12 +1448,15 @@ public function getLatitude() /** * Sets latitude * - * @param double $latitude latitude + * @param float $latitude latitude * * @return self */ public function setLatitude($latitude) { + if (is_null($latitude)) { + throw new \InvalidArgumentException('non-nullable latitude cannot be null'); + } $this->container['latitude'] = $latitude; return $this; @@ -1271,7 +1465,7 @@ public function setLatitude($latitude) /** * Gets longitude * - * @return double + * @return float */ public function getLongitude() { @@ -1281,12 +1475,15 @@ public function getLongitude() /** * Sets longitude * - * @param double $longitude longitude + * @param float $longitude longitude * * @return self */ public function setLongitude($longitude) { + if (is_null($longitude)) { + throw new \InvalidArgumentException('non-nullable longitude cannot be null'); + } $this->container['longitude'] = $longitude; return $this; @@ -1311,6 +1508,9 @@ public function getTimezone() */ public function setTimezone($timezone) { + if (is_null($timezone)) { + throw new \InvalidArgumentException('non-nullable timezone cannot be null'); + } $this->container['timezone'] = $timezone; return $this; @@ -1335,6 +1535,9 @@ public function getIsp() */ public function setIsp($isp) { + if (is_null($isp)) { + throw new \InvalidArgumentException('non-nullable isp cannot be null'); + } $this->container['isp'] = $isp; return $this; @@ -1359,6 +1562,9 @@ public function getOrg() */ public function setOrg($org) { + if (is_null($org)) { + throw new \InvalidArgumentException('non-nullable org cannot be null'); + } $this->container['org'] = $org; return $this; @@ -1383,6 +1589,9 @@ public function getAsn() */ public function setAsn($asn) { + if (is_null($asn)) { + throw new \InvalidArgumentException('non-nullable asn cannot be null'); + } $this->container['asn'] = $asn; return $this; @@ -1407,6 +1616,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -1431,6 +1643,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -1455,14 +1670,17 @@ public function getMerchantId() */ public function setMerchantId($merchant_id) { + if (is_null($merchant_id)) { + throw new \InvalidArgumentException('non-nullable merchant_id cannot be null'); + } if ((mb_strlen($merchant_id) > 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WalletPageView., must be smaller than or equal to 10.'); } if ((mb_strlen($merchant_id) < 10)) { throw new \InvalidArgumentException('invalid length for $merchant_id when calling WalletPageView., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $merchant_id))) { - throw new \InvalidArgumentException("invalid value for $merchant_id when calling WalletPageView., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($merchant_id)))) { + throw new \InvalidArgumentException("invalid value for \$merchant_id when calling WalletPageView., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['merchant_id'] = $merchant_id; @@ -1489,6 +1707,9 @@ public function getIsActive() */ public function setIsActive($is_active) { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } $this->container['is_active'] = $is_active; return $this; @@ -1513,6 +1734,9 @@ public function getGeoPoint() */ public function setGeoPoint($geo_point) { + if (is_null($geo_point)) { + throw new \InvalidArgumentException('non-nullable geo_point cannot be null'); + } $this->container['geo_point'] = $geo_point; return $this; @@ -1524,7 +1748,7 @@ public function setGeoPoint($geo_point) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -1536,6 +1760,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -1549,7 +1774,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -1565,7 +1790,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -1577,6 +1802,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/Model/Webpage.php b/lib/Model/Webpage.php index eb00b9a..4df69cf 100644 --- a/lib/Model/Webpage.php +++ b/lib/Model/Webpage.php @@ -2,7 +2,7 @@ /** * Webpage * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -39,9 +39,7 @@ * @package OpenAPI\Client * @author OpenAPI Generator team * @link https://openapi-generator.tech - * @implements \ArrayAccess - * @template TKey int|null - * @template TValue mixed|null + * @implements \ArrayAccess */ class Webpage implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -68,7 +66,7 @@ class Webpage implements ModelInterface, ArrayAccess, \JsonSerializable 'display_name' => 'string', 'system_name' => 'string', 'is_public' => 'bool', - 'order_number' => 'double', + 'order_number' => 'float', 'icons' => 'string[]' ]; @@ -92,6 +90,31 @@ class Webpage implements ModelInterface, ArrayAccess, \JsonSerializable 'icons' => null ]; + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'created_at' => false, + 'updated_at' => false, + 'category' => false, + 'admin_page' => false, + 'display_name' => false, + 'system_name' => false, + 'is_public' => false, + 'order_number' => false, + 'icons' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + /** * Array of property to type mappings. Used for (de)serialization * @@ -112,6 +135,58 @@ public static function openAPIFormats() return self::$openAPIFormats; } + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + /** * Array of attributes where the key is the local name, * and the value is the original name @@ -224,16 +299,34 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['id'] = $data['id'] ?? null; - $this->container['created_at'] = $data['created_at'] ?? null; - $this->container['updated_at'] = $data['updated_at'] ?? null; - $this->container['category'] = $data['category'] ?? null; - $this->container['admin_page'] = $data['admin_page'] ?? null; - $this->container['display_name'] = $data['display_name'] ?? null; - $this->container['system_name'] = $data['system_name'] ?? null; - $this->container['is_public'] = $data['is_public'] ?? null; - $this->container['order_number'] = $data['order_number'] ?? null; - $this->container['icons'] = $data['icons'] ?? null; + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('admin_page', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + $this->setIfExists('system_name', $data ?? [], null); + $this->setIfExists('is_public', $data ?? [], null); + $this->setIfExists('order_number', $data ?? [], null); + $this->setIfExists('icons', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; } /** @@ -321,14 +414,17 @@ public function getId() */ public function setId($id) { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } if ((mb_strlen($id) > 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Webpage., must be smaller than or equal to 10.'); } if ((mb_strlen($id) < 10)) { throw new \InvalidArgumentException('invalid length for $id when calling Webpage., must be bigger than or equal to 10.'); } - if ((!preg_match("/^[a-zA-Z0-9]+$/", $id))) { - throw new \InvalidArgumentException("invalid value for $id when calling Webpage., must conform to the pattern /^[a-zA-Z0-9]+$/."); + if ((!preg_match("/^[a-zA-Z0-9]+$/", ObjectSerializer::toString($id)))) { + throw new \InvalidArgumentException("invalid value for \$id when calling Webpage., must conform to the pattern /^[a-zA-Z0-9]+$/."); } $this->container['id'] = $id; @@ -355,6 +451,9 @@ public function getCreatedAt() */ public function setCreatedAt($created_at) { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } $this->container['created_at'] = $created_at; return $this; @@ -379,6 +478,9 @@ public function getUpdatedAt() */ public function setUpdatedAt($updated_at) { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } $this->container['updated_at'] = $updated_at; return $this; @@ -403,6 +505,9 @@ public function getCategory() */ public function setCategory($category) { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } $this->container['category'] = $category; return $this; @@ -427,6 +532,9 @@ public function getAdminPage() */ public function setAdminPage($admin_page) { + if (is_null($admin_page)) { + throw new \InvalidArgumentException('non-nullable admin_page cannot be null'); + } $this->container['admin_page'] = $admin_page; return $this; @@ -451,6 +559,9 @@ public function getDisplayName() */ public function setDisplayName($display_name) { + if (is_null($display_name)) { + throw new \InvalidArgumentException('non-nullable display_name cannot be null'); + } $this->container['display_name'] = $display_name; return $this; @@ -475,6 +586,9 @@ public function getSystemName() */ public function setSystemName($system_name) { + if (is_null($system_name)) { + throw new \InvalidArgumentException('non-nullable system_name cannot be null'); + } $this->container['system_name'] = $system_name; return $this; @@ -499,6 +613,9 @@ public function getIsPublic() */ public function setIsPublic($is_public) { + if (is_null($is_public)) { + throw new \InvalidArgumentException('non-nullable is_public cannot be null'); + } $this->container['is_public'] = $is_public; return $this; @@ -507,7 +624,7 @@ public function setIsPublic($is_public) /** * Gets order_number * - * @return double + * @return float */ public function getOrderNumber() { @@ -517,12 +634,15 @@ public function getOrderNumber() /** * Sets order_number * - * @param double $order_number order_number + * @param float $order_number order_number * * @return self */ public function setOrderNumber($order_number) { + if (is_null($order_number)) { + throw new \InvalidArgumentException('non-nullable order_number cannot be null'); + } $this->container['order_number'] = $order_number; return $this; @@ -547,6 +667,9 @@ public function getIcons() */ public function setIcons($icons) { + if (is_null($icons)) { + throw new \InvalidArgumentException('non-nullable icons cannot be null'); + } $this->container['icons'] = $icons; return $this; @@ -558,7 +681,7 @@ public function setIcons($icons) * * @return boolean */ - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->container[$offset]); } @@ -570,6 +693,7 @@ public function offsetExists($offset) * * @return mixed|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->container[$offset] ?? null; @@ -583,7 +707,7 @@ public function offsetGet($offset) * * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; @@ -599,7 +723,7 @@ public function offsetSet($offset, $value) * * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->container[$offset]); } @@ -611,6 +735,7 @@ public function offsetUnset($offset) * @return mixed Returns data which can be serialized by json_encode(), which is a value * of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return ObjectSerializer::sanitizeForSerialization($this); diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 6b9cb06..8ed7b25 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.3 + * PHP version 7.4 * * @category Class * @package OpenAPI\Client @@ -15,10 +15,10 @@ * * API * - * The version of the OpenAPI document: 2.1.535 + * The version of the OpenAPI document: 2.1.600 * Contact: development@wallet.inc * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.4.0 + * OpenAPI Generator version: 7.3.0 */ /** @@ -29,6 +29,7 @@ namespace OpenAPI\Client; +use GuzzleHttp\Psr7\Utils; use OpenAPI\Client\Model\ModelInterface; /** @@ -87,7 +88,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { $callable = [$openAPIType, 'getAllowableEnumValues']; if (is_callable($callable)) { /** array $callable */ @@ -98,7 +99,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } - if ($value !== null) { + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); } } @@ -158,22 +159,141 @@ public static function toPathValue($value) } /** - * Take value and turn it into a string suitable for inclusion in - * the query, by imploding comma-separated if it's an object. - * If it's a string, pass through unchanged. It will be url-encoded - * later. + * Checks if a value is empty, based on its OpenAPI type. * - * @param string[]|string|\DateTime $object an object to be serialized to a string + * @param mixed $value + * @param string $openApiType * - * @return string the serialized object + * @return bool true if $value is empty */ - public static function toQueryValue($object) + private static function isEmptyValue($value, string $openApiType): bool { - if (is_array($object)) { - return implode(',', $object); - } else { - return self::toString($object); + # If empty() returns false, it is not empty regardless of its type. + if (!empty($value)) { + return false; + } + + # Null is always empty, as we cannot send a real "null" value in a query parameter. + if ($value === null) { + return true; + } + + switch ($openApiType) { + # For numeric values, false and '' are considered empty. + # This comparison is safe for floating point values, since the previous call to empty() will + # filter out values that don't match 0. + case 'int': + case 'integer': + return $value !== 0; + + case 'number': + case 'float': + return $value !== 0 && $value !== 0.0; + + # For boolean values, '' is considered empty + case 'bool': + case 'boolean': + return !in_array($value, [false, 0], true); + + # For all the other types, any value at this point can be considered empty. + default: + return true; + } + } + + /** + * Take query parameter properties and turn it into an array suitable for + * native http_build_query or GuzzleHttp\Psr7\Query::build. + * + * @param mixed $value Parameter value + * @param string $paramName Parameter name + * @param string $openApiType OpenAPIType eg. array or object + * @param string $style Parameter serialization style + * @param bool $explode Parameter explode option + * @param bool $required Whether query param is required or not + * + * @return array + */ + public static function toQueryValue( + $value, + string $paramName, + string $openApiType = 'string', + string $style = 'form', + bool $explode = true, + bool $required = true + ): array { + + # Check if we should omit this parameter from the query. This should only happen when: + # - Parameter is NOT required; AND + # - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For + # example, 0 as "int" or "boolean" is NOT an empty value. + if (self::isEmptyValue($value, $openApiType)) { + if ($required) { + return ["{$paramName}" => '']; + } else { + return []; + } + } + + # Handle DateTime objects in query + if($openApiType === "\\DateTime" && $value instanceof \DateTime) { + return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) return $arr; + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? $prop = "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format + */ + public static function convertBoolToQueryStringFormat(bool $value) + { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; } + + return (int) $value; } /** @@ -230,7 +350,7 @@ public static function toString($value) } elseif (is_bool($value)) { return $value ? 'true' : 'false'; } else { - return $value; + return (string) $value; } } @@ -320,13 +440,13 @@ public static function deserialize($data, $class, $httpHeaders = null) if ($class === 'object') { settype($data, 'array'); return $data; - } else if ($class === 'mixed') { + } elseif ($class === 'mixed') { settype($data, gettype($data)); return $data; } if ($class === '\DateTime') { - // Some API's return an invalid, empty string as a + // Some APIs return an invalid, empty string as a // date-time property. DateTime::__construct() will return // the current time for empty input which is probably not // what is meant. The invalid empty string is probably to @@ -336,7 +456,7 @@ public static function deserialize($data, $class, $httpHeaders = null) try { return new \DateTime($data); } catch (\Exception $exception) { - // Some API's return a date-time with too high nanosecond + // Some APIs return a date-time with too high nanosecond // precision for php's DateTime to handle. // With provided regexp 6 digits of microseconds saved return new \DateTime(self::sanitizeTimestamp($data)); @@ -347,6 +467,8 @@ public static function deserialize($data, $class, $httpHeaders = null) } if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name @@ -370,7 +492,7 @@ public static function deserialize($data, $class, $httpHeaders = null) } /** @psalm-suppress ParadoxicalCondition */ - if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); return $data; } @@ -384,6 +506,11 @@ public static function deserialize($data, $class, $httpHeaders = null) return $data; } else { $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + // If a discriminator is defined and points to a valid subclass, use it. $discriminator = $class::DISCRIMINATOR; if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { @@ -398,7 +525,15 @@ public static function deserialize($data, $class, $httpHeaders = null) foreach ($instance::openAPITypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; - if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + continue; } @@ -410,4 +545,24 @@ public static function deserialize($data, $class, $httpHeaders = null) return $instance; } } + + /** + * Native `http_build_query` wrapper. + * @see https://www.php.net/manual/en/function.http-build-query + * + * @param array|object $data May be an array or object containing properties. + * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. + * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. + * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. + * + * @return string + */ + public static function buildQuery( + $data, + string $numeric_prefix = '', + ?string $arg_separator = null, + int $encoding_type = \PHP_QUERY_RFC3986 + ): string { + return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + } } diff --git a/test/Api/SmsSubscriberApiTest.php b/test/Api/SmsSubscriberApiTest.php new file mode 100644 index 0000000..1cc4f59 --- /dev/null +++ b/test/Api/SmsSubscriberApiTest.php @@ -0,0 +1,134 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for createSmsSubscriber + * + * Create email subscriber. + * + */ + public function testCreateSmsSubscriber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for fetchAllSmsSubscribers + * + * Fetch all email subscribers. + * + */ + public function testFetchAllSmsSubscribers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for restoreSmsSubscriber + * + * Restore email subscriber. + * + */ + public function testRestoreSmsSubscriber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for updateSmsSubscriber + * + * Update email subscriber. + * + */ + public function testUpdateSmsSubscriber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ClaimTicketRequestTest.php b/test/Model/ClaimTicketRequestTest.php new file mode 100644 index 0000000..1a1e6c0 --- /dev/null +++ b/test/Model/ClaimTicketRequestTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "claimed_by_phone_number" + */ + public function testPropertyClaimedByPhoneNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CountClaimedComps200ResponseTest.php b/test/Model/CountClaimedComps200ResponseTest.php new file mode 100644 index 0000000..05740f9 --- /dev/null +++ b/test/Model/CountClaimedComps200ResponseTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "seats" + */ + public function testPropertySeats() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/CreateFile200ResponseTest.php b/test/Model/CreateFile200ResponseTest.php new file mode 100644 index 0000000..f70c1ae --- /dev/null +++ b/test/Model/CreateFile200ResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "size" + */ + public function testPropertySize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DynamicVoucherBroadcastListTypeTest.php b/test/Model/DynamicVoucherBroadcastListTypeTest.php new file mode 100644 index 0000000..335faa4 --- /dev/null +++ b/test/Model/DynamicVoucherBroadcastListTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/DynamicVoucherTemporalDecreaseFrequencyTypeTest.php b/test/Model/DynamicVoucherTemporalDecreaseFrequencyTypeTest.php new file mode 100644 index 0000000..006e81b --- /dev/null +++ b/test/Model/DynamicVoucherTemporalDecreaseFrequencyTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EmployeeScheduleStartDayTest.php b/test/Model/EmployeeScheduleStartDayTest.php new file mode 100644 index 0000000..f9d1807 --- /dev/null +++ b/test/Model/EmployeeScheduleStartDayTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EmployeeScheduleStartHourTest.php b/test/Model/EmployeeScheduleStartHourTest.php new file mode 100644 index 0000000..e2ae803 --- /dev/null +++ b/test/Model/EmployeeScheduleStartHourTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EmployeeScheduleStartMeridiemTest.php b/test/Model/EmployeeScheduleStartMeridiemTest.php new file mode 100644 index 0000000..4d38a31 --- /dev/null +++ b/test/Model/EmployeeScheduleStartMeridiemTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/EmployeeScheduleStartMinuteTest.php b/test/Model/EmployeeScheduleStartMinuteTest.php new file mode 100644 index 0000000..697f518 --- /dev/null +++ b/test/Model/EmployeeScheduleStartMinuteTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchAllCountries200ResponseInnerTest.php b/test/Model/FetchAllCountries200ResponseInnerTest.php new file mode 100644 index 0000000..577ad98 --- /dev/null +++ b/test/Model/FetchAllCountries200ResponseInnerTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "currency_abbreviation" + */ + public function testPropertyCurrencyAbbreviation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phone_code" + */ + public function testPropertyPhoneCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "iso2" + */ + public function testPropertyIso2() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchAllLedgerTransactions200ResponseTest.php b/test/Model/FetchAllLedgerTransactions200ResponseTest.php new file mode 100644 index 0000000..54787f1 --- /dev/null +++ b/test/Model/FetchAllLedgerTransactions200ResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entries" + */ + public function testPropertyEntries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page_count" + */ + public function testPropertyPageCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_records" + */ + public function testPropertyTotalRecords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerTest.php b/test/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerTest.php new file mode 100644 index 0000000..1f485be --- /dev/null +++ b/test/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerTest.php @@ -0,0 +1,199 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_design" + */ + public function testPropertyPaymentDesign() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value_type" + */ + public function testPropertyValueType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "voucher_type" + */ + public function testPropertyVoucherType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "expiration_date" + */ + public function testPropertyExpirationDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "start_date" + */ + public function testPropertyStartDate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "is_redeemed" + */ + public function testPropertyIsRedeemed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "display_value" + */ + public function testPropertyDisplayValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "offer_amount_cents_decimal" + */ + public function testPropertyOfferAmountCentsDecimal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "offer_amount_cents" + */ + public function testPropertyOfferAmountCents() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "member_id" + */ + public function testPropertyMemberId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cell_phone_number" + */ + public function testPropertyCellPhoneNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueTypeTest.php b/test/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueTypeTest.php new file mode 100644 index 0000000..5bd8ba8 --- /dev/null +++ b/test/Model/FetchAllStaticVouchersAssociatedWithCustomerWithVoucherID200ResponseInnerValueTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchCustomerTicketsWithTokenRequestTest.php b/test/Model/FetchCustomerTicketsWithTokenRequestTest.php new file mode 100644 index 0000000..21af1f3 --- /dev/null +++ b/test/Model/FetchCustomerTicketsWithTokenRequestTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "phone_verification_token" + */ + public function testPropertyPhoneVerificationToken() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "merchant_id" + */ + public function testPropertyMerchantId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchDomainsByIndustry200ResponseTest.php b/test/Model/FetchDomainsByIndustry200ResponseTest.php new file mode 100644 index 0000000..9509a59 --- /dev/null +++ b/test/Model/FetchDomainsByIndustry200ResponseTest.php @@ -0,0 +1,145 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entertainment" + */ + public function testPropertyEntertainment() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "grocery" + */ + public function testPropertyGrocery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "service" + */ + public function testPropertyService() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "casino" + */ + public function testPropertyCasino() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hospitality" + */ + public function testPropertyHospitality() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "food" + */ + public function testPropertyFood() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "retail" + */ + public function testPropertyRetail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchImportedListRecipientsByPage200ResponseTest.php b/test/Model/FetchImportedListRecipientsByPage200ResponseTest.php new file mode 100644 index 0000000..9457f1c --- /dev/null +++ b/test/Model/FetchImportedListRecipientsByPage200ResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total" + */ + public function testPropertyTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "length" + */ + public function testPropertyLength() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchInboundSMSByPage200ResponseTest.php b/test/Model/FetchInboundSMSByPage200ResponseTest.php new file mode 100644 index 0000000..734179c --- /dev/null +++ b/test/Model/FetchInboundSMSByPage200ResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total" + */ + public function testPropertyTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "length" + */ + public function testPropertyLength() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchIndustry200ResponseTest.php b/test/Model/FetchIndustry200ResponseTest.php new file mode 100644 index 0000000..bbe1b2b --- /dev/null +++ b/test/Model/FetchIndustry200ResponseTest.php @@ -0,0 +1,127 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plans" + */ + public function testPropertyPlans() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "title" + */ + public function testPropertyTitle() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "icon" + */ + public function testPropertyIcon() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sort_number" + */ + public function testPropertySortNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchMembersCount200ResponseTest.php b/test/Model/FetchMembersCount200ResponseTest.php new file mode 100644 index 0000000..759fab0 --- /dev/null +++ b/test/Model/FetchMembersCount200ResponseTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchOptInListSubscribersByPage200ResponseTest.php b/test/Model/FetchOptInListSubscribersByPage200ResponseTest.php new file mode 100644 index 0000000..e5d7266 --- /dev/null +++ b/test/Model/FetchOptInListSubscribersByPage200ResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total" + */ + public function testPropertyTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "length" + */ + public function testPropertyLength() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchOutboundSMSByPage200ResponseTest.php b/test/Model/FetchOutboundSMSByPage200ResponseTest.php new file mode 100644 index 0000000..12b8e9e --- /dev/null +++ b/test/Model/FetchOutboundSMSByPage200ResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total" + */ + public function testPropertyTotal() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "length" + */ + public function testPropertyLength() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchPerformanceTicketsPage200ResponseTest.php b/test/Model/FetchPerformanceTicketsPage200ResponseTest.php new file mode 100644 index 0000000..9eb986a --- /dev/null +++ b/test/Model/FetchPerformanceTicketsPage200ResponseTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_rows" + */ + public function testPropertyTotalRows() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/FetchStaticVouchersPage200ResponseTest.php b/test/Model/FetchStaticVouchersPage200ResponseTest.php new file mode 100644 index 0000000..b809c8f --- /dev/null +++ b/test/Model/FetchStaticVouchersPage200ResponseTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "data" + */ + public function testPropertyData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "total_rows" + */ + public function testPropertyTotalRows() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/ImportTicketsRequestTest.php b/test/Model/ImportTicketsRequestTest.php new file mode 100644 index 0000000..52f88f2 --- /dev/null +++ b/test/Model/ImportTicketsRequestTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tickets" + */ + public function testPropertyTickets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LedgerEntryParentObjectIDTest.php b/test/Model/LedgerEntryParentObjectIDTest.php new file mode 100644 index 0000000..3909297 --- /dev/null +++ b/test/Model/LedgerEntryParentObjectIDTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LedgerEntryTransactionTypeTest.php b/test/Model/LedgerEntryTransactionTypeTest.php new file mode 100644 index 0000000..8a26740 --- /dev/null +++ b/test/Model/LedgerEntryTransactionTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LoginStatus200ResponseAnyOfTest.php b/test/Model/LoginStatus200ResponseAnyOfTest.php new file mode 100644 index 0000000..65d7ef3 --- /dev/null +++ b/test/Model/LoginStatus200ResponseAnyOfTest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/LoginStatus200ResponseTest.php b/test/Model/LoginStatus200ResponseTest.php new file mode 100644 index 0000000..371003f --- /dev/null +++ b/test/Model/LoginStatus200ResponseTest.php @@ -0,0 +1,109 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "code" + */ + public function testPropertyCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MSMemberRedemptionTransactionTypeTest.php b/test/Model/MSMemberRedemptionTransactionTypeTest.php new file mode 100644 index 0000000..1017e06 --- /dev/null +++ b/test/Model/MSMemberRedemptionTransactionTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MemberSearchSearchKeyTest.php b/test/Model/MemberSearchSearchKeyTest.php new file mode 100644 index 0000000..8db6963 --- /dev/null +++ b/test/Model/MemberSearchSearchKeyTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/MemberSearchSortKeyTest.php b/test/Model/MemberSearchSortKeyTest.php new file mode 100644 index 0000000..c82b466 --- /dev/null +++ b/test/Model/MemberSearchSortKeyTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PaginationRequestWithSortOptionsSortOrderTest.php b/test/Model/PaginationRequestWithSortOptionsSortOrderTest.php new file mode 100644 index 0000000..53f3b85 --- /dev/null +++ b/test/Model/PaginationRequestWithSortOptionsSortOrderTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceIDTest.php b/test/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceIDTest.php new file mode 100644 index 0000000..0d9a267 --- /dev/null +++ b/test/Model/PickSSOptInListMemberUpdateParamsExcludeKeyofSSOptInListMemberUpdateParamsMerchantCreatedAtOrMaxSMSCountOptInSourceIDTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastIDTest.php b/test/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastIDTest.php new file mode 100644 index 0000000..155c756 --- /dev/null +++ b/test/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhonePaymentObjectBroadcastIDTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatusTest.php b/test/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatusTest.php new file mode 100644 index 0000000..b122141 --- /dev/null +++ b/test/Model/PickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhoneStatusTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueTypeTest.php b/test/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueTypeTest.php new file mode 100644 index 0000000..3eba40c --- /dev/null +++ b/test/Model/PickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDateValueTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleTypeTest.php b/test/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleTypeTest.php new file mode 100644 index 0000000..cee081a --- /dev/null +++ b/test/Model/PickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsIdBorderStyleTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterIDTest.php b/test/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterIDTest.php new file mode 100644 index 0000000..e2cca39 --- /dev/null +++ b/test/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtRegisterIDTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionTypeTest.php b/test/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionTypeTest.php new file mode 100644 index 0000000..394e68a --- /dev/null +++ b/test/Model/PickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAtTransactionTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthdayTest.php b/test/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthdayTest.php new file mode 100644 index 0000000..ea764e7 --- /dev/null +++ b/test/Model/PickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumberOrEmailOrBirthdayTest.php @@ -0,0 +1,154 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "member_id" + */ + public function testPropertyMemberId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "first_name" + */ + public function testPropertyFirstName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "last_name" + */ + public function testPropertyLastName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "membership_tier_id" + */ + public function testPropertyMembershipTierId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mobile_number" + */ + public function testPropertyMobileNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "email" + */ + public function testPropertyEmail() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "birthday" + */ + public function testPropertyBirthday() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "points_accrued" + */ + public function testPropertyPointsAccrued() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatusTest.php b/test/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatusTest.php new file mode 100644 index 0000000..31aee11 --- /dev/null +++ b/test/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDBroadcastStatusTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefixTest.php b/test/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefixTest.php new file mode 100644 index 0000000..b56a0d4 --- /dev/null +++ b/test/Model/PickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListIDPaymentObjectPrefixTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsIdTest.php b/test/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsIdTest.php new file mode 100644 index 0000000..4ec8f0b --- /dev/null +++ b/test/Model/PickWTSmsSubscriberUpdateParamsExcludeKeyofWTSmsSubscriberUpdateParamsIdTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mobile_number" + */ + public function testPropertyMobileNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SaveMerchantCreditPaymentDesignRequestTest.php b/test/Model/SaveMerchantCreditPaymentDesignRequestTest.php new file mode 100644 index 0000000..02a92e0 --- /dev/null +++ b/test/Model/SaveMerchantCreditPaymentDesignRequestTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_design_id" + */ + public function testPropertyPaymentDesignId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SaveTicketSettingsRequestPaymentDesignIDTest.php b/test/Model/SaveTicketSettingsRequestPaymentDesignIDTest.php new file mode 100644 index 0000000..4cecaa1 --- /dev/null +++ b/test/Model/SaveTicketSettingsRequestPaymentDesignIDTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SaveTicketSettingsRequestTest.php b/test/Model/SaveTicketSettingsRequestTest.php new file mode 100644 index 0000000..6406f10 --- /dev/null +++ b/test/Model/SaveTicketSettingsRequestTest.php @@ -0,0 +1,118 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "redemption_instructions" + */ + public function testPropertyRedemptionInstructions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ticket_expiration_date_time" + */ + public function testPropertyTicketExpirationDateTime() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "max_comp_tickets" + */ + public function testPropertyMaxCompTickets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "payment_design_id" + */ + public function testPropertyPaymentDesignId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/SmsSubscriberTest.php b/test/Model/SmsSubscriberTest.php new file mode 100644 index 0000000..6b9d2a1 --- /dev/null +++ b/test/Model/SmsSubscriberTest.php @@ -0,0 +1,136 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mobile_number" + */ + public function testPropertyMobileNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "created_at" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updated_at" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "is_active" + */ + public function testPropertyIsActive() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "merchant_id" + */ + public function testPropertyMerchantId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UpdateEmailNotificationPreferenceRequestTest.php b/test/Model/UpdateEmailNotificationPreferenceRequestTest.php new file mode 100644 index 0000000..84b3e15 --- /dev/null +++ b/test/Model/UpdateEmailNotificationPreferenceRequestTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "is_email_notification_disabled" + */ + public function testPropertyIsEmailNotificationDisabled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/UpdateStaticVoucherCampaignWithVoucherVoucherIDTest.php b/test/Model/UpdateStaticVoucherCampaignWithVoucherVoucherIDTest.php new file mode 100644 index 0000000..9966153 --- /dev/null +++ b/test/Model/UpdateStaticVoucherCampaignWithVoucherVoucherIDTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTDynamicVoucherRedemptionTransactionTypeTest.php b/test/Model/WTDynamicVoucherRedemptionTransactionTypeTest.php new file mode 100644 index 0000000..c4d5a59 --- /dev/null +++ b/test/Model/WTDynamicVoucherRedemptionTransactionTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTDynamicVoucherSummaryStatusTest.php b/test/Model/WTDynamicVoucherSummaryStatusTest.php new file mode 100644 index 0000000..c28b25c --- /dev/null +++ b/test/Model/WTDynamicVoucherSummaryStatusTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTEmployeeNotificationTypeTest.php b/test/Model/WTEmployeeNotificationTypeTest.php new file mode 100644 index 0000000..36594a1 --- /dev/null +++ b/test/Model/WTEmployeeNotificationTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTEmployeeS3FilePresignContextTest.php b/test/Model/WTEmployeeS3FilePresignContextTest.php new file mode 100644 index 0000000..88c83b0 --- /dev/null +++ b/test/Model/WTEmployeeS3FilePresignContextTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTEmployeeScheduleSimpleSMSListTypeTest.php b/test/Model/WTEmployeeScheduleSimpleSMSListTypeTest.php new file mode 100644 index 0000000..439bcb2 --- /dev/null +++ b/test/Model/WTEmployeeScheduleSimpleSMSListTypeTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTImportedListRecipientFromMembershipTierImportTierIDTest.php b/test/Model/WTImportedListRecipientFromMembershipTierImportTierIDTest.php new file mode 100644 index 0000000..008cb22 --- /dev/null +++ b/test/Model/WTImportedListRecipientFromMembershipTierImportTierIDTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTLinkBookLinkBookSectionIDTest.php b/test/Model/WTLinkBookLinkBookSectionIDTest.php new file mode 100644 index 0000000..71c8dc3 --- /dev/null +++ b/test/Model/WTLinkBookLinkBookSectionIDTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTMembershipTierIdTest.php b/test/Model/WTMembershipTierIdTest.php new file mode 100644 index 0000000..bdf6247 --- /dev/null +++ b/test/Model/WTMembershipTierIdTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTSmsSubscriberCreateParamsTest.php b/test/Model/WTSmsSubscriberCreateParamsTest.php new file mode 100644 index 0000000..367946c --- /dev/null +++ b/test/Model/WTSmsSubscriberCreateParamsTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mobile_number" + */ + public function testPropertyMobileNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTSmsSubscriberCreateParamsWalletUITest.php b/test/Model/WTSmsSubscriberCreateParamsWalletUITest.php new file mode 100644 index 0000000..8364efc --- /dev/null +++ b/test/Model/WTSmsSubscriberCreateParamsWalletUITest.php @@ -0,0 +1,100 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mobile_number" + */ + public function testPropertyMobileNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "merchant_id" + */ + public function testPropertyMerchantId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTSmsSubscriberUpdateParamsTest.php b/test/Model/WTSmsSubscriberUpdateParamsTest.php new file mode 100644 index 0000000..a1bf7f4 --- /dev/null +++ b/test/Model/WTSmsSubscriberUpdateParamsTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "mobile_number" + */ + public function testPropertyMobileNumber() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTTCPAOptListIDTest.php b/test/Model/WTTCPAOptListIDTest.php new file mode 100644 index 0000000..e1c28f4 --- /dev/null +++ b/test/Model/WTTCPAOptListIDTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTTCPAOptSourceIDTest.php b/test/Model/WTTCPAOptSourceIDTest.php new file mode 100644 index 0000000..2abac30 --- /dev/null +++ b/test/Model/WTTCPAOptSourceIDTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WTWalletPageViewIdTest.php b/test/Model/WTWalletPageViewIdTest.php new file mode 100644 index 0000000..4506a74 --- /dev/null +++ b/test/Model/WTWalletPageViewIdTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/test/Model/WalletConfigurationSmsOptInSourceIDTest.php b/test/Model/WalletConfigurationSmsOptInSourceIDTest.php new file mode 100644 index 0000000..4b2fd7b --- /dev/null +++ b/test/Model/WalletConfigurationSmsOptInSourceIDTest.php @@ -0,0 +1,82 @@ +markTestIncomplete('Not implemented'); + } +}